Fix two Chromium browser-process crashes (history embeddings CHECK, macOS --single-process) - #54
Open
goeric wants to merge 3 commits into
Open
Fix two Chromium browser-process crashes (history embeddings CHECK, macOS --single-process)#54goeric wants to merge 3 commits into
goeric wants to merge 3 commits into
Conversation
rodney's pinned Chromium (128.0.6568.0) is a development snapshot, and
those builds apply testing/variations/fieldtrial_testing_config.json by
default. That config force-enables features which are still being
written, and one of them takes the browser process down:
FATAL:history_embeddings_service.cc(597)] Check failed:
cached_embedding != embedding_cache.end()
HistoryEmbeddings computes passage embeddings on the browser's main
thread after a navigation, so the CHECK aborts the whole browser rather
than one tab. Every later rodney command then fails with "failed to
connect to browser (is it still running?)".
It only fires once the optimization guide has downloaded its on-device
model, which is why a long-lived ~/.rodney profile crashes within
seconds on a text-heavy page while a throwaway profile looks fine -- and
why this reads as "heavy commercial sites kill the browser".
Verified against a copy of a profile that reproduces it: 3/3 runs
crashed before this change, 0/4 after.
--disable-field-trial-config drops the testing config wholesale so
rodney drives a browser with shipped defaults. HistoryEmbeddings is
named explicitly as well, since a browser supplied through
ROD_CHROME_BIN can enable it from a server-side variations seed that the
switch does not cover.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
--single-process collapses Chromium's renderer, GPU and utility services
into the browser process. It was added so screenshots work under gVisor,
whose multi-process compositor IPC hangs (notes/gvisor-screenshots/), but
on macOS the collapse is fatal: media/capture's Apple backend CHECKs that
it owns a CFRunLoop-enabled thread, which only holds when video capture
has a utility process of its own.
FATAL:video_capture_device_factory_apple.mm(37)] Check failed: mode.
The MacOS video capture code must be run on a CFRunLoop-enabled thread
Any page that touches navigator.mediaDevices therefore kills the whole
browser. Device enumeration is routine in the fingerprinting scripts
commercial sites ship, so this reads as "complex sites crash Chromium".
Reproduces in one command on macOS, and stops reproducing with this
change:
rodney open https://example.com/
rodney js "navigator.mediaDevices.enumerateDevices().then(d=>d.length)"
gVisor is a Linux sandbox, so skipping the flag on Darwin costs nothing;
Linux and Windows behaviour is unchanged.
This overlaps PR simonw#45 by @flgusto, which diagnosed the same flag from
crash reports. Kept here so the branch is a complete fix; drop this
commit if simonw#45 lands first.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The doc argues for --single-process and is the reason the flag exists, so record why macOS no longer gets it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Chromium process rodney manages dies mid-session, after which every command
fails with
failed to connect to browser (is it still running?). It turned outto be two independent Chromium
CHECKfailures in the browser process, bothcaused by launch flags rodney chooses. 33 crash dumps on one macOS machine over
five days; both are fixed here.
Neither is a segfault —
EXC_BREAKPOINT/SIGTRAPin the browser process is adeliberate Chromium abort, so the browser takes itself down and there is nothing
to recover.
Root cause 1 — the field-trial testing config runs unfinished features
The pinned Chromium (128.0.6568.0, rod revision 1321438) is a development
snapshot, and those builds apply
testing/variations/fieldtrial_testing_config.jsonby default. Thatforce-enables features that are still being written.
HistoryEmbeddingsis one:it computes passage embeddings on the browser's main thread after each
navigation and CHECK-fails on a cache miss, so the whole browser aborts a few
seconds after a text-heavy page loads.
It needs the on-device model the optimization guide downloads, so it only starts
biting once a profile has been used for a while. That is why a long-lived
~/.rodneyprofile crashes reliably while a throwaway one looks fine — and whythis presents as "heavy commercial sites kill the browser". The command that
reports the failure is just the next one after the browser already died.
Fix:
--disable-field-trial-config, so rodney drives a browser with shippeddefaults rather than whatever was mid-flight when the snapshot was cut, plus an
explicit
--disable-features=HistoryEmbeddingsbecause a browser supplied viaROD_CHROME_BINcan enable it from a server-side variations seed that the switchdoes not cover.
Root cause 2 —
--single-processon macOS--single-process(added for gVisor screenshots,notes/gvisor-screenshots/)collapses the utility services into the browser process.
media/capture's Applebackend CHECKs that it owns a CFRunLoop-enabled thread, which only holds when
video capture has a utility process of its own.
Deterministic, one command on macOS:
Device enumeration is routine in the fingerprinting scripts commercial sites
ship, which is what makes it look load-related. gVisor is a Linux sandbox, so
skipping the flag on Darwin costs nothing; Linux and Windows are unchanged.
This overlaps #45 by @flgusto, which reached the same flag from crash
reports. It is included so the branch is a complete fix — drop commit 2 if #45
lands first.
The two are independent
Fixing only
--single-processstill crashes: with the flag already absent, aprofile that reproduces root cause 1 died 3/3 runs. Both fixes are needed.
Verification
Against a copy of a profile that reproduces the crash, driving real commercial
sites:
history_embeddingsCHECK (real profile)enumerateDevices()probe (macOS)Crash sites were confirmed two ways that agree exactly: symbolizing the
.ipsdumps by disassembling the stripped framework at the faulting return address to
recover the embedded
__FILE__/condition strings, and then capturing the sameFATAL:lines live on stderr from a reproduced crash.go build,go vetand the fullgo test ./...suite pass. Five unit testscover the flag selection, including that
--disable-featuresaccumulates ratherthan clobbers what rod and
configureExtensionsalready set.(Independent of #52 — these flags are on
mainand the earliest dumps predatethat branch.)
🤖 Generated with Claude Code