Stacks are missing for uncaught exceptions in workers

RESOLVED FIXED in Firefox 68

Status

defect
P2
normal
RESOLVED FIXED
a month ago
7 days ago

People

(Reporter: bhackett, Assigned: bhackett)

Tracking

(Blocks 1 bug)

unspecified
Firefox 68
Dependency tree / graph

Firefox Tracking Flags

(firefox68 fixed)

Details

Attachments

(4 attachments)

Assignee

Description

a month ago

Uncaught exceptions in worker threads are shown in the console, with the location of the place the exception was thrown from but no stack trace.

Using this test page https://melodic-client-1.glitch.me/, I don't even see the location.
The error object is created in dom/workers/WorkerError.cpp#487-491, using a nsScriptError, where it could use a nsScriptErrorWithStack I guess?

Brian, would you mind checking if this can be fixed quickly? Thanks!

Flags: needinfo?(bhackett1024)
Priority: -- → P2
Assignee

Comment 2

a month ago

I was working on this yesterday and should have a patch later today. We do need to use nsScriptErrorWithStack, but the tricky part is getting the stack info from the worker thread to the main thread (where the nsScriptErrorWithStack is created).

Flags: needinfo?(bhackett1024)
Assignee

Comment 6

a month ago

New test, for reference.

Comment on attachment 9058186 [details] [diff] [review]
Part 4 - Add test for uncaught worker errors.

Might be good to have tests for throwing |new DOMException| too.

Comment 8

a month ago
Pushed by bhackett@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/57904fc5ae57
Part 1 - Add API to set the stack for a pending exception, r=sfink.
https://hg.mozilla.org/integration/mozilla-inbound/rev/39a877972476
Part 2 - Include stack in worker error reports, r=bz.
https://hg.mozilla.org/integration/mozilla-inbound/rev/e38792ce2185
Part 3 - Use stack for error location if none was specified, r=nchevobbe.
https://hg.mozilla.org/integration/mozilla-inbound/rev/f236858f5add
Part 4 - Add test for uncaught worker errors.
You need to log in before you can comment on or make changes to this bug.