Assertion failure: CheckedUnwrap(promiseObj)->is<PromiseObject>(), at js/src/jsapi.cpp:4054 with ReadableStream

RESOLVED FIXED in Firefox 65

Status

()

P1
critical
RESOLVED FIXED
3 months ago
3 months ago

People

(Reporter: gkw, Assigned: jorendorff)

Tracking

(Blocks: 2 bugs, 4 keywords)

Trunk
mozilla65
x86_64
Linux
assertion, jsbugmon, regression, testcase
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox-esr60 unaffected, firefox63 unaffected, firefox64 unaffected, firefox65 fixed, firefox66 fixed)

Details

(Whiteboard: [jsbugmon:update])

Attachments

(2 attachments)

The following testcase crashes on mozilla-central revision 47077594d943 (build with --enable-debug --enable-more-deterministic, run with --fuzzing-safe --no-threads --no-baseline --no-ion):

// Adapted from randomly chosen test: js/src/tests/non262/Promise/bug-1287334.js
Object.defineProperty(Promise, Symbol.species, {
    value: function(g) {
        g(function() {}, function() {})
    }
});
// Adapted from randomly chosen test: js/src/tests/non262/ReadableStream/tee-start.js
new ReadableStream(Object.e).tee();

Backtrace:

#0  CallOriginalPromiseThenImpl (cx=0x7f8911e18000, promiseObj=..., onResolvedObj_=..., onRejectedObj_=..., resultObj=..., createDependent=js::CreateDependentPromise::Never) at js/src/jsapi.cpp:4054
#1  0x00005560fa7698f8 in JS::AddPromiseReactions (cx=0x7f8912f40680 <_IO_2_1_stderr_>, promiseObj=..., onResolvedObj=..., onRejectedObj=...) at js/src/jsapi.cpp:4079
#2  0x00005560fa5a91f3 in ReadableStreamControllerCallPullIfNeeded (cx=0x7f8911e18000, unwrappedController=...) at js/src/builtin/Stream.cpp:2773
#3  0x00005560fa5a79e8 in ControllerStartHandler (cx=0x7f8911e18000, argc=<optimized out>, vp=<optimized out>) at js/src/builtin/Stream.cpp:2198
#4  0x00005560fa1c9365 in CallJSNative (cx=0x7f8911e18000, native=0x5560fa5a7810 <ControllerStartHandler(JSContext*, unsigned int, JS::Value*)>, args=...) at js/src/vm/Interpreter.cpp:443
/snip

For detailed crash information, see attachment.
autobisectjs shows this is probably related to the following changeset:

The first bad revision is:
changeset:   https://hg.mozilla.org/mozilla-central/rev/3db828b6494a
user:        Jason Orendorff
date:        Wed Oct 24 16:53:09 2018 +0000
summary:     Bug 1501734 - Enable streams by default in the JS shell. r=tcampbell

Jason, this is probably related to streams - bug 1501734 right?
Blocks: 1501734
Flags: needinfo?(jorendorff)
(Assignee)

Updated

3 months ago
Assignee: nobody → jorendorff
Flags: needinfo?(jorendorff)
(Assignee)

Comment 3

3 months ago
We need a CallOriginalPromiseThen variant that performs the type check in <https://tc39.github.io/ecma262/#sec-promise.prototype.then> step 2 rather than asserting it.

There are already way too many variations on that theme, though. :-\

Updated

3 months ago
status-firefox63: --- → unaffected
status-firefox64: --- → unaffected
(Assignee)

Updated

3 months ago
Blocks: 1503319
Priority: -- → P1

Comment 6

3 months ago
Pushed by jorendorff@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/71253f35ac3c
Fix assertion failure with ReadableStream and Promise[Symbol.species]. r=arai

Comment 10

3 months ago
Pushed by jorendorff@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c0c4ff2b0485
Fix assertion failure with ReadableStream and Promise[Symbol.species]. r=arai

Comment 11

3 months ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/c0c4ff2b0485
Status: NEW → RESOLVED
Last Resolved: 3 months ago
status-firefox65: affected → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla65
status-firefox-esr60: --- → unaffected
status-firefox66: --- → fixed
You need to log in before you can comment on or make changes to this bug.