CP crashes the browser when you copy, then expand a Bard-containing Replicator set (Chrome/Edge ≥ 148)
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 25/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- javascript, php
- 領域
- frontend
調査の方向性
Start by reviewing the open pull request #14967 and reproducing the reported sequence: copy text, then expand a collapsed Replicator set containing a Bard field in Chrome or Edge 148+. The payload names no source files or tests; done means the browser no longer crashes on expansion while the reported input-only and no-copy cases remain unaffected.
索引モデルが issue の本文から書いたものです。
説明
Bug description
In the CP, if you copy some text and then expand a collapsed Replicator set that has a Bard field in it, the whole browser tab dies — Edge shows Errorcode 5, Chrome shows "Aw, Snap!" — and you lose unsaved edits. It might be an upstream Chromium bug, not really Statamic's fault, but the CP triggers it every time (seemingly since Statamic 6), so it's worth flagging (and Statamic could probably guard against it until Chrome fixes it).
Environment
Statamic 6.21 until 6.23. Repros in Chrome & Edge 148–151 (tried Edge 146, 147, 148, 149, 151, Chrome for Testing 149), Windows + Linux. Worked fine before version 148.
What might be going on
It's a Chromium renderer crash — not a JS error, not out-of-memory. edge://crashes shows process renderer, code 0x80000003 (STATUS_BREAKPOINT); on Linux it comes out as a CFI (Control Flow Integrity) violation (SIGILL/ILL_ILLOPN). Chrome calls through a wrong-type function pointer — a type-confusion thing — and its CFI guard catches it and kills the tab on purpose. The trigger is the combo clipboard copy → spin up a ProseMirror editor. Since it's buried in Chrome's own compiled code, we couldn't reproduce it with a plain contenteditable, and there's nothing to fix on the Statamic side — only avoid. Already reported to Google via Chrome's Help → Report an issue. (Disclaimer: examination supported by AI)
Workaround we're running
A small CP script: after a copy, it grabs the next control click, blurs whatever's focused, and re-fires that click two frames later — so the Bard editor mounts a beat later instead of in the same click. It's just automating the "click somewhere else first, then expand" trick that avoids the crash, and it handles the back-to-back-expand case too.
\Statamic\Statamic::inlineScript(<<<'JS'
(function () {
var copied = false, armed = null;
document.addEventListener('copy', function () { copied = true; });
document.addEventListener('pointerdown', function (e) {
armed = null;
if (!copied) return;
var t = e.target;
var btn = t.closest && t.closest('button, [role=button], a[href]');
if (!btn) return;
var a = document.activeElement;
if (a && (a.isContentEditable || (a.matches && a.matches('input, textarea')))) {
var field = a.closest && a.closest('.publish-field');
if (a === t || a.contains(t) || (field && field.contains(t))) return; // editing this field
}
armed = btn;
if (a && a.blur) a.blur();
}, true);
document.addEventListener('click', function (e) {
if (e.__cmsReplay) return;
var btn = armed; armed = null;
if (!btn || !(e.target === btn || btn.contains(e.target))) return;
e.preventDefault();
e.stopImmediatePropagation();
requestAnimationFrame(function () {
requestAnimationFrame(function () {
var ev = new MouseEvent('click', { bubbles: true, cancelable: true, view: window });
ev.__cmsReplay = true;
btn.dispatchEvent(ev);
});
});
}, true);
})();
JS);
(Disclaimer: Script creation supported by AI)
Idea for a built-in guard
Same trick, but scoped: when a set gets expanded, blur the active element and defer the editor mount by a frame (requestAnimationFrame) so it never spins up in the same turn as the click. Cleaner than our blanket version.
Happy to share the full crash backtrace and edge://crashes IDs — can grab them again if useful.
How to reproduce
- Entry with a Replicator whose sets contain a Bard field; collapse one of them.
- Copy text from any field (Bard, or even a plain
<input>— both work). - Expand the set with the Bard field → crash.
A few things we nailed down: the copy is required (no copy, no crash), only sets that actually mount a Bard/ProseMirror editor crash (input-only sets are fine), and only expanding does it (collapsing is safe).
Logs
No logs. Browser only problem.
Environment
Environment
Laravel Version: 13.15.0
PHP Version: 8.3.29
Composer Version: 2.9.5
Environment: local
Debug Mode: ENABLED
Maintenance Mode: OFF
Timezone: UTC
Locale: de
Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED
Drivers
Broadcasting: log
Cache: file
Database: mysql
Logs: stack / single
Mail: smtp
Queue: sync
Session: file
Storage
public/storage: NOT LINKED
Statamic
Addons: 2
License Key: Set
Sites: 2 (Deutsch, Schweizerdeutsch)
Stache Watcher: Disabled
Static Caching: Disabled
Version: 6.24.0 PRO
Statamic Addons
aerni/font-awesome: 4.0.1
teamnovu/graphql-breadcrumbs: 1.0.8
Installation
Fresh statamic/statamic site via CLI
Additional details
No response
- 主要言語
- PHP
- スター
- 4.9k
- フォーク
- 647
- 平均マージ
- 1日 45分
- マージ済み PR(30日)
- 221
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
statamic/cms のほかの issue
-
forms ui
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
accessibility
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
antlers
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
メンテナーはふだん 1 日以内に返信
-
Nav: link to the site root with an anchor (/#section) gets is_parent on every page対応中かも @duncanmcclean が今日担当しました。 オープンnavigations
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
-
Multiple Choice and Checkboxes no longer offer "Inline", but the default views still use it対応中かも @duncanmcclean が今日担当しました。 オープンforms
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
sync-en
難易度 1/5 1時間未満 初心者へのやさしさ 86/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
vimeo/psalm#15150 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
taskforcesh/bullmq#5238 ·
メンテナーはふだん 1 日以内に返信
-
[Bug] v-change-database-password reports success but doesn't change the password when MySQL validate_password rejects it対応中かも @bfs2021 が今日担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
Automattic/jetpack#55517 ·
メンテナーはふだん 1 日以内に返信