Skip to content

Crash on exit for underflow example #302

@thenewandy

Description

@thenewandy

Running the overflow test on ubuntu 24.10, I get a crash on exit:

(gdb) r
Starting program: /home/andy/scratch/libsoundio/foo/underflow 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
You should hear a sine wave for 3 seconds, then some period of silence or glitches,
then you should see at least one buffer underflow message, then hear a sine
wave for 3 seconds, then the program should exit successfully.
WASAPI does not report buffer underflows.
[New Thread 0x7ffff30006c0 (LWP 20869)]
Output device: Built-in Audio Digital Stereo (HDMI)
underflow 0
Assertion '!m->thread || !pa_thread_is_running(m->thread) || !in_worker(m) || pa_atomic_load(&m->in_once_unlocked)' failed at ../src/pulse/thread-mainloop.c:179, function pa_threaded_mainloop_lock(). Aborting.

Thread 2 "threaded-ml" received signal SIGABRT, Aborted.
[Switching to Thread 0x7ffff30006c0 (LWP 20869)]
__pthread_kill_implementation (threadid=<optimised out>, signo=6, no_tid=0) at ./nptl/pthread_kill.c:44
warning: 44	./nptl/pthread_kill.c: No such file or directory
(gdb) bt
#0  __pthread_kill_implementation (threadid=<optimised out>, signo=6, no_tid=0) at ./nptl/pthread_kill.c:44
#1  __pthread_kill_internal (threadid=<optimised out>, signo=6) at ./nptl/pthread_kill.c:78
#2  __GI___pthread_kill (threadid=<optimised out>, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
#3  0x00007ffff7c4519e in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#4  0x00007ffff7c28902 in __GI_abort () at ./stdlib/abort.c:79
#5  0x00007ffff7e7d3c5 in pa_threaded_mainloop_lock () from /lib/x86_64-linux-gnu/libpulse.so.0
#6  0x00007ffff7faa180 in wakeup_pa (si=0x55555555a330) at /home/andy/scratch/libsoundio/src/pulseaudio.c:499
#7  0x00007ffff7fa439a in soundio_wakeup (soundio=0x55555555a330) at /home/andy/scratch/libsoundio/src/soundio.c:434
#8  0x0000555555555777 in write_callback (outstream=0x555555562cf0, frame_count_min=0, frame_count_max=2048)
    at /home/andy/scratch/libsoundio/test/underflow.c:84
#9  0x00007ffff7faa70a in playback_stream_write_callback (stream=0x555555562fc0, nbytes=16384, userdata=0x555555562cf0)
    at /home/andy/scratch/libsoundio/src/pulseaudio.c:627
#10 0x00007ffff7e776b5 in ?? () from /lib/x86_64-linux-gnu/libpulse.so.0
#11 0x00007ffff7ab9979 in pa_pdispatch_run () from /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-16.1.so
#12 0x00007ffff7e5c1db in ?? () from /lib/x86_64-linux-gnu/libpulse.so.0
#13 0x00007ffff7ac0aaf in ?? () from /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-16.1.so
#14 0x00007ffff7ac23c7 in ?? () from /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-16.1.so
#15 0x00007ffff7e6fb3b in pa_mainloop_dispatch () from /lib/x86_64-linux-gnu/libpulse.so.0
#16 0x00007ffff7e701a1 in pa_mainloop_iterate () from /lib/x86_64-linux-gnu/libpulse.so.0
#17 0x00007ffff7e70258 in pa_mainloop_run () from /lib/x86_64-linux-gnu/libpulse.so.0
#18 0x00007ffff7e80771 in ?? () from /lib/x86_64-linux-gnu/libpulse.so.0
#19 0x00007ffff7ad23eb in ?? () from /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-16.1.so
#20 0x00007ffff7ca1e2e in start_thread (arg=<optimised out>) at ./nptl/pthread_create.c:447
#21 0x00007ffff7d33a4c in __GI___clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
(gdb)

My ORIGIN.txt:

This is taken from:

 https://github.com/andrewrk/libsoundio/commit/49a1f78b50eb0f5a49d096786a95a93874a2592a

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions