guest_audio_out_port_bounds crashes in libpulse (pa_stream_unref) on PipeWire hosts under parallel ctest #23020

Closed
opened 2026-11-18 16:43:13 +00:00 by PxT00 · 0 comments
PxT00 commented 2026-11-18 16:43:13 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by PxT00 on 2026-11-18T16:43:13Z.


What happens

guest_audio_out_port_bounds crashes with SIGSEGV on about 14% of runs when the host has a real PulseAudio server (here PipeWire's pipewire-pulse) and the machine is under load, as during a parallel ctest. It passes when run alone. The test does not set SDL_AUDIODRIVER, so SDL opens real PulseAudio streams for its 32 ports; other AudioOut tests set dummy or disk (the vibration tests in libSceAudioOut/CMakeLists.txt, AudioOutShutdown.cpp, AudioOut2Timing.cpp).

All four cores I inspected stop in the same place, on libpulse's mainloop thread, while the main thread is inside PULSEAUDIO_OpenDevice from sceAudioOutOpen:

Thread 1 (crashing, libpulse mainloop):
#0 pa_hashmap_remove_all () libpulsecommon-17.0.so
#1 pa_hashmap_free ()       libpulsecommon-17.0.so
#2 pa_stream_unref ()       libpulse.so.0
#3 pa_pdispatch_run ()      libpulsecommon-17.0.so
...
#9 pa_mainloop_run ()       libpulse.so.0
Thread 2 (main):
#3 pa_threaded_mainloop_wait () libpulse.so.0
#4 PULSEAUDIO_OpenDevice ()     libSceAudioOut.prx (bundled SDL2)
#5 open_audio_device ()
#6 openDevice(Port&)
#7 allocatePort(int, unsigned int, unsigned int, Format)
#8 main ()
Thread 3: SDL HotplugThread in pa_threaded_mainloop_wait

Title, test or build step

ctest guest_audio_out_port_bounds

AnyPS5 commit

main cbbeedc99d, no pull requests on top.

System

CachyOS, Linux 7.3.4-1-cachyos, GCC 16.2.1, Release. AMD Ryzen 5 5500, AMD Radeon RX 7600 (RADV NAVI33, Mesa 26.2.5). Audio: PulseAudio 17.0 client libraries on PipeWire 1.6.11. Bundled SDL2 release-2.32.0-260-g74be4c283.

Host report

Not applicable: a test executable, not a title.

Steps to reproduce

  1. Full Release build with BUILD_TESTING=ON on a Linux host whose PulseAudio server is running (PipeWire or PulseAudio).
  2. From build/core/libs/prx/libSceAudioOut, start 12 copies at once, ten times:
    for r in $(seq 10); do for i in $(seq 12); do ../../../../tests/guest_audio_out_port_bounds_tests >/dev/null 2>&1; echo $? & done; wait; done | sort | uniq -c
  3. Some runs exit with 139. coredumpctl gdb on one shows the stack above.

Log

real PulseAudio:          103 passed, 17 SIGSEGV (exit 139) of 120
SDL_AUDIODRIVER=dummy:    120 passed of 120
full ctest -j12 on main:  guest_audio_out_port_bounds (SEGFAULT)

What was checked

  • Alone (ctest -R, 5 runs) it passes; only concurrent runs crash, so it depends on timing.
  • Same stack in all four cores inspected; the crash never reached a Require (exit 139, not the 134 of abort).
  • Under gdb the timing changes and 15 runs did not crash.
  • With SDL_AUDIODRIVER=dummy the crash disappears (120/120), and through ctest with the property set, 120/120.
  • I did not establish whether the bug is in SDL's PulseAudio backend or in libpulse, or whether titles that open many ports hit it on PipeWire hosts.
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:6472066513 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/23020). Originally posted by [PxT00](https://github.com/PxT00) on 2026-11-18T16:43:13Z. --- ### What happens `guest_audio_out_port_bounds` crashes with SIGSEGV on about 14% of runs when the host has a real PulseAudio server (here PipeWire's `pipewire-pulse`) and the machine is under load, as during a parallel `ctest`. It passes when run alone. The test does not set `SDL_AUDIODRIVER`, so SDL opens real PulseAudio streams for its 32 ports; other AudioOut tests set `dummy` or `disk` (the vibration tests in `libSceAudioOut/CMakeLists.txt`, `AudioOutShutdown.cpp`, `AudioOut2Timing.cpp`). All four cores I inspected stop in the same place, on libpulse's mainloop thread, while the main thread is inside `PULSEAUDIO_OpenDevice` from `sceAudioOutOpen`: ```text Thread 1 (crashing, libpulse mainloop): #0 pa_hashmap_remove_all () libpulsecommon-17.0.so #1 pa_hashmap_free () libpulsecommon-17.0.so #2 pa_stream_unref () libpulse.so.0 #3 pa_pdispatch_run () libpulsecommon-17.0.so ... #9 pa_mainloop_run () libpulse.so.0 Thread 2 (main): #3 pa_threaded_mainloop_wait () libpulse.so.0 #4 PULSEAUDIO_OpenDevice () libSceAudioOut.prx (bundled SDL2) #5 open_audio_device () #6 openDevice(Port&) #7 allocatePort(int, unsigned int, unsigned int, Format) #8 main () Thread 3: SDL HotplugThread in pa_threaded_mainloop_wait ``` ### Title, test or build step ctest `guest_audio_out_port_bounds` ### AnyPS5 commit `main` `cbbeedc99d`, no pull requests on top. ### System CachyOS, Linux 7.3.4-1-cachyos, GCC 16.2.1, Release. AMD Ryzen 5 5500, AMD Radeon RX 7600 (RADV NAVI33, Mesa 26.2.5). Audio: PulseAudio 17.0 client libraries on PipeWire 1.6.11. Bundled SDL2 `release-2.32.0-260-g74be4c283`. ### Host report ```text Not applicable: a test executable, not a title. ``` ### Steps to reproduce 1. Full Release build with `BUILD_TESTING=ON` on a Linux host whose PulseAudio server is running (PipeWire or PulseAudio). 2. From `build/core/libs/prx/libSceAudioOut`, start 12 copies at once, ten times: `for r in $(seq 10); do for i in $(seq 12); do ../../../../tests/guest_audio_out_port_bounds_tests >/dev/null 2>&1; echo $? & done; wait; done | sort | uniq -c` 3. Some runs exit with 139. `coredumpctl gdb` on one shows the stack above. ### Log ```text real PulseAudio: 103 passed, 17 SIGSEGV (exit 139) of 120 SDL_AUDIODRIVER=dummy: 120 passed of 120 full ctest -j12 on main: guest_audio_out_port_bounds (SEGFAULT) ``` ### What was checked - Alone (`ctest -R`, 5 runs) it passes; only concurrent runs crash, so it depends on timing. - Same stack in all four cores inspected; the crash never reached a `Require` (exit 139, not the 134 of `abort`). - Under gdb the timing changes and 15 runs did not crash. - With `SDL_AUDIODRIVER=dummy` the crash disappears (120/120), and through `ctest` with the property set, 120/120. - I did not establish whether the bug is in SDL's PulseAudio backend or in libpulse, or whether titles that open many ports hit it on PipeWire hosts.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5#23020
No description provided.