You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Flaky crash: macOS test process SIGSEGV in WebContents::DevToolsOpened() during MenuItems toggleDevTools/reload tests #52158
The macos-arm64 / test / test (mas, 2) CI shard crashed with a SIGSEGV, killing the test process mid-run. Because the process died, the crashing test never emitted its own ok/not ok result.
The crash fired during the MenuItems MenuItem role tests. The last results logged before the crash were:
ok 576 MenuItems MenuItem toggleDevTools role toggles devtools on the focused webContents
ok 577 MenuItems MenuItem toggleDevTools role toggles parent devtools when invoked with the devtools webContents
ok 578 MenuItems MenuItem reload roles reload role reloads the focused webContents
then immediately: Received signal 11 SEGV_ACCERR 0000000001e0 followed by ✗ Electron tests failed with kill signal SIGSEGV.
Crash signature
Fault: Received signal 11 SEGV_ACCERR at address 0x1e0. Key frames from the browser-process backtrace (release build, symbolized to symbol+offset only):
Not observed on Linux ASAN: the same MenuItems tests run on linux-x64-asan (full tests, on every main push/PR) and have not failed there over the retained CI test-history window.
Symbolized against the CI binary: DevToolsOpened+476 is handle->owner_window() on the DCHECK_EQ line right after FromOrCreate(isolate, dtwc), and handle.get() is null (WeakReference::IsValid() on 0x0 + offsetof(owner_window_), which is 0x1d0 on 42-x-y and 0x1e0 on main).
FromOrCreate returns an empty handle because the devtools api::WebContents is a zombie: InspectableWebContents::ShowDevTools creates it eagerly and drops the handle, it's kRemote so never pinned, and nothing holds the wrapper until DevToolsOpened sets devtools_web_contents_. If GC runs while the frontend is loading, FirstWeakCallback marks it dead_ and defers the delete, From() still finds it via the UserDataLink WeakPtr, GetWrapper() returns empty, and we deref null. Same root cause as #29890 / #34042 / #47187.
We should keep that handle alive from ShowDevTools onwards (a v8::Global on InspectableWebContents cleared on close, or hand it to the owner right away) rather than just null-checking in DevToolsOpened. I'll put up a PR.
Thanks for the detailed root-cause analysis. Keeping the handle alive from
ShowDevTools sounds like a more robust fix than simply adding a null check.
Looking forward to the PR.
Activity
MarshallOfSound commentedon Aug 11, 2026
Fixed by #52166
MarshallOfSound commentedon Aug 16, 2026
Reopening, this reproduced on 42-x-y in https://github.com/electron/electron/actions/runs/31910945944/job/95080347500 with the #52166 backport (#52511) already on the branch, so that wasn't the fix.
Symbolized against the CI binary:
DevToolsOpened+476ishandle->owner_window()on theDCHECK_EQline right afterFromOrCreate(isolate, dtwc), andhandle.get()is null (WeakReference::IsValid()on0x0 + offsetof(owner_window_), which is0x1d0on 42-x-y and0x1e0on main).FromOrCreatereturns an empty handle because the devtoolsapi::WebContentsis a zombie:InspectableWebContents::ShowDevToolscreates it eagerly and drops the handle, it'skRemoteso never pinned, and nothing holds the wrapper untilDevToolsOpenedsetsdevtools_web_contents_. If GC runs while the frontend is loading,FirstWeakCallbackmarks itdead_and defers the delete,From()still finds it via theUserDataLinkWeakPtr,GetWrapper()returns empty, and we deref null. Same root cause as #29890 / #34042 / #47187.We should keep that handle alive from
ShowDevToolsonwards (av8::GlobalonInspectableWebContentscleared on close, or hand it to the owner right away) rather than just null-checking inDevToolsOpened. I'll put up a PR.sama64867 commentedon Aug 16, 2026
fix: keep remote api::WebContents alive while their content::WebConte…
fix: keep remote api::WebContents alive while their content::WebConte…
fix: keep remote api::WebContents alive while their content::WebConte…
fix: keep remote api::WebContents alive while their content::WebConte…