Closed Bug 1903676 Opened 1 year ago Closed 10 months ago

Assertion failure: !sourceSignal->Aborted() && !sourceSignal->Dependent(), at /builds/worker/checkouts/gecko/dom/abort/AbortSignal.cpp:294

Categories

(Core :: DOM: Core & HTML, defect)

defect

Tracking

()

VERIFIED FIXED
132 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr128 --- wontfix
firefox127 --- wontfix
firefox128 --- wontfix
firefox129 --- wontfix
firefox130 --- wontfix
firefox131 --- wontfix
firefox132 --- fixed

People

(Reporter: tsmith, Assigned: saschanaz)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: assertion, regression, testcase, Whiteboard: [bugmon:bisected,confirmed], [wptsync upstream])

Attachments

(3 files)

Attached file testcase.html

Found while fuzzing m-c 20240610-9e49a1b86e40 (--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: !sourceSignal->Aborted() && !sourceSignal->Dependent(), at /builds/worker/checkouts/gecko/dom/abort/AbortSignal.cpp:294

#0 0x785e3f6ec55c in mozilla::dom::AbortSignal::Any(mozilla::dom::GlobalObject&, mozilla::dom::Sequence<mozilla::OwningNonNull<mozilla::dom::AbortSignal>> const&) /builds/worker/checkouts/gecko/dom/abort/AbortSignal.cpp:294:9
#1 0x785e3fd5c26e in mozilla::dom::AbortSignal_Binding::any(JSContext*, unsigned int, JS::Value*) /builds/worker/workspace/obj-build/dom/bindings/./AbortSignalBinding.cpp:179:57
#2 0x785e445380e4 in CallJSNative(JSContext*, bool (*)(JSContext*, unsigned int, JS::Value*), js::CallReason, JS::CallArgs const&) /builds/worker/checkouts/gecko/js/src/vm/Interpreter.cpp:487:13
#3 0x785e445378cf in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason) /builds/worker/checkouts/gecko/js/src/vm/Interpreter.cpp:581:12
#4 0x785e4506bc36 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:1670:10
#5 0x1d5669d9aa5e  ([anon:js-executable-memory]+0xba5e)
Flags: in-testsuite?

Verified bug as reproducible on mozilla-central 20240619213942-7999d1a5d574.
The bug appears to have been introduced in the following build range:

Start: 2437c2ca5bec35fe4ab02eb938e0e02457cd079b (20240123142542)
End: f3efca74da0f43269bd8ac07e2a5d27e89c4d7c3 (20240123145016)
Pushlog: https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=2437c2ca5bec35fe4ab02eb938e0e02457cd079b&tochange=f3efca74da0f43269bd8ac07e2a5d27e89c4d7c3

Keywords: regression
Whiteboard: [bugmon:bisected,confirmed]
Regressed by: 1830781

:vhilla, since you are the author of the regressor, bug 1830781, could you take a look? Also, could you set the severity field?

For more information, please visit BugBot documentation.

Flags: needinfo?(vhilla)

Set release status flags based on info from the regressing bug 1830781

Another testcase to check whether the created signal will still be aborted despite the assertion not holding.

<script>
    let b;
    window.addEventListener("DOMContentLoaded", () => {
      let a = new AbortController()
      b = AbortSignal.any([a.signal])
      let c;
      a.signal.addEventListener("abort", () => {
        c = AbortSignal.any([b])
        console.log(b.aborted, a.signal.aborted);
    })
      a.abort();
      setTimeout(() => setTimeout(() => {
        console.log(c.aborted);
      }, 0), 0);
    })
</script>

As c still becomes aborted, I do not think there is any impact to users and the severity is low.

What happens is that we abort the signal which sets a to aborted, then fires an event.
During the event handler, a is aborted but b is not - same in Chrome. Therefore, we create a dependent signal c via AbortSignal::Any (this check is passed), which expects that if b is not aborted, a also is not and therefore we get an assertion failure.
As this is a debug assertion, in release, c is still created as a dependent signal on the already aborted a. Though as a did not yet abort the signal dependent on it all is good and c gets aborted.

The code above has the same output in Firefox and Chrome, I expect the control flow is the same and also what the spec expects. So I would say this is a spec issue, maybe firing of the event and aborting of dependent signals should be switched in order.

Severity: -- → S4
Flags: needinfo?(vhilla)

Taking this bug. Thank you for the great investigation and the previous implementation, Vincent!

Assignee: nobody → krosylight
Attachment #9422102 - Attachment description: WIP: Bug 1903676 - Implemented the new signal abort algorithm → Bug 1903676 - Update the signal abort algorithm r=#dom-core,smaug
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/47985 for changes under testing/web-platform/tests
Whiteboard: [bugmon:bisected,confirmed] → [bugmon:bisected,confirmed], [wptsync upstream]
Attachment #9423050 - Attachment description: WIP: Bug 1903676 - set some scheduler signal tests as passing → Bug 1903676 - set some scheduler signal tests as passing
Pushed by sstanca@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/877b8dbf447c Backed out changeset 943536ef24da for causing wpt failures in cache-abort.https.any.html. https://hg.mozilla.org/integration/autoland/rev/0bb1dab143e7 set some scheduler signal tests as passing. CLOSED TREE
Upstream PR was closed without merging

Backed out for causing wpt failures in cache-abort.https.any.html.

  • Backout link
  • Push with failures
  • Failure Log
  • Failure line: TEST-UNEXPECTED-FAIL | /service-workers/cache-storage/cache-abort.https.any.sharedworker.html | add() on an already-aborted request should reject with AbortError - promise_rejects_dom: add should reject function "function() { throw e }" threw object "TypeError: NetworkError when attempting to fetch resource." that is not a DOMException AbortError: property "code" is equal to undefined, expected 20

Also, please be aware about these wpt failures. For those ones, there's a patch in https://bugzilla.mozilla.org/show_bug.cgi?id=1903676#c11.

Flags: needinfo?(krosylight)
Pushed by sstanca@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e577f2498b11 Update the signal abort algorithm r=smaug https://hg.mozilla.org/integration/autoland/rev/62dae41dc66a set some scheduler signal tests as passing. CLOSED TREE
Regressions: 1917150

The patches are relanded by sheriffs, let's fix this in bug 1917150.

Status: NEW → RESOLVED
Closed: 10 months ago
Flags: needinfo?(krosylight)
Resolution: --- → FIXED
Upstream PR merged by moz-wptsync-bot

Verified bug as fixed on rev mozilla-central 20240906093607-9df162c80958.
Removing bugmon keyword as no further action possible. Please review the bug and re-add the keyword for further analysis.

Status: RESOLVED → VERIFIED
Keywords: bugmon
Target Milestone: --- → 132 Branch
Flags: in-testsuite? → in-testsuite+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: