[6.x] Fix browser crash when expanding a Bard set after a copy#14967
Open
jasonvarga wants to merge 1 commit into
Open
[6.x] Fix browser crash when expanding a Bard set after a copy#14967jasonvarga wants to merge 1 commit into
jasonvarga wants to merge 1 commit into
Conversation
Guards against a Chrome/Edge >= 148 renderer crash (CFI abort) that kills the tab when a ProseMirror editor is laid out in the same trusted-click turn that reveals it while a clipboard copy is pending. See #14946. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Hm, that's weird. I was able to reproduce the bug on macOS in Chrome & Chromium. But I can test the PR if this fixes the issue :) |
Contributor
|
We're testing this too - will report feedback in next 24 hrs As a note - some people have reported the same exact error and said they didn't copy anything. So we'll see what happens. |
Contributor
|
So gave this another test against my repro (Chrome 149 on macOS with my blueprint in the original issue) and unfortunately it still crashes the tab. The trigger is the container reveal and the CSS animation happening inside the same click (with Bard just mounted in there). If you disable the animations for instance, the tab is not crashing.. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #14946
The bug
Copying some text and then expanding a collapsed Replicator/Bard set that contains a Bard field crashes the whole browser tab on Chrome/Edge ≥ 148 (Edge shows Error code 5, Chrome "Aw, Snap!"), losing unsaved edits. It's an upstream Chromium renderer crash — a CFI (Control Flow Integrity) abort triggered by laying out a ProseMirror editor in the same trusted-click turn that reveals it while a clipboard copy is pending. There's nothing to fix on our side, only avoid.
The approach
Collapsed sets keep their fields mounted (
v-show), so the Bard editor already exists while hidden — the trigger is the reveal (goingdisplay:none→ visible), which forces ProseMirror to lay out during the click. Deferring that layout by one frame moves it off the trusted-click turn and the crash can't happen.Rather than deferring the reveal at every surface that can expose a Bard editor (Replicator sets, nested Bard sets, Group fields, the Revealer, tabs, sections, freshly-added sets…), this puts a single guard inside Bard itself. A
ResizeObserverwatches the field; when it becomes visible, the editor's content is shown one frame later. This covers every reveal path — current and future — in one place.Thanks to @o1y for #14951, which diagnosed the trigger and prototyped the per-surface deferral this builds on.
Testing