Script to restart ES or reboot system on segfault or es crash?
There's a bug that crashes the current ES 2.7.5RP when you play with the menus in full user mode.
It crashes with this message pretty reliably:
emulationstation: /home/pi/RetroPie-Setup/tmp/build/emulationstation/es-core/src/components/OptionListComponent.h:235: T OptionListComponent<T>::getSelected() [with T = std::__cxx11::basic_string<char>]: Assertion `selected.size() ==1` failed. Aborted
I'm sure that will be fixed in the next version of ES but sometimes on rare occasion I've seen segment fault. When this happens, the console is not responsive and the only solution is unplug/replug. The system still functions if I putty into it though, so it's still working. I figure a simple python or bash watchdog script would be nice to catch that which I can do. But other than looping to see if ES is running, are there other fault events I can monitor to trigger on?
pjft last edited by
That's a weird and surprising one. I suspect that if this was an issue that could be reproduced reliably it'd be a lot more widespread in terms of reports. 2.7.5 has been around for several months by now and I don't recall ever seeing such a report - or experiencing it myself, and I use that menu fairly frequently.
Can you share more information on your system, per the forum's "read this" post? Maybe that can help. The ES settings and /boot/config.txt files at least may come in handy. What screen resolution and pi are you on? And does it happen only if you select the back button, or also if youexit that menu using the B button? And what do you mean by reliably - does it crash for you most of the time, or you mean that "when it crashes it'll reliably be with this message"?
I don't have access to my pi for a few days to perform this simple test, so apologies if some of these are redundant, or if it is indeed something that happens all the time but it happens to be that nobody uses that button so it hasn't been reported yet (which I doubt, but I've seen my share of unexpected bugs).
RetroPie v4.4 • RPi3 Model B • 5.1V 2.5A PSU • 16GB SanDisk class 10 microSD • 16GB External USB Thumb Drive • No Beta/Experimental
Roms, images, and configs stored in USB and symlinked from normal microsd location. Xarcade Keyboard encoder
Come to think of it when I first installed, I also recall using this menu as I explored new things and had no crashing. Not sure why it would start now.
Nevermind. Turns out when I edited the es_settings.cfg file manually.. I had a typo in the PowerSaver value and it was resulting as not being set. I set it and now its fine.
So for those interested, simply doing
to one of the startup locations should do it.. not tested yet
Clyde last edited by Clyde
@dsstrainer Thanks for sharing your find. I just tested it and it works fine, but only if the file is created (by
touchin your example) when ES is already running. ES seems to delete the file at start up, because it's actually meant for ES' restart option, as I understand it.
Thus, to use it as an everyday fail-safe in case ES crashes you'd have to find a way to create it automatically after ES has already started (edit: and to manually delete it if you want to shut down ES for good).
Just an addition to your advice, since you don't need it yourself anymore. :)