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

sdl2-compat: Calling Mix_CloseAudio() causes segfault (Arch Linux) #326

Open
sgpowers opened this issue Feb 7, 2025 · 2 comments
Open
Assignees
Milestone

Comments

@sgpowers
Copy link

sgpowers commented Feb 7, 2025

Arch Linux, at time of issue:

sdl2-compat 2.30.54-1
sdl2_image 2.8.4-1
sdl2_mixer 2.8.0-1
sdl2_ttf 2.24.0-1
sdl3 3.2.4-1

Mix_CloseAudio () is called once as the app exits, but even multiple calls should have no issue in SDL2.

There are no devices open as confirmed with SDL_GetNumAudioDevices(0) and various Mix_QuerySpec checks.

    Mix_CloseAudio();
    Mix_Quit();

    TTF_Quit();
    IMG_Quit();
    SDL_Quit();

gdb output below.

Reading symbols from /usr/local/bin/hypseus.bin...
[New LWP 8995]

This GDB supports auto-downloading debuginfo from the following URLs:
  <https://debuginfod.archlinux.org>
Enable debuginfod for this session? (y or [n]) y
Debuginfod has been enabled.
To make this setting permanent, add 'set debuginfod enabled on' to .gdbinit.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
Core was generated by `/usr/local/bin/hypseus.bin singe vldp -framefile /home/user/.daphne/singe/maddog/maddog.txt -script /home/user/.daphne/roms/maddog.zip -homedir /home/user/.daphne -datadir /home/user/.daphne -sound_buffer 2048 -volume_nonvldp 5 -volume_vldp 20'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=11, no_tid=no_tid@entry=0) at pthread_kill.c:44
44            return INTERNAL_SYSCALL_ERROR_P (ret) ? INTERNAL_SYSCALL_ERRNO (ret) : 0;
(gdb) bt
#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=11, no_tid=no_tid@entry=0) at pthread_kill.c:44
#1  0x000076bb6ffad6d3 in __pthread_kill_internal (threadid=<optimized out>, signo=11) at pthread_kill.c:89
#2  0x000076bb6ff53ba0 in __GI_raise (sig=sig@entry=11) at ../sysdeps/posix/raise.c:26
#3  0x000076bb6558bf2b in SDL_EVDEV_kbd_reraise_signal (sig=11) at /usr/src/debug/sdl3/SDL3-3.2.4/src/core/linux/SDL_evdev_kbd.c:186
#4  kbd_cleanup_signal_action (signum=11, info=<optimized out>, ucontext=<optimized out>) at /usr/src/debug/sdl3/SDL3-3.2.4/src/core/linux/SDL_evdev_kbd.c:213
#5  <signal handler called>
#6  0x000076bb6542437a in SDL_ClearAudioQueue (queue=0x6245b73e36a0) at /usr/src/debug/sdl3/SDL3-3.2.4/src/audio/SDL_audioqueue.c:187
#7  SDL_DestroyAudioQueue (queue=0x6245b73e36a0) at /usr/src/debug/sdl3/SDL3-3.2.4/src/audio/SDL_audioqueue.c:143
#8  0x000076bb6542d69c in SDL_DestroyAudioStream_REAL (stream=0x6245b7298ff0) at /usr/src/debug/sdl3/SDL3-3.2.4/src/audio/SDL_audiocvt.c:1323
#9  0x000076bb705a371e in SDL_FreeAudioStream_REAL (stream2=0x6245b746b0b0) at /usr/src/debug/sdl2-compat/sdl2-compat-2.30.54/src/sdl2_compat.c:6553
#10 0x000076bb705a3ae8 in SDL_CloseAudioDevice_REAL (dev=2) at /usr/src/debug/sdl2-compat/sdl2-compat-2.30.54/src/sdl2_compat.c:6714
#11 0x000076bb70555913 in Mix_CloseAudio () at src/mixer.c:1399
#12 0x000062458bbaee8a in main ()
(gdb)

Thanks for the great work as ever.

@sgpowers
Copy link
Author

sgpowers commented Feb 8, 2025

I am guessing this is related to #313 - Apologies on the duplication if so.

@icculus
Copy link
Collaborator

icculus commented Feb 8, 2025

I think it is related, but let's keep this open until that resolves in case we're wrong.

@icculus icculus self-assigned this Feb 8, 2025
@icculus icculus added this to the 2.30.56 milestone Feb 8, 2025
@slouken slouken modified the milestones: 2.32.50, 2.32.52 Feb 8, 2025
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