-
Notifications
You must be signed in to change notification settings - Fork 328
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
Angband-4.2.5 sometimes doesn't start #5952
Comments
It's an odd one. I'd start by trying running it either in a debugger like gdb or a memory tool like valgrind, and see if you get any useful messages. If I had to guess I'd say something to do with file paths, but that is really a guess. Let us know how it goes. |
How frequently does it fail to start up? Is this with a setgid version? I built and installed 4.2.5 on OpenBSD 7.4 ((EDIT: 32-bit kernel; i386) running in a Parallels virtual machine on macOS). Angband was configured with "--with-private-dirs --enable-sdl2 --prefix=$HOME/angband-4.2.5". The SDL2 front end got to the splash screen without trouble when I launched it about 20 times. In another roughly 20 launches with a character who had sound on, it got to the splash screen and loaded the first level of the dungeon without trouble. |
Just now it took 12 attempts to get angband to start.
Yes, and this certainly has to do with the setgid bit. Am I doing this right? The port Makefile contains:
Once the package is installed:
If I copy the binary to Annoyingly I'm unable to ktrace this, as it's setgid. |
--with-varpath is ignored by configure on the system I have access to (OpenBSD 7.4; 32 bit; i386). I would recommend using --localstatedir=/var instead (--localstatedir=/var/games/angband results in Angband using /var/games/angband/games/angband for the save files and high scores). When I built and installed with
on that system (the setting for prefix there was just to avoid interfering with existing files), the executable got to the splash screen without trouble for six consecutive runs. However, that was with a 32-bit build which is likely different than your environment. |
Thanks. I tried I also notice:
backtrace:
(I have no save games at the moment) |
When I set up a virtual machine with the amd64 version of OpenBSD 7.4 and built a setgid version of Angband 4.2.5 using the same procedure as I mentioned above for the i386 version of OpenBSD 7.4, the results were much the same as with the 32-bit version: all runs of the installed setgid executable got to the splash screen. You mentioned what you have for the permissions of /var/games/angband, and those match what I see. What are the permissions on the contents of /var/games/angband? What I have from "ls -lR /var/games/angband" as root is
Is there any trouble getting the artifact spoilers with "/usr/local/bin/angband -mspoil -a spoil.txt"? spoil.txt should be created in ~/.angband/Angband. Running it under the debugger with a breakpoint on the quit() routine would be my suggestion for trying to debug this, but the usual recommendation for debugging a setgid/setuid executable is to attach the debugger (run as root) after the process has started. That requires some point where the process pauses/stops before doing what one wants to debug, and Angband does not have such a point without modifying main.c (it is tempting to add support for a -p ("pause") option to main.c which would stop the process allowing a debugger to be attached). Another quick hack to the source that could help trace what's happening is to modify splashscreen_note() in ui-display.c so what would be displayed in Angband's front end for the case that's not MSG_BIRTH is also echoed to stderr. The fact that it is exiting for you with a zero error code suggests that a signal is triggering either the handle_signal_simple() or handle_signal_abort() handlers in ui-signals.c: those call quit(NULL) if a character has not been created yet. |
I printed the PID in quit() and added a sleep. Got this trace:
So this is audio-related. When I configure with There's another bug about broken sound on OpenBSD already (#4037). Although this looks like a different (additional?) issue, I'll probably just keep sound disabled in our package for now. Should it have exited with status zero though? It would be nice if it could at least say "a fatal signal was encountered and angband is now exiting" followed by a non-zero exit code. Thanks |
That sound issue is different than #4037 which caused the game compiled with SDL 1.2 to hang when a sound was played. Changing how smpeg handled the monaural sound files packaged with Angband appeared to resolve that (proposed patch here: https://marc.info/?l=openbsd-ports&m=162187552125402&w=2 ). Converting the sound files to stereo would also avoid that problem. Here the issue is with Mix_OpenAudio() using libsndio: apparently a SIGPIPE signal when trying to set up the connection to the audio server. I agree that the signal handlers in ui-signals.c should do something other than quit(NULL) so there's more information about what caused the game to exit when there isn't a character to save. |
… number That is to help diagnose issues like angband#5952 .
… number That is to help diagnose issues like #5952 .
… number That is to help diagnose issues like angband/angband#5952 .
Setting this to future for now |
Hi,
I'm updating the OpenBSD package to 4.2.5. I notice that angband non-deterministically doesn't start.
This appears to occurs with all frontends. When you use sdl or sdl2, the GUI window flashes up before immediately disappearing.
When this happens angband exits with zero status.
Does anyone have any ideas why this may be, or what I could try to debug this?
Thanks
The text was updated successfully, but these errors were encountered: