Closed Bug 2036145 Opened 4 months ago Closed 3 months ago

Assertion failure: NS_IsMainThread() (Wrong thread!), at /builds/worker/checkouts/gecko/xpcom/threads/nsThreadManager.cpp:248

Categories

(Core :: DOM: Web Serial, defect)

defect

Tracking

()

RESOLVED FIXED
153 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr140 --- unaffected
firefox151 --- wontfix
firefox152 --- wontfix
firefox153 --- fixed

People

(Reporter: tsmith, Assigned: gstoll)

References

(Blocks 1 open bug)

Details

(Keywords: assertion, testcase)

Attachments

(2 files)

Attached file testcase.html

Found while fuzzing m-c 20260413-1f396df9f27e (--enable-debug --enable-fuzzing)

To reproduce via Grizzly Replay:

$ pip install fuzzfetch grizzly-framework --upgrade
$ python -m fuzzfetch -d --fuzzing -n firefox
$ python -m grizzly.replay.bugzilla ./firefox/firefox <bugid>

Assertion failure: NS_IsMainThread() (Wrong thread!), at /builds/worker/checkouts/gecko/xpcom/threads/nsThreadManager.cpp:248

#0 0x7fffe5b6523b in MOZ_CrashSequence /builds/worker/workspace/obj-build/dist/include/mozilla/Assertions.h:235:3
#1 0x7fffe5b6523b in mozilla::AssertIsOnMainThread() /builds/worker/checkouts/gecko/xpcom/threads/nsThreadManager.cpp:248:31
#2 0x7fffeb5e725f in mozilla::dom::Serial::GetOrCreateManagerChild() /builds/worker/checkouts/gecko/dom/webserial/Serial.cpp:99:3
#3 0x7fffeb5ece7c in GetManagerChildForTesting /builds/worker/checkouts/gecko/dom/webserial/Serial.cpp:778:31
#4 0x7fffeb5ece7c in mozilla::dom::Serial::ResetToDefaultMockDevices(mozilla::ErrorResult&) /builds/worker/checkouts/gecko/dom/webserial/Serial.cpp:877:31
#5 0x7fffe886ae35 in resetToDefaultMockDevices /builds/worker/workspace/obj-build/dom/bindings/./SerialBinding.cpp:1109:60
#6 0x7fffe886ae35 in mozilla::dom::Serial_Binding::resetToDefaultMockDevices_promiseWrapper(JSContext*, JS::Handle<JSObject*>, void*, JSJitMethodCallArgs const&) /builds/worker/workspace/obj-build/dom/bindings/./SerialBinding.cpp:1123:13
#7 0x7fffe918b436 in bool mozilla::dom::binding_detail::GenericMethod<mozilla::dom::binding_detail::NormalThisPolicy, mozilla::dom::binding_detail::ConvertExceptionsToPromises>(JSContext*, unsigned int, JS::Value*) /builds/worker/checkouts/gecko/dom/bindings/BindingUtils.cpp:3398:13
#8 0x7fffede2cc94 in CallJSNative(JSContext*, bool (*)(JSContext*, unsigned int, JS::Value*), js::CallReason, JS::CallArgs const&) /builds/worker/checkouts/gecko/js/src/vm/Interpreter.cpp:488:13
#9 0x7fffede2c53f in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason) /builds/worker/checkouts/gecko/js/src/vm/Interpreter.cpp:584:12
#10 0x7fffed42a433 in js::jit::DoCallFallback(JSContext*, js::jit::BaselineFrame*, js::jit::ICFallbackStub*, unsigned int, JS::Value*, JS::MutableHandle<JS::Value>) /builds/worker/checkouts/gecko/js/src/jit/BaselineIC.cpp:1699:10
#11 0x37b61e718c7e  ([anon:js-executable-memory]+0xbc7e)
Flags: needinfo?(gstoll)
Blocks: webserial
Flags: needinfo?(gstoll)
Assignee: nobody → gstoll
Status: NEW → ASSIGNED

Note that this relies on calling navigator.serial.simulateDeviceConnection(), which is only available if the "dom.webserial.testing.enabled" pref is on.

Severity: -- → S3

If the first time we tried to create a SerialManagerChild was on a worker
thread, we would assert. Instead, make the testing methods use the same
pattern as GetPorts() where we make sure to create and access the SerialManagerChild
from the main thread.

Unable to reproduce bug 2036145 using build mozilla-central 20260413155321-1f396df9f27e. 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.

Keywords: bugmon
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 153 Branch

The patch landed in nightly and beta is affected.
:gstoll, is this bug important enough to require an uplift?

For more information, please visit BugBot documentation.

Flags: needinfo?(gstoll)
Flags: needinfo?(gstoll)
QA Whiteboard: [qa-triage-done-c154/b153]
Component: DOM: Device Interfaces → Dom: Web Serial
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: