Skip to content

LibWeb+WebWorker: Fix two common browser crashes#26694

Open
spholz wants to merge 2 commits intoSerenityOS:masterfrom
spholz:browser-fix-monotonically-increasing-crash
Open

LibWeb+WebWorker: Fix two common browser crashes#26694
spholz wants to merge 2 commits intoSerenityOS:masterfrom
spholz:browser-fix-monotonically-increasing-crash

Conversation

@spholz
Copy link
Copy Markdown
Member

@spholz spholz commented Apr 4, 2026

The first commit is a cherry-pick of LadybirdBrowser/ladybird#5636. This fixes the common "VERIFICATION FAILED: is_monotonically_increasing()" browser crash, which happens on a lot of websites. This crash seems to be significantly easier to trigger in serenity itself, e.g. by just waiting on e.g. duckduckgo.com.
I had to apply one small fixup (GC::RootVector<GC::Ref<Animation>>(vm().heap()) -> JS::MarkedVector<JS::NonnullGCPtr<Animation>>(vm().heap())) to make it compile without having cherry-picked the LibGC changes from upstream Ladybird.

The second commit fixes the Google Search reCAPTCHA crash from #26548, but we still hang with 100% CPU usage, so this issue isn't fixed yet.

Fixes #26264

@github-actions github-actions bot added the 👀 pr-needs-review PR needs review from a maintainer or community member label Apr 4, 2026
@spholz spholz force-pushed the browser-fix-monotonically-increasing-crash branch from 4e7cd71 to 9cb80b0 Compare April 4, 2026 20:03
gmta and others added 2 commits April 4, 2026 22:20
Our previous implementation kept track of an AnimationTimeline being
monotonically increasing, by looking at new time values coming in and
setting `m_monotonically_increasing` to `false` whenever a new value
is before the previous known time value.

As far as I can tell, the spec doesn't really ask us to do so: it just
defines 'monotonically increasing' as a property of a timeline, i.e. it
guarantees that returned time values from `::current_time()` are always
greater than or equal to the last returned value.

This fixes a common crash seen when the last render opportunity lies
before the document's origin time, and `::set_current_time()` was
invoked with a negative value. This was especially visible in the
`Text/input/wpt-import/css/cssom/CSSStyleSheet-constructable.html` test.

(cherry picked from commit aa563706ca090b31cb22c38414e21bc913eb6052)
This pledge is needed by BlockAllocator::deallocate_block().

This causes us to no longer crash on the Google Search reCAPTCHA page.
We now hang with 100% CPU usage instead.
@spholz spholz force-pushed the browser-fix-monotonically-increasing-crash branch from 9cb80b0 to e91d624 Compare April 4, 2026 20:21
@spholz
Copy link
Copy Markdown
Member Author

spholz commented Apr 4, 2026

I dropped that temporary copy of m_associated_animations now. I accidentally included this even though LadybirdBrowser/ladybird#5636 didn't add this (it only added braces around the if statement).
It was added in LadybirdBrowser/ladybird@784bf0e, so I had to do a different fixup now of not adding the braces around this if statement: https://github.com/LadybirdBrowser/ladybird/pull/5636/changes#diff-e3a1230c798000ed76d5fd306cd9cef7aef08f636ee645316fa875d628feb4bfL30.
Let's see if that fixed CI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

👀 pr-needs-review PR needs review from a maintainer or community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Browser: crash with is_monotonically_increasing()

2 participants