Closed Bug 1747719 Opened 3 years ago Closed 3 years ago

Youtube is broken in Firefox ASAN

Categories

(Core :: JavaScript Engine, defect)

Firefox 97
defect

Tracking

()

RESOLVED FIXED
98 Branch
Tracking Status
firefox98 --- fixed

People

(Reporter: mikhail.v.gavrilov, Assigned: jandem, NeedInfo)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:97.0) Gecko/20100101 Firefox/97.0

Steps to reproduce:

Download latest Firefox ASAN build and try open youtube.com

Actual results:

The site opened, but didn't works.
Even video previews not displayed.
In console I see error message "Uncaught InternalError: too much recursion"

Expected results:

Youtube show recommended videos previews on main page.

The Bugbug bot thinks this bug should belong to the 'Core::Widget: Gtk' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Component: Untriaged → Widget: Gtk
Product: Firefox → Core
Component: Widget: Gtk → Audio/Video: Playback

Maybe we should increase the JS stack depth on ASAN?

Component: Audio/Video: Playback → JavaScript Engine

Any thoughts regarding the above suggestion Jan, or is there more investigation required first?

Severity: -- → S3
Flags: needinfo?(jdemooij)
Priority: -- → P3

The component has been changed since the backlog priority was decided, so we're resetting it.
For more information, please visit auto_nag documentation.

Priority: P3 → --

Bisecting gives this range:

https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=33d6ea7b0aadaa1fcdb03690d82cf9459764a9d7&tochange=6c01444e17210e96f5fb322c7b55a2e9f87ec0b0

Bug 1736057 is a bit suspicious. It could be the helper thread stack limit, maybe we should increase that for ASan builds similar to what we do for the main thread. I'll try something.

Component: XPConnect → JavaScript Engine

If this is Bug 1736057, This "too much recursion" error is caused by the parser then this is likely to happen when the page is being loaded.
This matches what is on the screenshot.

I am about to finish some work to eagerly delazify off-thread (Bug 1662110). If this is indeed this issue, this work would help by splitting the effort across multiple delazifications.

Another approach is that we could use a larger stack size for the HelperThread context. The reason we have conservative stack limits for SpiderMonkey is to ensure that we have enough space to make calls when we are in the chrome-world. Thus, preventing the JS code from causing stack overflow in the chrome code.

When parsing on HelperThreads we do not have this interleaving behaviour, and as such we might not need to have limits which are as conservative as on the main thread.

Flags: needinfo?(dpalmeiro)

ASan builds use more stack space so need a larger stack size. Note that this matches
what we already do for the JS overrecursion limit for the main thread.

This fixes overrecursion errors from the parser when parsing JS files off-thread
on YouTube.

Assignee: nobody → jdemooij
Flags: needinfo?(jdemooij)
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Pushed by jdemooij@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b60ae9f60f98 Use a larger stack size for TaskController threads for ASan builds. r=jonco,bas
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 98 Branch
Flags: qe-verify+

I could not reproduce the issue on Win10/Ubuntu20.4, using ASAN build 97.0a1 (20211217212339).
Is the issue still reproducing on your side on latest 98/99 builds?

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

Attachment

General

Creator:
Created:
Updated:
Size: