Closed Bug 1792765 Opened 2 years ago Closed 1 year ago

Tab freezes when running WebAssembly demo with devtools open

Categories

(Core :: JavaScript: WebAssembly, defect, P3)

Firefox 105
defect

Tracking

()

RESOLVED FIXED
111 Branch
Tracking Status
firefox111 --- fixed

People

(Reporter: kael, Assigned: rhunt)

Details

Attachments

(2 files)

Attached file AppBundle.zip

The attached WebAssembly demo causes the tab to freeze if you click 'Render' with devtools open and the Debugger tab selected (I do this to try and capture the jitted wasm modules so I can inspect them in devtools or profile them, with no success).

It runs successfully if devtools are closed. I should also note that profiling it with the Performance tab doesn't work either, capturing the profile produces a strange error message.

The demo works fine in Chrome and Edge. You can host the demo with any local web server since it's just HTML and javascript loading a wasm module.

The severity field is not set for this bug.
:rhunt, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(rhunt)

The issue here is that the debugger tab forces wasm to be compiled in baseline (which is slower) with debug instrumentation added. The debug instrumentation seems to be the main issue where we insert a load+compare+branch between each wasm opcode. Commenting this out causes the render to complete in between 12 - 27seconds (not great, but not indefinite).

We have a hard set of constraints when debugging, but our implementation here is probably sub-optimal. I'll see if there's another way we could do this.

Severity: -- → N/A
Flags: needinfo?(rhunt)
Priority: -- → P3

Adding some filtering to not emit duplicate breakable points (load+compare+branch) significantly improves render time. I'll see if the patch I have is landable.

Assignee: nobody → rhunt

This eliminates 56.6% of the number of breakpoint sites when running the
linked in the bug blazor app in debugging.

The severity field is not set for this bug.
:rhunt, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(rhunt)
Severity: N/A → S3
Flags: needinfo?(rhunt)

This is currently blocked on finding a way to update all the tests which assume that every bytecode offset is a valid place to put a breakpoint.

Pushed by rhunt@eqrion.net:
https://hg.mozilla.org/integration/autoland/rev/2b9f4fc135fd
wasm: Emit less breakpoint sites when debugging. r=yury

Backed out changeset 2b9f4fc135fd (Bug 1792765) for causing devtools failures on browser_dbg-features-wasm.js.
Backout link
Push with failures <--> dt1
Failure Log

Flags: needinfo?(rhunt)

There's a r+ patch which didn't land and no activity in this bug for 2 weeks.
:rhunt, could you have a look please?
If you still have some work to do, you can add an action "Plan Changes" in Phabricator.
For more information, please visit auto_nag documentation.

Flags: needinfo?(ydelendik)
Flags: needinfo?(rhunt)

I need to figure out how to fix the devtools test case.

Flags: needinfo?(ydelendik)
Flags: needinfo?(rhunt)
Pushed by rhunt@eqrion.net:
https://hg.mozilla.org/integration/autoland/rev/1f9490d18983
wasm: Emit less breakpoint sites when debugging. r=yury
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 111 Branch
QA Whiteboard: [qa-111b-p2]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: