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

segfault after recompile #79

Closed
birdspider opened this issue May 21, 2021 · 3 comments · Fixed by #80
Closed

segfault after recompile #79

birdspider opened this issue May 21, 2021 · 3 comments · Fixed by #80

Comments

@birdspider
Copy link

Someone got an idea why it would stop working after a recompile ?

CFLAGS="-march=native -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2,-D_GLIBCXX_ASSERTIONS \
  -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection"
$ pulseaudio --start -vvvvvvv --log-meta=true --log-time=true --log-target=stderr
(   0.000|   0.000) D: [pulseaudio][../pulseaudio/src/pulsecore/conf-parser.c:184 pa_config_parse()] Parsing configuration file '/etc/pulse/client.conf'
(   0.000|   0.000) D: [pulseaudio][../pulseaudio/src/pulsecore/conf-parser.c:285 pa_config_parse()] /etc/pulse/client.conf.d does not exist, ignoring.
(   4.075|   4.075) I: [pulseaudio][../pulseaudio/src/daemon/main.c:801 main()] Daemon startup successful.

✘-1 19:27 ~ $ pulseaudio -vvvvv --check
I: [pulseaudio] pid.c: Failed to open /proc/44361/stat: Datei oder Verzeichnis nicht gefunden
I: [pulseaudio] main.c: Daemon not running

$ sudo coredumpctl info | cat
           PID: 55181 (pulseaudio)
           UID: 1000 (birdspider)
           GID: 1000 (birdspider)
        Signal: 6 (ABRT)
     Timestamp: Fri 2021-05-21 19:38:49 CEST (17s ago)
  Command Line: pulseaudio --start -vvvvvvv --log-meta=true --log-time=true --log-target=stderr
    Executable: /usr/bin/pulseaudio
 Control Group: /user.slice/user-1000.slice/session-2.scope
          Unit: session-2.scope
         Slice: user-1000.slice
       Session: 2
     Owner UID: 1000 (birdspider)
       Boot ID: 3a780d97c46a4c419185b95a42027e9f
    Machine ID: 2a78171c33b441b5802740c9fcf554b7
      Hostname: blackbox
       Storage: /var/lib/systemd/coredump/core.pulseaudio.1000.3a780d97c46a4c419185b95a42027e9f.55181.1621618729000000.zst (present)
     Disk Size: 619.5K
       Message: Process 55181 (pulseaudio) of user 1000 dumped core.

                Stack trace of thread 55189:
                #0  0x00007fa28dc85d22 raise (libc.so.6 + 0x3cd22)
                #1  0x00007fa28dc6f862 abort (libc.so.6 + 0x26862)
                #2  0x00007fa28c32dd35 _ZN19RnNoiseCommonPlugin7processEPKfPfif (librnnoise_ladspa.so + 0x8d35)
                #3  0x00007fa28c34d784 n/a (module-ladspa-sink.so + 0x4784)
                #4  0x00007fa28e096e61 pa_sink_input_peek (libpulsecore-14.2.so + 0x56e61)
                #5  0x00007fa28e0bdd44 n/a (libpulsecore-14.2.so + 0x7dd44)
                #6  0x00007fa28e087e90 pa_sink_render (libpulsecore-14.2.so + 0x47e90)
                #7  0x00007fa28c35a6ef n/a (module-null-sink.so + 0x26ef)
                #8  0x00007fa28e0115cc n/a (libpulsecommon-14.2.so + 0x565cc)
                #9  0x00007fa28d7af259 start_thread (libpthread.so.0 + 0x9259)
                #10 0x00007fa28dd475e3 __clone (libc.so.6 + 0xfe5e3)

                Stack trace of thread 55182:
                #0  0x00007fa28dd3cc2e ppoll (libc.so.6 + 0xf3c2e)
                #1  0x00007fa28e07b6c5 pa_rtpoll_run (libpulsecore-14.2.so + 0x3b6c5)
                #2  0x00007fa28c5dc46f n/a (libalsa-util.so + 0x3146f)
                #3  0x00007fa28e0115cc n/a (libpulsecommon-14.2.so + 0x565cc)
                #4  0x00007fa28d7af259 start_thread (libpthread.so.0 + 0x9259)
                #5  0x00007fa28dd475e3 __clone (libc.so.6 + 0xfe5e3)

                Stack trace of thread 55183:
                #0  0x00007fa28dd3cc2e ppoll (libc.so.6 + 0xf3c2e)
                #1  0x00007fa28e07b6c5 pa_rtpoll_run (libpulsecore-14.2.so + 0x3b6c5)
                #2  0x00007fa28c5db0d1 n/a (libalsa-util.so + 0x300d1)
                #3  0x00007fa28e0115cc n/a (libpulsecommon-14.2.so + 0x565cc)
                #4  0x00007fa28d7af259 start_thread (libpthread.so.0 + 0x9259)
                #5  0x00007fa28dd475e3 __clone (libc.so.6 + 0xfe5e3)

                Stack trace of thread 55181:
                #0  0x00007fa28dd3cc2e ppoll (libc.so.6 + 0xf3c2e)
                #1  0x00007fa28df5ea33 pa_mainloop_poll (libpulse.so.0 + 0x1ca33)
                #2  0x00007fa28df69281 pa_mainloop_iterate (libpulse.so.0 + 0x27281)
                #3  0x00007fa28df69331 pa_mainloop_run (libpulse.so.0 + 0x27331)
                #4  0x00005649dd481892 main (pulseaudio + 0x8892)
                #5  0x00007fa28dc70b25 __libc_start_main (libc.so.6 + 0x27b25)
                #6  0x00005649dd4828de n/a (pulseaudio + 0x98de)
(gdb) bt
#0  0x00007fa28dc85d22 in raise () from /usr/lib/libc.so.6
#1  0x00007fa28dc6f862 in abort () from /usr/lib/libc.so.6
#2  0x00007fa28c32dd35 in RnNoiseCommonPlugin::process(float const*, float*, int, float) ()
   from /usr/lib/ladspa/librnnoise_ladspa.so
#3  0x00007fa28c34d784 in ?? () from /usr/lib/pulse-14.2/modules/module-ladspa-sink.so
#4  0x00007fa28e096e61 in pa_sink_input_peek () from /usr/lib/pulseaudio/libpulsecore-14.2.so
#5  0x00007fa28e0bdd44 in ?? () from /usr/lib/pulseaudio/libpulsecore-14.2.so
#6  0x00007fa28e087e90 in pa_sink_render () from /usr/lib/pulseaudio/libpulsecore-14.2.so
#7  0x00007fa28c35a6ef in ?? () from /usr/lib/pulse-14.2/modules/module-null-sink.so
#8  0x00007fa28e0115cc in ?? () from /usr/lib/pulseaudio/libpulsecommon-14.2.so
#9  0x00007fa28d7af259 in start_thread () from /usr/lib/libpthread.so.0
#10 0x00007fa28dd475e3 in clone () from /usr/lib/libc.so.6
@werman
Copy link
Owner

werman commented May 21, 2021

The only way to know would be to recompile it with -O0 -g and see the crash with debug symbols.

@birdspider
Copy link
Author

birdspider commented May 21, 2021

CFLAGS=-march=native -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2,-D_GLIBCXX_ASSERTIONS \
   -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection \
   -g -fvar-tracking-assignments \
   -fdebug-prefix-map=/home/birdspider/.cache/pacaur/noise-suppression-for-voice/src=/usr/src/debug \
   -O0

(those are a mix of Archlinux defaults CFLAGs + debug + -O0)

---

(gdb) bt
#0  0x00007f3ae15fcd22 in raise () from /usr/lib/libc.so.6
#1  0x00007f3ae15e6862 in abort () from /usr/lib/libc.so.6
#2  0x00007f3ad6c9d0f5 in std::__replacement_assert (__condition=0x7f3ad6ca6000 "__n < this->size()",
    __function=0x7f3ad6ca6638 "std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](std::vector<_Tp, _Alloc>::size_type) [with _Tp = float; _Alloc = std::allocator<float>; std::vector<_Tp, _Alloc>::reference = f"..., __line=1045, __file=0x7f3ad6ca6740 "/usr/include/c++/11.1.0/bits/stl_vector.h")
    at /usr/include/c++/11.1.0/x86_64-pc-linux-gnu/bits/c++config.h:504
#3  std::vector<float, std::allocator<float> >::operator[] (this=0x55a9b0408370, __n=0) at /usr/include/c++/11.1.0/bits/stl_vector.h:1045
#4  std::vector<float, std::allocator<float> >::operator[] (__n=0, this=0x55a9b0408370) at /usr/include/c++/11.1.0/bits/stl_vector.h:1043
#5  RnNoiseCommonPlugin::process (this=0x55a9b0408340, in=<optimized out>, out=0x55a9b054fa90, sampleFrames=<optimized out>, vadThreshold=0.5)
    at /usr/src/debug/noise-suppression-for-voice-0.91/src/common/src/RnNoiseCommonPlugin.cpp:100
#6  0x00007f3ad6cc4784 in ?? () from /usr/lib/pulse-14.2/modules/module-ladspa-sink.so
#7  0x00007f3ae1a0de61 in pa_sink_input_peek () from /usr/lib/pulseaudio/libpulsecore-14.2.so
#8  0x00007f3ae1a34d44 in ?? () from /usr/lib/pulseaudio/libpulsecore-14.2.so
#9  0x00007f3ae19fee90 in pa_sink_render () from /usr/lib/pulseaudio/libpulsecore-14.2.so
#10 0x00007f3ad74d26ef in ?? () from /usr/lib/pulse-14.2/modules/module-null-sink.so
#11 0x00007f3ae19885cc in ?? () from /usr/lib/pulseaudio/libpulsecommon-14.2.so
#12 0x00007f3ae1126259 in start_thread () from /usr/lib/libpthread.so.0
#13 0x00007f3ae16be5e3 in clone () from /usr/lib/libc.so.6

EDIT: I just now realize its an SIGABRT, not an SIGSEGV - I don't know if it makes a difference

@werman
Copy link
Owner

werman commented May 21, 2021

Thanks, I think I see slightly suspicious code.

werman added a commit that referenced this issue May 21, 2021
If we have less input than k_denoiseFrameSize we would have zero frames
to process which would make m_outputBuffer empty. Dereferencing it may
lead to a crash.

Closes #79
werman added a commit that referenced this issue May 22, 2021
If we have less input than k_denoiseFrameSize we would have zero frames
to process which would make m_outputBuffer empty. Dereferencing it may
lead to a crash.

Closes #79
@werman werman mentioned this issue Oct 11, 2021
micsthepick pushed a commit to micsthepick/noise-supression-for-voice-test that referenced this issue Apr 6, 2023
If we have less input than k_denoiseFrameSize we would have zero frames
to process which would make m_outputBuffer empty. Dereferencing it may
lead to a crash.

Closes werman#79
micsthepick pushed a commit to micsthepick/noise-supression-for-voice-test that referenced this issue Apr 6, 2023
If we have less input than k_denoiseFrameSize we would have zero frames
to process which would make m_outputBuffer empty. Dereferencing it may
lead to a crash.

Closes werman#79
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants