Control: retitle 925553 audacity: with ssh X-forwarding: PaAlsaStreamComponent_BeginPolling: Assertion `ret == self->nfds' failed.
Hello Jeff Cliff, I looked at this backtrace without deeper knowledge of audacity and the problem might not be a segfault in mentioned funciton, instead a SIGABRT from pulseaudio. Instead I guess it is in the first backtrace of yours, showing in libportaudio.so.2. By the way, installing the debug symbols [1] would be helpful for the maintainers to get an idea of where the problem is. In this case package libportaudio2-dbgsym. Having audacity running in gdb with an active breakpoint at PaAlsaStreamComponent_BeginPolling and just continuing a few times leads to such a backtrace. (But my "network" connection was just into a VM on the same host.) Did you also debug audacity or did you let it run freely? Is your ssh connection over a slow network link? Should this bug be reassigned to pulseaudio? Kind regards, Bernhard [1] https://wiki.debian.org/HowToGetABacktrace#Installing_the_debugging_symbols (gdb) bt #0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 #1 0x00007ffff3661535 in __GI_abort () at abort.c:79 #2 0x00007ffff366140f in __assert_fail_base (fmt=0x7fffe92021d2 "%s%s%s:%u: %s%sZusicherung »%s« nicht erfüllt.\n%n", assertion=0x7ffff7d7a66e "ret == self->nfds", file=0x7ffff7d74038 "src/hostapi/alsa/pa_linux_alsa.c", line=3641, function=<optimized out>) at assert.c:92 #3 0x00007ffff366f0f2 in __GI___assert_fail (assertion=assertion@entry=0x7ffff7d7a66e "ret == self->nfds", file=file@entry=0x7ffff7d74038 "src/hostapi/alsa/pa_linux_alsa.c", line=line@entry=3641, function=function@entry=0x7ffff7d7abe0 <__PRETTY_FUNCTION__.12102> "PaAlsaStreamComponent_BeginPolling") at assert.c:101 #4 0x00007ffff7d5c1c3 in PaAlsaStreamComponent_BeginPolling (pfds=<optimized out>, self=<optimized out>) at src/hostapi/alsa/pa_linux_alsa.c:3641 #5 0x00007ffff7d69e85 in PaAlsaStreamComponent_BeginPolling (pfds=<optimized out>, self=<optimized out>) at src/hostapi/alsa/pa_linux_alsa.c:3931 #6 PaAlsaStream_WaitForFrames (self=self@entry=0x555556867c00, framesAvail=framesAvail@entry=0x7fffe8007720, xrunOccurred=xrunOccurred@entry=0x7fffe800771c) at src/hostapi/alsa/pa_linux_alsa.c:3802 #7 0x00007ffff7d6a63e in CallbackThreadFunc (userData=0x555556867c00) at src/hostapi/alsa/pa_linux_alsa.c:4274 #8 0x00007ffff3b34fa3 in start_thread (arg=<optimized out>) at pthread_create.c:486 #9 0x00007ffff373882f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
# Buster amd64 qemu VM 2019-03-28 apt update apt dist-upgrade apt install dpkg-dev devscripts systemd-coredump alsa-utils audacity pulseaudio libportaudio2-dbgsym gdb elfutils elfutils-dbgsym libelf1-dbgsym strace binutils mc $ ssh -X -p2222 benutzer@$LOCALIP benutzer@debian:~$ audacity -> record -> no crash -> cursor is moving as usual ########## cp -a /usr/lib/x86_64-linux-gnu/libportaudio.so.2.0.0 /tmp/libportaudio.so.2.0.0 cp -a /usr/lib/debug/.build-id/4d/7ecbcc022ad848e4da5356dfeaf76b5230731d.debug /tmp/7ecbcc022ad848e4da5356dfeaf76b5230731d.debug LANG=C eu-unstrip --force /tmp/libportaudio.so.2.0.0 /tmp/7ecbcc022ad848e4da5356dfeaf76b5230731d.debug eu-unstrip: cannot write output file: invalid section alignment # Doh! mkdir /home/benutzer/source/elfutils/orig -p cd /home/benutzer/source/elfutils/orig apt source elfutils cd mkdir /home/benutzer/source/libc6/orig -p cd /home/benutzer/source/libc6/orig apt source libc6 cd grep "invalid section alignment" . -rn grep "ELF_E_INVALID_SHENTSIZE_IDX" . -rn grep "ELF_E_INVALID_SHENTSIZE" . -rn gdb -q -ex 'set width 0' -ex 'set pagination off' -ex 'directory /home/benutzer/source/elfutils/orig/elfutils-0.176/libelf' -ex 'b elf32_updatenull.c:399' -ex 'run' --args eu-unstrip --force /tmp/libportaudio.so.2.0.0 /tmp/7ecbcc022ad848e4da5356dfeaf76b5230731d.debug (gdb) bt #0 __libelf_seterrno (value=value@entry=36) at elf_error.c:336 #1 0x00007ffff7fb3f7a in __elf64_updatenull_wrlock (elf=elf@entry=0x555555564f30, change_bop=change_bop@entry=0x7fffffffd2ec, shnum=shnum@entry=35) at elf32_updatenull.c:215 #2 0x00007ffff7fb2fb0 in elf_update (elf=0x555555564f30, cmd=ELF_C_WRITE) at elf_update.c:209 #3 0x000055555555bb67 in copy_elided_sections (unstripped=<optimized out>, stripped=<optimized out>, stripped_ehdr=<optimized out>, bias=<optimized out>) at unstrip.c:2070 #4 0x000055555555c1a3 in handle_file (output_file=0x0, create_dirs=<optimized out>, stripped=0x555555563900, stripped_ehdr=0x7fffffffe200, unstripped=0x555555564f30) at unstrip.c:2132 #5 0x000055555555c3b9 in handle_explicit_files (output_file=0x0, create_dirs=<optimized out>, force=<optimized out>) at unstrip.c:2223 #6 0x0000555555556c81 in main (argc=<optimized out>, argv=0x7fffffffe558) at unstrip.c:2558 1: x/i $pc => 0x7ffff7faa520 <__libelf_seterrno>: push %rbx ########## mkdir /home/benutzer/source/libportaudio2/orig -p cd /home/benutzer/source/libportaudio2/orig apt source libportaudio2 cd script -c "gdb -q -ex 'set width 0' -ex 'set pagination off' -ex 'b main' -ex 'run' --args audacity" -a gdb-dissassemble_$(date +%Y-%m-%d_%H-%M-%S).log cat gdb-dissassemble_2019-03-28_18-58-31.log | grep -E "info share|7ffff7d5c1a0|(63e |e85 |1c3 )" -B1 Breakpoint 1, 0x000055555593f190 in main () (gdb) info share -- 0x00007ffff7f8a130 0x00007ffff7faa023 Yes (*) /lib/x86_64-linux-gnu/libexpat.so.1 0x00007ffff7d5c1a0 0x00007ffff7d72fe6 Yes /usr/lib/x86_64-linux-gnu/libportaudio.so.2 -- (*): Shared library is missing debugging information. (gdb) disassemble 0x00007ffff7d5c1a0,0x00007ffff7d72fe6 Dump of assembler code from 0x7ffff7d5c1a0 to 0x7ffff7d72fe6: ... 0x00007ffff7d5c1be <PaAlsaStreamComponent_BeginPolling+30>: callq 0x7ffff7d5bf00 <__assert_fail@plt> 0x00007ffff7d5c1c3 <CalculatePollTimeout+0>: lea 0x1e9f6(%rip),%rcx # 0x7ffff7d7abc0 <__PRETTY_FUNCTION__.11747> ... 0x00007ffff7d69e80 <PaAlsaStream_WaitForFrames+1808>: callq 0x7ffff7d5c1a0 <PaAlsaStreamComponent_BeginPolling> 0x00007ffff7d69e85 <PaAlsaStream_WaitForFrames+1813>: callq 0x7ffff7d5c0a0 <__stack_chk_fail@plt> ... 0x00007ffff7d6a639 <CallbackThreadFunc+409>: callq 0x7ffff7d69770 <PaAlsaStream_WaitForFrames> 0x00007ffff7d6a63e <CallbackThreadFunc+414>: test %eax,%eax . gdb -q -ex 'set width 0' -ex 'set pagination off' -ex 'directory /home/benutzer/source/libportaudio2/orig/portaudio19-19.6.0' -ex 'b main' -ex 'run' --args audacity (gdb) disassemble PaAlsaStreamComponent_BeginPolling,PaAlsaStreamComponent_BeginPolling+42 Dump of assembler code from 0x7ffff7d5c1a0 to 0x7ffff7d5c1ca: 0x00007ffff7d5c1a0 <PaAlsaStreamComponent_BeginPolling+0>: lea 0x1ea39(%rip),%rcx # 0x7ffff7d7abe0 <__PRETTY_FUNCTION__.12102> 0x00007ffff7d5c1a7 <PaAlsaStreamComponent_BeginPolling+7>: lea 0x17e8a(%rip),%rsi # 0x7ffff7d74038 0x00007ffff7d5c1ae <PaAlsaStreamComponent_BeginPolling+14>: lea 0x1e4b9(%rip),%rdi # 0x7ffff7d7a66e 0x00007ffff7d5c1b5 <PaAlsaStreamComponent_BeginPolling+21>: sub $0x8,%rsp 0x00007ffff7d5c1b9 <PaAlsaStreamComponent_BeginPolling+25>: mov $0xe39,%edx 0x00007ffff7d5c1be <PaAlsaStreamComponent_BeginPolling+30>: callq 0x7ffff7d5bf00 <__assert_fail@plt> 0x00007ffff7d5c1c3 <CalculatePollTimeout+0>: lea 0x1e9f6(%rip),%rcx # 0x7ffff7d7abc0 <__PRETTY_FUNCTION__.11747> End of assembler dump. (gdb) list pa_linux_alsa.c:3634,+12 3634 /** Fill in pollfd objects. 3635 */ 3636 static PaError PaAlsaStreamComponent_BeginPolling( PaAlsaStreamComponent* self, struct pollfd* pfds ) 3637 { 3638 PaError result = paNoError; 3639 int ret = alsa_snd_pcm_poll_descriptors( self->pcm, pfds, self->nfds ); 3640 (void)ret; /* Prevent unused variable warning if asserts are turned off */ 3641 assert( ret == self->nfds ); 3642 3643 self->ready = 0; 3644 3645 return result; 3646 } (gdb) b *0x00007ffff7d5c1be Breakpoint 5 at 0x7ffff7d5c1be: file src/hostapi/alsa/pa_linux_alsa.c, line 3641. (gdb) b *0x00007ffff7d69e80 Breakpoint 3 at 0x7ffff7d69e80: file src/hostapi/alsa/pa_linux_alsa.c, line 3931. (gdb) b *0x00007ffff7d6a639 Breakpoint 4 at 0x7ffff7d6a639: file src/hostapi/alsa/pa_linux_alsa.c, line 4274. ########### # From submitter, modified frames #4, #5, #6: (gdb) bt #0 0x00007f02396718bb in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 #1 0x00007f023965c535 in __GI_abort () at abort.c:79 #2 0x00007f023965c40f in __assert_fail_base(fmt=0x7f02397beee0 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x7f023dd7566e "ret == self->nfds", file=0x7f023dd6f038 "src/hostapi/alsa/pa_linux_alsa.c", line=3641, function=<optimized out>) at assert.c:92 #3 0x00007f023966a0f2 in __GI___assert_fail(assertion=0x7f023dd7566e "ret == self->nfds", file=0x7f023dd6f038 "src/hostapi/alsa/pa_linux_alsa.c", line=3641, function=0x7f023dd75be0 "PaAlsaStreamComponent_BeginPolling") at assert.c:101 #4 0x00007f023dd571c3 in PaAlsaStreamComponent_BeginPolling(): pa_linux_alsa.c, line 3641: assert( ret == self->nfds ); #5 0x00007f023dd64e85 in PaAlsaStream_WaitForFrames(): pa_linux_alsa.c, line 3931: callq 0x...1a0 <PaAlsaStreamComponent_BeginPolling> #6 0x00007f023dd6563e in CallbackThreadFunc(): pa_linux_alsa.c, line 4274: PA_ENSURE( PaAlsaStream_WaitForFrames( stream, &framesAvail, &xrun ) ); #7 0x00007f0239b2ffa3 in start_thread (arg=<optimized out>) at pthread_create.c:486 #8 0x00007f023973382f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 (gdb) info registers rax 0x12 18 rbx 0x55d082be8a70 94354035083888 rcx 0xf0 240 rdx 0x55d082be1968 94354035054952 rsi 0x55d082be1920 94354035054880 rdi 0x7ffe30b4a100 140729715564800 rbp 0x7ffe30b4a100 0x7ffe30b4a100 rsp 0x7ffe30b4a0e8 0x7ffe30b4a0e8 r8 0x2 2 r9 0x55d0825ebbe0 94354028805088 r10 0x16 22 r11 0x30 48 r12 0x55d082c0bb30 94354035227440 r13 0x55d082976210 94354032517648 r14 0x7f023d0b7f50 139647590825808 r15 0x55d082d80300 94354036753152 rip 0x55d080a0f5d0 0x55d080a0f5d0 <void std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_M_construct<wchar_t*>(wchar_t*, wchar_t*, std::forward_iterator_tag)> eflags 0x10246 [ PF ZF IF RF ] cs 0x33 51 ss 0x2b 43 ds 0x0 0 es 0x0 0 fs 0x0 0 gs 0x0 0 ########### ssh -X -p2222 benutzer@$LOCALIP gdb -q -ex 'set width 0' -ex 'set pagination off' -ex 'directory /home/benutzer/source/libportaudio2/orig/portaudio19-19.6.0' -ex 'b PaAlsaStreamComponent_BeginPolling' -ex 'run' --args audacity (gdb) cont Continuing. audacity: src/hostapi/alsa/pa_linux_alsa.c:3641: PaAlsaStreamComponent_BeginPolling: Zusicherung »ret == self->nfds« nicht erfüllt. Thread 9 "audacity" received signal SIGABRT, Aborted. __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 50 ../sysdeps/unix/sysv/linux/raise.c: Datei oder Verzeichnis nicht gefunden. 1: x/i $pc => 0x7ffff36768bb <__GI_raise+267>: mov 0x108(%rsp),%rcx (gdb) bt #0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 #1 0x00007ffff3661535 in __GI_abort () at abort.c:79 #2 0x00007ffff366140f in __assert_fail_base (fmt=0x7fffe92021d2 "%s%s%s:%u: %s%sZusicherung »%s« nicht erfüllt.\n%n", assertion=0x7ffff7d7a66e "ret == self->nfds", file=0x7ffff7d74038 "src/hostapi/alsa/pa_linux_alsa.c", line=3641, function=<optimized out>) at assert.c:92 #3 0x00007ffff366f0f2 in __GI___assert_fail (assertion=assertion@entry=0x7ffff7d7a66e "ret == self->nfds", file=file@entry=0x7ffff7d74038 "src/hostapi/alsa/pa_linux_alsa.c", line=line@entry=3641, function=function@entry=0x7ffff7d7abe0 <__PRETTY_FUNCTION__.12102> "PaAlsaStreamComponent_BeginPolling") at assert.c:101 #4 0x00007ffff7d5c1c3 in PaAlsaStreamComponent_BeginPolling (pfds=<optimized out>, self=<optimized out>) at src/hostapi/alsa/pa_linux_alsa.c:3641 #5 0x00007ffff7d69e85 in PaAlsaStreamComponent_BeginPolling (pfds=<optimized out>, self=<optimized out>) at src/hostapi/alsa/pa_linux_alsa.c:3931 #6 PaAlsaStream_WaitForFrames (self=self@entry=0x555556867c00, framesAvail=framesAvail@entry=0x7fffe8007720, xrunOccurred=xrunOccurred@entry=0x7fffe800771c) at src/hostapi/alsa/pa_linux_alsa.c:3802 #7 0x00007ffff7d6a63e in CallbackThreadFunc (userData=0x555556867c00) at src/hostapi/alsa/pa_linux_alsa.c:4274 #8 0x00007ffff3b34fa3 in start_thread (arg=<optimized out>) at pthread_create.c:486 #9 0x00007ffff373882f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 (gdb) info thread Id Target Id Frame 1 Thread 0x7fffe9fae600 (LWP 18776) "audacity" 0x00007ffff372db69 in __GI___poll (fds=0x7fffffffdc08, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29 7 Thread 0x7fffe91e3700 (LWP 18785) "audacity" 0x00007ffff3b3ebf0 in __GI___nanosleep (requested_time=0x7fffe91e25b0, remaining=0x0) at ../sysdeps/unix/sysv/linux/nanosleep.c:28 8 Thread 0x7fffe89ca700 (LWP 18786) "audacity" 0x00007ffff3b3ebf0 in __GI___nanosleep (requested_time=0x7fffe89c95b0, remaining=0x0) at ../sysdeps/unix/sysv/linux/nanosleep.c:28 * 9 Thread 0x7fffe8008700 (LWP 18787) "audacity" __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50