Skip to content

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

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

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

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 43-x-y backport This is a backport PR semver/patch backwards-compatible bug fixes labels Jul 29, 2026
@ckerr
ckerr merged commit e2fbc6b into 43-x-y Jul 29, 2026
80 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/43-x-y-bp-fix-crash-when-devtools-loadcompleted-ipc-arrives-after-webcontents-teardown-1785293029834 branch July 29, 2026 05:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

No open projects
Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants