Symlink loop crashes (freezes) EmulationStation
-
I'm on RPi4 using emulationstation-dev
08d74d3
.With screensaver set to slideshow, custom media source and recursive set to true (
es_settings.cfg
, excerpt):<bool name="SlideshowScreenSaverCustomMediaSource" value="true" /> <bool name="SlideshowScreenSaverRecurse" value="true" /> <string name="ScreenSaverBehavior" value="slideshow" /> <string name="SlideshowScreenSaverMediaDir" value="/home/pi/.emulationstation/slideshow/image" />
...if the media dir contains two (2) separate paths that link back to itself (these can be in the media dir or in subdirs, the simplest example being):
pi@retropie:~/.emulationstation/slideshow/image $ ls -l total 0 lrwxrwxrwx 1 pi pi 42 May 29 11:32 link_a -> /home/pi/.emulationstation/slideshow/image lrwxrwxrwx 1 pi pi 42 May 29 11:32 link_b -> /home/pi/.emulationstation/slideshow/image
...then when the screensaver is engaged, EmulationStation will lock up:
- screen freezes with the system carousel or gamelist menu displayed
- keyboard and gamepad become unresponsive
- (num lock lamp does not illuminate when key pressed)
- background music (scripted using
mpg123
) continues to play - I can connect via SSH
- when I
pkill emulationstatio
via SSH, the.bashrc
is ran and kills the music. - when I run my custom "logmeout" script via SSH (kills the oldest local TTY1 instance of
bash
; thenautostart
will log me back in), the music (and, presumably, ES, though I can't see it behind the frozen screen) are restarted. - This whole time, the ES system carousel remains frozen onscreen.
- I can reboot over SSH.
- Alternatively, I can regain full control locally with Alt + SysRq + E (term all processes except init.) This will clear the screen and I see a quick scroll of text before ES and background music restart.
It seems to only happen with this dual-infinite-loop scenario. If I remove one of the symlinks, leaving the other and creating a single infinite loop, or if I turn off "recursive", the freeze doesn't happen & the slideshow works normally.
-
It probably happens because of an infinite loop when EmulationStation tries to 'normalize' the path for those links. Is there a real use case for this scenario of re-cursive links ?
-
@mitu said in Symlink loop crashes (freezes) EmulationStation:
Is there a real use case for this scenario of re-cursive links ?
Not at all, I only noticed it when I had accidentally placed some links wrong while trying to do something else. I'm not savvy enough to know whether this is a legitimate bug to be addressed in ES, or if the loop itself is just a cursed object that should never be allowed to exist in the first place.
-
It's a bug, but something that shouldn't affect many users since it wouldn't occur without this symlink loop. It's probably affecting also the reading of the ROM/game folders, which would make EmulationStation freeze on start-up in this kind of scenario.
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.