Closed Bug 1822717 Opened 3 years ago Closed 3 years ago

Loading module causes tab crash

Categories

(Core :: JavaScript Engine, defect, P1)

x86_64
Linux
defect

Tracking

()

RESOLVED FIXED
113 Branch
Tracking Status
firefox-esr102 --- unaffected
firefox111 --- wontfix
firefox112 --- wontfix
firefox113 --- fixed

People

(Reporter: jimb, Assigned: jonco)

References

(Regression)

Details

(Keywords: regression)

Attachments

(3 files)

Loading an async module causes Firefox to display the "Gah. Your tab just crashed" message in changeset c47b3b28fb48 (2023-3-14) on x86_64 Linux.

To reproduce, download the attached file repro.zip, and then:

$ unzip repro.zip 
Archive:  repro.zip
   creating: repro/
  inflating: repro/index.html        
  inflating: repro/triangle.js       
$ cd repro/
$ python3 -m http.server
Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...

Then, in a Firefox tree:

$ mach run http://127.0.0.1:8000

This may not be very helpful, but, bisection says the crash was introduced in this change:

changeset: 727237:7dfd43c2efc6
user: Jon Coppeard <jcoppeard@mozilla.com>
date: Tue Feb 07 11:55:51 2023 +0000
summary: Bug 1813494 - Part 3: Add more cancellation checks and state assertions to module load requests r=smaug

Flags: needinfo?(jcoppeard)

Note that the code in triangle.js file is almost entirely commented out. There's nothing in here that could run WebGPU code.

Another clue may be that, if you delete the comments in triangle.js, it doesn't crash any more. You instead get an error in the web console:

Uncaught SyntaxError: redeclaration of const error
note: Previously declared at line 4, column 10

If you do modify the test input, don't forget to blow away your browser cache:

$ rm -rf obj-x86_64-pc-linux-gnu/tmp/profile-default && mach run http://localhost:8000
Type: task → defect
Keywords: regression
Regressed by: 1813494

It looks like that crash report is rather old so I've marked the comment obsolete.

Thanks for the report and easy repro.

Assignee: nobody → jcoppeard
Flags: needinfo?(jcoppeard)
Priority: -- → P1

ModuleErrored() can be called when we are in the compiling state too, if we are
parsing the module off-thread.

:jonco, FYI we could potentially pick this up for a 111 release. Is that something you'd like to try for?

Flags: needinfo?(jcoppeard)

The fix is to change a debug-only assertion, so there's no user impact. IMO not worth it unless this will help with testing.

Flags: needinfo?(jcoppeard)
Pushed by jcoppeard@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b68aca161658 Relax assertion about module request state when an error occurs r=yulia
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 113 Branch

The patch landed in nightly and beta is affected.
:jonco, is this bug important enough to require an uplift?

  • If yes, please nominate the patch for beta approval.
  • If no, please set status-firefox112 to wontfix.

For more information, please visit auto_nag documentation.

Flags: needinfo?(jcoppeard)
Flags: needinfo?(jcoppeard)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: