Closed Bug 1611439 Opened 4 years ago Closed 4 years ago

Shutdown crash with AudioCallbackTracing activate

Categories

(Core :: Audio/Video, defect, P1)

defect

Tracking

()

RESOLVED FIXED
mozilla75
Tracking Status
firefox75 --- fixed

People

(Reporter: achronop, Assigned: achronop)

Details

Attachments

(1 file)

STR:

  1. MOZ_LOG=raw,AudioCallbackTracing:5 MOZ_LOG_FILE=$SOMEFILE ./mach run
  2. Start a WebRTC call or play a video for example in youtube.
  3. With the call or video active shutdown the browser

Result
Crash in AsyncLogger thread

Stack:

#0  0x00007f3523e851d5 in nanosleep () at /lib64/libc.so.6
#1  0x00007f3523e850de in sleep () at /lib64/libc.so.6
#2  0x00007f351b3e675a in ah_crap_handler(int) (signum=11) at /home/achronop/repos/mozilla/firefox/toolkit/xre/nsSigHandlers.cpp:95
#3  0x00007f351b3e68f3 in child_ah_crap_handler(int) (signum=11) at /home/achronop/repos/mozilla/firefox/toolkit/xre/nsSigHandlers.cpp:105
#4  0x00007f35242f7b20 in <signal handler called> () at /lib64/libpthread.so.0
#5  0x000055bbaedef6b0 in mozalloc_abort(char const*) (msg=0x55bbaed4014c "Redirecting call to abort() to mozalloc_abort\n")
    at /home/achronop/repos/mozilla/firefox/memory/mozalloc/mozalloc_abort.cpp:33
#6  0x000055bbaedef759 in abort() () at /home/achronop/repos/mozilla/firefox/memory/mozalloc/mozalloc_abort.cpp:82
#7  0x00007f35241806b6 in __gnu_cxx::__verbose_terminate_handler() () at ../../../../libstdc++-v3/libsupc++/vterminate.cc:95
#8  0x00007f352418c86c in __cxxabiv1::__terminate(void (*)()) (handler=<optimized out>) at ../../../../libstdc++-v3/libsupc++/eh_terminate.cc:47
#9  0x00007f352418c8c7 in std::terminate() () at ../../../../libstdc++-v3/libsupc++/eh_terminate.cc:57
#10 0x00007f3516eee217 in std::thread::~thread() (this=0x7f34fa4e52c0) at /usr/lib/gcc/x86_64-redhat-linux/9/../../../../include/c++/9/thread:139
#11 0x00007f3516eee0bb in std::default_delete<std::thread>::operator()(std::thread*) const (this=0x7f35214c3400 <gAudioCallbackTraceLogger>, __ptr=0x7f34fa4e52c0)
    at /usr/lib/gcc/x86_64-redhat-linux/9/../../../../include/c++/9/bits/unique_ptr.h:81
#12 0x00007f3516eedf4e in std::unique_ptr<std::thread, std::default_delete<std::thread> >::~unique_ptr() (this=0x7f35214c3400 <gAudioCallbackTraceLogger>)
    at /usr/lib/gcc/x86_64-redhat-linux/9/../../../../include/c++/9/bits/unique_ptr.h:284
#13 0x00007f3516eed0df in mozilla::AsyncLogger::~AsyncLogger() (this=0x7f35214c3400 <gAudioCallbackTraceLogger>) at /home/achronop/repos/mozilla/firefox/dom/media/AsyncLogger.h:177
#14 0x00007f3523df5e87 in __run_exit_handlers () at /lib64/libc.so.6
#15 0x00007f3523df6040 in on_exit () at /lib64/libc.so.6
#16 0x00007f3523dde1aa in __libc_start_main () at /lib64/libc.so.6
#17 0x000055bbaed9b02e in _start ()

stdout:

Hit MOZ_CRASH() at /home/achronop/repos/mozilla/firefox/memory/mozalloc/mozalloc_abort.cpp:33

Program /home/achronop/repos/mozilla/firefox/obj-x86_64-pc-linux-gnu/dist/bin/firefox (pid = 35340) received signal 11.
Stack:
#01: ???[/lib64/libpthread.so.0 +0x14b20]
#02: mozalloc_abort[/home/achronop/repos/mozilla/firefox/obj-x86_64-pc-linux-gnu/dist/bin/firefox +0xcc6b0]
#03: ???[/home/achronop/repos/mozilla/firefox/obj-x86_64-pc-linux-gnu/dist/bin/firefox +0xcc759]

Program /home/achronop/repos/mozilla/firefox/obj-x86_64-pc-linux-gnu/dist/bin/firefox (pid = 35340) received signal 11.
Stack:
#04: ???[/lib64/libstdc++.so.6 +0x9e6b6]
#05: ???[/lib64/libstdc++.so.6 +0xaa86c]
#01: ???[/lib64/libpthread.so.0 +0x14b20]
#06: ???[/lib64/libstdc++.so.6 +0xaa8c7]
#02: ???[/lib64/libc.so.6 +0x16313d]
#07: std::thread::~thread()[/home/achronop/repos/mozilla/firefox/obj-x86_64-pc-linux-gnu/dist/bin/libxul.so +0xcd2e217]
#08: std::default_delete<std::thread>::operator()(std::thread*) const[/home/achronop/repos/mozilla/firefox/obj-x86_64-pc-linux-gnu/dist/bin/libxul.so +0xcd2e0bb]
#09: std::unique_ptr<std::thread, std::default_delete<std::thread> >::~unique_ptr()[/home/achronop/repos/mozilla/firefox/obj-x86_64-pc-linux-gnu/dist/bin/libxul.so +0xcd2df4e]
#10: ???[/home/achronop/repos/mozilla/firefox/obj-x86_64-pc-linux-gnu/dist/bin/libxul.so +0xcd2d0df]
#11: ???[/lib64/libc.so.6 +0x3ee87]
#12: on_exit[/lib64/libc.so.6 +0x3f040]
#03: ???[/home/achronop/repos/mozilla/firefox/obj-x86_64-pc-linux-gnu/dist/bin/libxul.so +0xcd2dfef]
#04: ???[/home/achronop/repos/mozilla/firefox/obj-x86_64-pc-linux-gnu/dist/bin/libxul.so +0xcd2ec07]
#05: ???[/home/achronop/repos/mozilla/firefox/obj-x86_64-pc-linux-gnu/dist/bin/libxul.so +0xcd2eb6d]
#13: __libc_start_main[/lib64/libc.so.6 +0x271aa]
#14: _start[/home/achronop/repos/mozilla/firefox/obj-x86_64-pc-linux-gnu/dist/bin/firefox +0x7802e]
#15: ??? (???:???)
Sleeping for 300 seconds.
Type 'gdb /home/achronop/repos/mozilla/firefox/obj-x86_64-pc-linux-gnu/dist/bin/firefox 35340' to attach your debugger to this thread.
#06: ???[/home/achronop/repos/mozilla/firefox/obj-x86_64-pc-linux-gnu/dist/bin/libxul.so +0xcd2eafd]
#07: ???[/home/achronop/repos/mozilla/firefox/obj-x86_64-pc-linux-gnu/dist/bin/libxul.so +0xcd2ead5]
#08: ???[/home/achronop/repos/mozilla/firefox/obj-x86_64-pc-linux-gnu/dist/bin/libxul.so +0xcd2eaa5]
#09: ???[/home/achronop/repos/mozilla/firefox/obj-x86_64-pc-linux-gnu/dist/bin/libxul.so +0xcd2e99e]
#10: ???[/lib64/libstdc++.so.6 +0xd76f4]
#11: ???[/lib64/libpthread.so.0 +0x94e2]
#12: clone[/lib64/libc.so.6 +0x1016d3]
#13: ??? (???:???)

It happens because the AsyncLogger::Stop method is never called, thus the AsyncLogger thread hasn't been stopped and joined at the time we attempt to delete it.

AsyncLogger creates a thread that the log messages are pushed and printed. This thread was not stopped and joined after it was used, which created a shutdown crash. This patch will stop the AsyncLogger thread when the capture session has finished.

Pushed by achronopoulos@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/7cf64e7350ac
Stop AsyncLogger before aborting the audio session. r=padenot
Priority: P3 → P1
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla75
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: