Skip to content

fix: crash when DevTools LoadCompleted IPC arrives after WebContents teardown - #52511

Merged
ckerr merged 1 commit into
42-x-yfrom
trop/42-x-y-bp-fix-crash-when-devtools-loadcompleted-ipc-arrives-after-webcontents-teardown-1785293031003
Jul 29, 2026
Merged

ckerr merged 1 commit into
42-x-yfrom
trop/42-x-y-bp-fix-crash-when-devtools-loadcompleted-ipc-arrives-after-webcontents-teardown-1785293031003

Conversation

@trop

@trop trop Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Backport of #52166

See that PR for details.

Notes: Fixed a crash that could occur when closing DevTools while the host WebContents was being destroyed.

A queued DevTools embedder-message IPC (e.g. "loadCompleted") can be
dispatched after the owning WebContents has begun teardown. The
WebContents registers itself as both the InspectableWebContentsView
delegate and the InspectableWebContents delegate, and the embedder
message handlers call back into it via base::Unretained(this). PR #47435
(issue #19985) cleared the view delegate on teardown, but the sibling
InspectableWebContents delegate (DevTools file/filesystem handlers) was
left dangling, so a late callback there is a use-after-free on the freed
WebContents.

Clear the InspectableWebContents delegate alongside the view delegate so
any late DevTools embedder callback becomes a guarded no-op instead of
touching freed memory.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Us1vbuJ3MzX5bm6YKP6AW8

Co-authored-by: Claude <[email protected]>
@trop trop Bot added 42-x-y backport This is a backport PR semver/patch backwards-compatible bug fixes labels Jul 29, 2026
@ckerr
ckerr merged commit cc5cc47 into 42-x-y Jul 29, 2026
77 checks passed
@release-clerk

release-clerk Bot commented Jul 29, 2026

Copy link
Copy Markdown

Release Notes Persisted

Fixed a crash that could occur when closing DevTools while the host WebContents was being destroyed.

@ckerr
ckerr deleted the trop/42-x-y-bp-fix-crash-when-devtools-loadcompleted-ipc-arrives-after-webcontents-teardown-1785293031003 branch July 29, 2026 04:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

42-x-y backport This is a backport PR semver/patch backwards-compatible bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant