New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 807998 link

Starred by 3 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

ReadableStream: controller.error() causes debugger to pause

Project Member Reported by ricea@chromium.org, Feb 1 2018

Issue description

To reproduce:

1. Open Chrome's debugger
2. Run the following code (I used the "Snippets" feature to do this):

new ReadableStream({
    pull(controller) {
        controller.error(new Error('dummy'));
    }
}).getReader().read();

Expected behaviour:

Debugger does not pause.

Observed behaviour:

Debugger pauses with "Paused on promise rejection / Error: dummy"


The relevant lines of code in ReadableStream.js are:

    rejectPromise(reader[_closedPromise], e);
    markPromiseAsHandled(reader[_closedPromise]);

I haven't tried it, but maybe those lines should be the other way around?
 

Comment 1 by ricea@chromium.org, Feb 2 2018

Correction, the repro should be:

new ReadableStream({
    pull(controller) {
        controller.error(new Error('dummy'));
    }
}).getReader().read().catch(() => {});

ie. there needs to be a catch statement, otherwise there is a legitimately uncaught rejection and so there's no way to tell if it's broken or not.

Pasting it into the console is sufficient to reproduce.

Comment 2 by ricea@chromium.org, Feb 2 2018

Actually the call to read() isn't needed at all. Simpler repro:

new ReadableStream({
    pull(controller) {
        controller.error(new Error('dummy'));
    }
}).getReader();

Comment 3 by ricea@chromium.org, Feb 2 2018

Swapping the order of the lines

    rejectPromise(reader[_closedPromise], e);
    markPromiseAsHandled(reader[_closedPromise]);

in ReadableStreamError doesn't help.
Cc: littledan@chromium.org yangguo@chromium.org gsat...@chromium.org
I guess we are not triggering the inspector's catch prediction heuristics. Adding some folks who I recall being involved in that work for advice.

Comment 5 by ricea@chromium.org, Feb 5 2018

Owner: ----
Status: Available (was: Assigned)
Unassigning myself since it appears changes within V8 would be needed to fix this.

Sign in to add a comment