Repository navigation
Conversation
… emitted them Crash breadcrumbs live in one global ring in the main process, and the IPC listener discarded event.sender, so a report filed by one renderer carried another renderer's trail. Tag renderer crumbs with their webContents origin and filter the snapshot to the reporting renderer; main-process crumbs stay global. Child/GPU crashes name no renderer and keep the whole ring, as before.
📝 WalkthroughWalkthroughThe change adds a shared renderer origin format and sanitized breadcrumb origin metadata. Renderer IPC handlers derive origins from sender IDs and pass them through direct and coalesced recording paths. Breadcrumb snapshots filter renderer-scoped entries by reporter origin while preserving global entries. Renderer crash reports use scoped snapshots, while child and GPU crash reports retain the full ring. Tests cover sanitization, coalescing, filtering, and report attribution. Merge Risk: 🟡 Moderate · up to The change scopes crash breadcrumbs to their emitting renderer, but renderer-specific report deduplication and retained highwater records still ignore renderer identity, so one renderer can suppress another report or lose its own diagnostic evidence. Merge should wait for these bounded correctness issues to be fixed. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
src/shared/crash-breadcrumb-origin.ts (1)
1-2: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winRemove or shorten this comment.
The function name and implementation already show this behavior. Use one short comment only if the format contract needs explanation.
As per coding guidelines, “Comments must be concise, non-obvious, and brief—prefer one line; do not explain obvious behavior or walk through code.”
Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 55bc3871-c1d5-4a39-8f65-ca84bf5e4f60
📒 Files selected for processing (12)
src/main/crash-reporting/crash-breadcrumb-renderer-attribution.test.tssrc/main/crash-reporting/crash-breadcrumb-store.test.tssrc/main/crash-reporting/crash-breadcrumb-store.tssrc/main/crash-reporting/process-gone-recorder.tssrc/main/index.tssrc/main/ipc/crash-reporting-renderer-breadcrumbs.test.tssrc/main/ipc/crash-reporting-renderer-breadcrumbs.tssrc/main/ipc/crash-reporting-renderer-error-report.tssrc/main/ipc/crash-reporting.tssrc/shared/crash-breadcrumb-origin.tssrc/shared/crash-reporting.test.tssrc/shared/crash-reporting.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
| export function recordCrashBreadcrumb( | ||
| name: string, | ||
| data?: CrashReportBreadcrumbData | ||
| data?: CrashReportBreadcrumbData, | ||
| origin?: string | ||
| ): CrashReportBreadcrumb | undefined { | ||
| const sanitized = sanitizeCrashReportBreadcrumbs([ | ||
| { | ||
| createdAt: new Date().toISOString(), | ||
| name, | ||
| data | ||
| data, | ||
| ...(origin ? { origin } : {}) |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
Include origin in the retained breadcrumb key.
retainedBreadcrumbKey identifies renderer_memory_highwater entries by name, surface, and threshold only. If two renderers emit the same retained breadcrumb, the second write replaces the first. The first renderer then filters out the replacement and loses its own highwater evidence.
Include breadcrumb.origin in the retained key. Add a test with two origins and equal retained-breadcrumb data.
Proposed fix
function retainedBreadcrumbKey(breadcrumb: CrashReportBreadcrumb): string | null {
if (breadcrumb.name !== 'renderer_memory_highwater') {
return null
}
const surface = breadcrumb.data?.rendererSurface
const threshold = breadcrumb.data?.thresholdPct
- return `${breadcrumb.name}:${String(surface)}:${String(threshold)}`
+ return JSON.stringify([
+ breadcrumb.name,
+ breadcrumb.origin ?? null,
+ surface,
+ threshold
+ ])
}| /** Crashing webContents, when the source is a renderer. Kept out of `details` | ||
| * so this internal Chromium id never reaches the user-facing report text. */ | ||
| webContentsId?: number |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Scope report deduplication by renderer identity. Both paths now know the reporting renderer, but both dedupe before recording with keys that exclude it. A matching failure in a sibling renderer suppresses that renderer's report and its scoped breadcrumbs.
src/main/crash-reporting/process-gone-recorder.ts#L45-L47: includewebContentsIdor its origin in renderer-only process-gone dedupe keys.src/main/ipc/crash-reporting-renderer-error-report.ts#L120-L123: includewebContentsIdor its origin in renderer error-report dedupe keys.
📍 Affects 2 files
src/main/crash-reporting/process-gone-recorder.ts#L45-L47(this comment)src/main/ipc/crash-reporting-renderer-error-report.ts#L120-L123
|
Held as draft after readiness review: #16313 already merged a superset of this fix, including per-renderer dedupe, retained-key scoping, filter-before-budget behavior, and persistence scrubbing. This branch now conflicts with main and should not merge as-is. |
|
Closing as superseded by #16313; the merged implementation includes the required attribution, dedupe, retention, and persistence fixes. |
Description
Crash breadcrumbs are stored in a single global ring in the main process (
crash-breadcrumb-store.ts,MAX_BREADCRUMBS = 30), and the IPC listener that receives renderer breadcrumbs discarded the sender:getCrashBreadcrumbSnapshot()was then attached unfiltered to every renderer crash report. So a report filed by renderer A carried breadcrumbs emitted by renderer B — a second window, a browser-pane webview guest, or the dashboard popout. Orca genuinely runs multiple renderers; therenderer_memorybreadcrumb literally reportsbrowserWebviewsandregisteredBrowserGuestscounts.This fix tags each renderer breadcrumb with its originating
webContentsand filters the snapshot to the reporting renderer. Main-process breadcrumbs (app_started,updater_*,gpu_fallback_applied, …) carry no origin and stay visible on every report, because they are genuinely global evidence.This is not a theoretical bug — it produced a wrong diagnosis during the triage that found it. Investigating crash
b05f68db/sidebar.worktreesfrom #orca-crashes, I read alazy_chunk_reload+lazy_chunk_reload_vetoedbreadcrumb pair in the bundle as proof that the crashing renderer had taken the lazy-chunk reload branch, and built a whole root-cause theory on it. Because the ring is global and unattributed, those crumbs could have come from any renderer. The theory was wrong.Fix evidence
src/main/crash-reporting/crash-breadcrumb-renderer-attribution.test.tsdrives the real main-process code — the realregisterCrashReportingHandlers, the real store (not mocked; the pre-existing IPC suites mock the store, which is exactly why they never caught this), the realrecordProcessGoneCrash, and the realcrashReports:recordRendererErrorhandler. Two renderers are simulated by invoking the captured IPC listener with{ sender: { id: 11 } }and{ sender: { id: 22 } }. Assertions read what actually lands instore.record(...).BEFORE — production code at
origin/main, new tests applied:AFTER — fix applied, same tests, nothing weakened:
Note the two tests that pass before and after — they are the guard rails proving the fix does not over-correct: a child/GPU crash that names no renderer still gets the whole ring, and one renderer's own repeats still coalesce normally.
Wider verification, macOS (arm64):
tsc --noEmit -p config/tsconfig.node.json→ exit 0.oxlintclean.Windows (win32,
awin) — 42 of the 66 crashes in this triage batch were Windows, so the suite was re-run natively there:ELI5
Imagine one shared notepad on the wall of a building. Every room writes what it's doing on that same notepad, and nobody signs their name. When one room catches fire, we photocopy the last 30 lines of the notepad and staple it to the incident report as "what this room was doing."
Except half those lines were written by other rooms. So the fire investigator reads "was heating oil" and blames the wrong room — which is exactly what happened to me while triaging these crashes.
This change makes each room sign its notes. Building-wide announcements ("power came back on") stay unsigned and go on every report, because they really do apply to everyone. When a room catches fire, the report now includes the building-wide announcements plus that room's own notes, and nobody else's.
Trade-offs
Real ones, including things that get worse:
The eviction half is deliberately NOT fixed. The ring is still one shared 30-entry budget and the filter runs after the budget slice. A chatty sibling renderer can still push the crashing renderer's crumbs out before the report is filed, so a scoped report can now come back with fewer than 30 entries where it previously came back with 30. Those extra entries were another renderer's and were misleading — but "fewer breadcrumbs" is a visible change, and it means a busy multi-window session can still produce a thin report. Fixing it properly is a capacity/tuning decision; see "Rejected approach" below for why it is not in this PR. Comments on
getCrashBreadcrumbSnapshotand in the test say so explicitly.Webview guests and popouts drop off the main window's report. Browser-pane guests and
dashboard-popoutare separatewebContents, so their breadcrumbs no longer appear on the main window's crash report. This is the intended semantics, but if you were relying on seeing browser-guest activity on a main-window crash, you will not see it any more. The flip side is that a popout's own boundary report now gets its own trail instead of the main window's.Cross-renderer coalescing changed. The renderer coalesce key now includes origin, so two renderers emitting an identical coalesced breadcrumb inside the 30s window no longer share one entry. This costs one extra ring slot per storming window (still
MAX_COALESCE_KEYS-bounded). Without it, the sibling's copy was suppressed into an entry its own report then filtered out — the count vanished. That was a blocker finding in review loop 1.originis a new optional field on the serialized breadcrumb and appears in crash-report text as- <ts>: <name> [renderer:11]. Perdocs/reference/remote-wire-compatibility.mdthis is the safe case: additive, no new stream opcode. Absent origin degrades to today's behavior (visible on every report), never to a disappearance. It goes through the samesanitizeCrashReportStringredaction and length cap as every other breadcrumb string, and there is a test locking the round-trip so filtering can never silently stop matching.No behavior change for GPU/utility/child crashes — they name no renderer and keep the full ring, because no single surface filed the report and scoping it would delete real evidence.
Rejected approach (worth knowing before review)
The first attempt at this fix tried to solve misattribution and eviction together, and redesigned the storage layer: per-origin rings, per-origin retained crumbs, reserved snapshot budgets, and a 16-origin LRU. It failed 5 consecutive adversarial review loops without converging. Every blocker/major finding was about the machinery it added, not the bug — LRU-evicting a live renderer's entire trail, erasing evidence on the
webContents destroyedpath, losing retained-crumb dedup, and over-reporting coalesce visibility (the same class of error "fixed" wrongly three times). A perf pass measured it introducing a 13× regression on the coalesce expiry sweep (0.242ms → 3.267ms) plus 2.5ms of synchronous main-process work on every window close.That approach was discarded and the problem split. This PR does misattribution only: ~60 net lines of production code, filtering on read, single ring untouched.
Adversarial review
2 loops to clean. Each loop was a fresh sub-agent with no prior context, instructed to break the change and to treat any reintroduced per-origin ring / budget / LRU as a blocker.
origin, so two renderers emitting the same coalesced breadcrumb shared one ring entry owned by whichever emitted first; the sibling's copy was suppressed into a crumb its own report filtered out, and the count was lost. Fixed (trade-off 3 above).keeps every renderer trail on a child crash that names no webContents,stores the origin label sanitization leaves untouched). The remaining minor — retainedrenderer_memory_highwatercrumbs carry an origin whileretainedBreadcrumbKeyis stillname:surface:threshold— is noted and left; it only affects which of two same-surface high-water profiles is retained, not attribution.Perf
/perfaudit: no meaningful impact.renderer:<id>string) and +~0.06 µs on the coalesce suppressed path. At the worst observed emission rate (1459/min crash loop ≈ 24 crumbs/s) that is +1.3 µs of main-process CPU per second..filterdrops entries before thesortand deepmap.O(origins × ring)shape that caused the rejected attempt's 13× regression is absent:isVisibleToReporteris O(1) per crumb on crash-time-only paths, andisCoalescedCrumbStillInEvidence(the O(ring)indexOfthe expiry sweep calls) is byte-identical to HEAD.Scope / collisions
Deliberately does not touch process-gone classification or suppression policy. Verified no overlap with open PRs #12484, #15251, #15059, #15294.
webContentsIdis added as a first-class optional field onProcessGoneCrashEventrather than stuffed into the untypeddetailsblob, so the internal Chromium id never reaches the persisted report or the user-facing copy-diagnostics text.