Skip to content

Intermittent crash in /css/css-font-loading/fontfaceset-worker-fontface-crash.html #50063

Open

Description

@rogerkorantenng

css/css-font-loading/fontfaceset-worker-fontface-crash.html has been crashing intermittently since #50046. I got 1 crash in 60 runs on main (f0c02de):

fontface-crash

The worker in that test dispatches a message event to itself from inside its own message handler, so it hits "too much recursion". Right after that it calls new FontFace(...) with the stack nearly full, the promise can't be created, and Promise::new asserts.

This isn't specific to workers, though. Calling new FontFace(...) near the recursion limit on a regular page crashes every time on main too. #50046 just made this worker test reach it, because before that there was no FontFace in workers and the line threw a ReferenceError.

Any constructor that creates a promise could panic the same way, but for this one I'd make the FontFace constructor throw when the promise can't be created. I'm working on it.

To reproduce: ./mach test-wpt --repeat 60 css/css-font-loading/fontfaceset-worker-fontface-crash.html

Activity

  1. rogerkorantenng commented on Nov 19, 2026

    @rogerkorantenng
    ContributorAuthor

    My plan is to add a fallible way to create a Promise that returns Error::JSFailed when SpiderMonkey can't create the promise object, and use it in the FontFace constructor so it throws instead. Promise::new stays the same, so nothing else changes. Then new FontFace(...) near the recursion limit throws the "too much recursion" error to script, which is what Firefox does.

  2. rogerkorantenng commented on Nov 19, 2026

    @rogerkorantenng
    ContributorAuthor

    @servo-highfive assign me

  3. added
    C-assigned
    on Nov 19, 2026
  4. servo-highfive commented on Nov 19, 2026

    @servo-highfive

    Hey @rogerkorantenng! Thanks for your interest in working on this issue. It's now assigned to you!

  5. changed the title [-]Panic when creating a FontFace in a worker after too much recursion[/-] [+]Intermittent crash in `/css/css-font-loading/fontfaceset-worker-fontface-crash.html`[/+] on Nov 19, 2026
  6. added
    I-intermittent
    on Nov 19, 2026
  7. added a commit that references this issue on Nov 24, 2026
    d981f0d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

C-assignedI-intermittent

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions