Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ES crashes in screensaver #663

Open
Wintermute0110 opened this issue Jun 23, 2020 · 9 comments
Open

ES crashes in screensaver #663

Wintermute0110 opened this issue Jun 23, 2020 · 9 comments

Comments

@Wintermute0110
Copy link

Wintermute0110 commented Jun 23, 2020

I am using Retropie ES on a Intel NUC x64 with Ubuntu Linux. ES crashes very occasionally when in the screensaver. Note that when using ES for browing games and platforms it never crashes. Only crashes when in screensaver mode. I use a xbox 360 wireless gamepad and after some time the gamepad auto powers off (not sure if this info is relevant or not).

I compiled a debug version of ES, generated a core dump and used GDB to get a backtrace. I hope this help to fix the bug.

(gdb) back
#0  0x000055bcc59ce6d6 in InputManager::parseEvent (this=0x55bcc6736050, ev=..., window=0x7ffe4e766ae0)
    at /home/kodi/EmulationStation-Install/retropie-EmulationStation/es-core/src/InputManager.cpp:212
#1  0x000055bcc584a2e6 in main (argc=1, argv=0x7ffe4e766f98) at /home/kodi/EmulationStation-Install/retropie-EmulationStation/es-app/src/main.cpp:401
@pjft
Copy link
Collaborator

pjft commented Jun 23, 2020

Thanks.

The line itself seems pretty innocuous, which, if it is that code you're running, can suggest either something going wrong on the SDL event side of things (ev.jaxis.value)or on the mPrevAxisValues[ev.jaxis.which][ev.jaxis.axis] front, but it's super opaque.
https://github.com/RetroPie/EmulationStation/blob/master/es-core/src/InputManager.cpp#L212

The info on the controller is relevant, but still lacking.

Can you bring it to the forums, and add more detail around what type of screensaver you're running (though if it's in that line, it probably doesn't really matter) and the actual emulationstation log from a session where it crashes.

Thanks.

@Wintermute0110
Copy link
Author

Wintermute0110 commented Jun 24, 2020

@pjft I agree, I am a bit puzzled myself when I saw the code. It looks like a SDL bug rather than an ES bug (SDL returns a SDL_JOYAXISMOTION event but the ev struct is invalid). What I did to solve the problem is modify the emulationstation.sh script to restart ES if it crashes, you can have a look here.

The screensaver I am running is the default one that shows a new game boxart every 10 seconds.

OK, I will try to get a log when the crash happens and post this in the forum. It may take some time, sometimes I have to let ES run for hours until the crash happens. I noticed it because sometimes I play a game, then do some other stuff and meanwhile the screensaver is active. When I return the X server was off and I saw ES have crashed looking at the xinit log with journalctl.

@cmitu
Copy link

cmitu commented Jun 24, 2020

Maybe it's something similar to #552 ?
It was (is ?) a SDL2 bug generating spurious events, patched locally in RetroPie's SDL2 version. But on x86, the distribution's package is used, so the patch is not applied.

@pjft
Copy link
Collaborator

pjft commented Jun 24, 2020

It might. I also face the odd crash when I launch a game, and then end up disconnecting a controller while outside of ES (for instance, while in-game) and returning to ES, but there the crash is related to an assert statement.

@Wintermute0110 I actually like your workaround on the script - it would certainly have come in handy a few times. I'm not the best at parsing bash - if you actually just select "exit ES" from the menu (well, assuming you were not running in no-exit mode), does it work as intended and actually exit ES to the command-line?

@cmitu
Copy link

cmitu commented Jun 24, 2020

It might. I also face the odd crash when I launch a game, and then end up disconnecting a controller while outside of ES (for instance, while in-game) and returning to ES, but there the crash is related to an assert statement.

Yes, that's a different problem and we should get rid of that assert (happened to me more than once while switching controllers during game).

@Wintermute0110
Copy link
Author

Wintermute0110 commented Jun 24, 2020

@cmitu Thanks, I think that's it. I'm using Ubuntu Focal Fossa which means SDL won't be updated because this is not a security issue so I will live with it. The crash only happens very occasionally and does not affect normal use.

@pjft Yeah, the script works well if you use the "Exit" option in ES menu. In that case ES returns 0 and there are no ES files in tmp so all the ifs don't execute, the loop breaks and the script returns 0. In a recent commit I added the option --no-exit because in my setup I do not have a keyboard regularly attached so I want ES to restart or shutdown the system only.

@pjft
Copy link
Collaborator

pjft commented Jun 24, 2020

@cmitu same here, though it's those things that only happen when you're not actively trying to replicate them. :) If you can find or send over the assert, I'll see what can be done - I did look into it in the past, I think, but didn't feel very comfortable either way as it was a part of the code I wasn't very familiar with.

@Wintermute0110 yes, same use case here, it's the arcade cabinet where the boys play. When it happens, "daddy" needs to come to the rescue via SSH, so I'll likely adopt part of the script. Thanks!

@cmitu
Copy link

cmitu commented Jun 24, 2020

@cmitu Thanks, I think that's it. I'm using Ubuntu Focal Fossa which means SDL won't be updated because this is not a security issue so I will live with it. The crash only happens very occasionally and does not affect normal use.

You could try to build SDL2 using https://github.com/RetroPie/SDL-mirror/tree/retropie-2.0.10 and use it just for EmulationStation (via LD_PRELOAD / LD_LIBRARY_PATH) to see if the issue is fixed.

One of the reasons we switched to the distro provided SDL2 was some hard-coded dependencies from other Ubuntu packages, which prevented replacing the distro's SDL2 with the RetroPie's .deb packages, so it's not possible to test using RetroPie's .debs.

@Wintermute0110
Copy link
Author

Wintermute0110 commented Jun 25, 2020

@cmitu I will try ASAP and report back.

I believe that using the distro available libraries whenever possible is a good idea which simplifies development (it's usually more convenient to develop in a desktop computer with a standard distro) and usage in standard Linux. In my case I like Intel NUC boxes to install Kodi and emulators. I recently upgraded my Intel NUC to use as HTPC and with the old box I am preparing a ES box as a gift for a friend (Kodi has too many bells and whistles and I want something simple). I understand people on a budget will prefer a Raspi and probably the Raspi has the best price/quality ratio, I myself own one to do some tests, but when you want some performance for demanding emus like the dolphin core I would go for a NUC although price is 4 or 5 times that of a Pi.

Also, let me thank you for your work. I have tried Batocera ES, Recalbox ES and Retropie ES, and Retropie ES is the only one that works well in Ubuntu. Please keep the compatibility with standard distros like Ubuntu in the future!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants