Assertion failure: IsTargetThread(), at /dom/base/EventSource.cpp:150
Categories
(Core :: DOM: Networking, defect, P3)
Tracking
()
People
(Reporter: jkratzer, Unassigned)
References
(Blocks 1 open bug)
Details
(Keywords: testcase, Whiteboard: [necko-triaged])
Attachments
(1 file)
|
8.57 KB,
application/octet-stream
|
Details |
Testcase found while fuzzing mozilla-central rev e7aef329a267 (built with: --enable-address-sanitizer --enable-fuzzing).
Testcase can be reproduced using the following commands:
$ pip install fuzzfetch grizzly-framework
$ python -m fuzzfetch --build e7aef329a267 --asan --fuzzing -n firefox
$ python -m grizzly.replay ./firefox/firefox testcase.zip
Assertion failure: IsTargetThread(), at /dom/base/EventSource.cpp:150
=================================================================
==2182144==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000001 (pc 0x7fdfe6aa888e bp 0x7ffe594685a0 sp 0x7ffe59468480 T0)
==2182144==The signal is caused by a WRITE memory access.
==2182144==Hint: address points to the zero page.
#0 0x7fdfe6aa888e in AssertIsOnTargetThread /dom/base/EventSource.cpp:150:5
#1 0x7fdfe6aa888e in mozilla::dom::EventSourceImpl::CloseInternal() /dom/base/EventSource.cpp:423:3
#2 0x7fdfe6e14b80 in operator() /dom/base/nsIGlobalObject.cpp:201:14
#3 0x7fdfe6e14b80 in std::_Function_handler<void (mozilla::DOMEventTargetHelper*, bool*), nsIGlobalObject::DisconnectEventTargetObjects()::$_0>::_M_invoke(std::_Any_data const&, mozilla::DOMEventTargetHelper*&&, bool*&&) /builds/worker/fetches/sysroot-x86_64-linux-gnu/usr/lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/std_function.h:316:2
#4 0x7fdfe6d95015 in operator() /builds/worker/fetches/sysroot-x86_64-linux-gnu/usr/lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/std_function.h:706:14
#5 0x7fdfe6d95015 in nsIGlobalObject::ForEachEventTargetObject(std::function<void (mozilla::DOMEventTargetHelper*, bool*)> const&) const /dom/base/nsIGlobalObject.cpp:192:5
#6 0x7fdfe6d9309d in DisconnectEventTargetObjects /dom/base/nsIGlobalObject.cpp:200:3
#7 0x7fdfe6d9309d in nsIGlobalObject::~nsIGlobalObject() /dom/base/nsIGlobalObject.cpp:65:3
#8 0x7fdfe6796d84 in nsGlobalWindowInner::~nsGlobalWindowInner() /dom/base/nsGlobalWindowInner.cpp:1098:1
#9 0x7fdfe67de8e8 in DeleteCycleCollectable /dom/base/nsGlobalWindowInner.cpp:1340:1
#10 0x7fdfe67de8e8 in nsGlobalWindowInner::cycleCollection::DeleteCycleCollectable(void*) /dom/base/nsGlobalWindowInner.h:461:3
#11 0x7fdfe37a9832 in SnowWhiteKiller::~SnowWhiteKiller() /xpcom/base/nsCycleCollector.cpp:2406:7
#12 0x7fdfe37a8dce in nsCycleCollector::FreeSnowWhite(bool) /xpcom/base/nsCycleCollector.cpp:2596:3
#13 0x7fdfe37b0eb7 in nsCycleCollector::BeginCollection(mozilla::CCReason, ccIsManual, nsICycleCollectorListener*) /xpcom/base/nsCycleCollector.cpp:3585:3
#14 0x7fdfe37b04fc in nsCycleCollector::Collect(mozilla::CCReason, ccIsManual, js::SliceBudget&, nsICycleCollectorListener*, bool) /xpcom/base/nsCycleCollector.cpp:3412:9
#15 0x7fdfe37afe6b in nsCycleCollector::ShutdownCollect() /xpcom/base/nsCycleCollector.cpp:3351:20
#16 0x7fdfe37b2236 in nsCycleCollector::Shutdown(bool) /xpcom/base/nsCycleCollector.cpp:3646:5
#17 0x7fdfe37b421a in nsCycleCollector_shutdown(bool) /xpcom/base/nsCycleCollector.cpp:3962:18
#18 0x7fdfe39faa2f in mozilla::ShutdownXPCOM(nsIServiceManager*) /xpcom/build/XPCOMInit.cpp:706:3
#19 0x7fdff0d51f4c in XRE_TermEmbedding() /toolkit/xre/nsEmbedFunctions.cpp:223:3
#20 0x7fdfe50e05d5 in mozilla::ipc::ScopedXREEmbed::Stop() /ipc/glue/ScopedXREEmbed.cpp:90:5
#21 0x7fdff0d52889 in XRE_InitChildProcess(int, char**, XREChildData const*) /toolkit/xre/nsEmbedFunctions.cpp:737:16
#22 0x555cd4d35c1d in content_process_main(mozilla::Bootstrap*, int, char**) /browser/app/../../ipc/contentproc/plugin-container.cpp:57:28
#23 0x555cd4d36050 in main /browser/app/nsBrowserApp.cpp:338:18
#24 0x7fe0096a2082 in __libc_start_main /build/glibc-SzIz7B/glibc-2.31/csu/../csu/libc-start.c:308:16
#25 0x555cd4c76069 in _start (/home/jkratzer/builds/mc-asan/firefox+0x5f069) (BuildId: 41206324e80edcfe4e33b8f314d6c7e82abd3ab0)
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /dom/base/EventSource.cpp:150:5 in AssertIsOnTargetThread
==2182144==ABORTING
| Reporter | ||
Comment 1•4 years ago
|
||
Comment 2•4 years ago
|
||
Bugmon Analysis
Unable to reproduce bug 1771305 using build mozilla-central 20220526093328-e7aef329a267. Without a baseline, bugmon is unable to analyze this bug.
Removing bugmon keyword as no further action possible. Please review the bug and re-add the keyword for further analysis.
| Reporter | ||
Comment 3•4 years ago
|
||
I just realized that bugmon can't handle a testcase in this format. I'll try and bisect it by hand.
| Reporter | ||
Comment 4•4 years ago
|
||
Unfortunately, it appears that this bug bisects back further than a year which is the max period of time bugmon can bisect.
Comment 5•4 years ago
|
||
Moving to DOM:Networking component as the test is about XHR and Eventsource, networking-related APIs.
Comment 6•4 years ago
|
||
Nika, I was also suggested that you may be the one who is able to know what's up here quickly. Care to take a quick look? Thanks.
Comment 7•4 years ago
|
||
The assertion which is failing is complaining that https://searchfox.org/mozilla-central/rev/3a1b5e963e92d478b2b4c0f0ddbbefd23aacc05e/dom/base/EventSource.cpp#153 returned false, which it's expecting to be telling us whether or not we're on the target thread.
Unfortunately, this is running very late during shutdown, after the nsThreadManager has been shut down, (we're running this during final CC) so NS_GetCurrentThread actually returns nullptr at this point despite being on the main thread. If the code instead checked by calling mTargetThread->IsOnCurrentThread() it would avoid this issue.
There isn't any actual thread safety issue going on here, it's just a buggy assertion which fails due to trying to use xpcom thread APIs after xpcom threads have shut down.
Updated•4 years ago
|
Description
•