Repository navigation
Debug build: native shutdown crashes with DCHECK failed: all_.empty() in browser_context.cc #4
Description
Activity
Discovered while building out the Coverage job in #2.
.azure/scripts/coverage.yml's test-run step is markedcontinueOnError: trueto work around this without hard-blocking the pipeline. Seeplan/findings.mdfor full details.- added a commit that references this issue
on Aug 29, 2026 Mitigated (not fixed) in #2: added a small coverage-only native hook (
CoverageTestHelper, only compiled in whenENABLE_COVERAGEis on) that calls__gcov_dump()immediately before the known-crashingCefApp.dispose()call, so CI can still capture real coverage data for everything that ran before the crash (verified: 72.gcdafiles now written,gcovrproduces a real 27% report). The crash itself still happens every time. Also tried increasing the shutdown message-pump count inContext::Shutdown()(10 -> 200 iterations with a delay) on the theory that it was just not waiting long enough -- did not help, reverted. This issue tracks the actual root cause, still open for a follow-up branch.Fixed in commit b7baff5 (branch
coverage/phase1-value-objects-phase2-handlers).Root cause:
CefRequestContext_N.getGlobalContextNative()leaked a native
CefRequestContextreference (and its underlyingCefBrowserContext) on
every browser after the first, wheneverCefRequestContext::GetGlobalContext()
returned a different native wrapper pointer than the one already cached --
found by pointing a ref/unref/gref trace analyzer at a live capture of the
crash instead of continuing to test architectural hypotheses.Verified 3/3 clean on the minimal repro, and on a real 151-test full-suite run
(151/169, 18 already-@disabled, 0 failed). Full writeup inplan/findings.md
andplan/roadmap.md's "MENTAL MODEL" section (this repo's localplan/
notes, not tracked in this GitHub repo).Duplicate of/same root cause as #23, closing both.
- added 16 commits that reference this issue
on Sep 1, 2026
Summary
In a Debug CMake build, CEF's native shutdown reliably crashes with:
(SIGTRAP, core dump).
DCHECKis compiled out in Release builds, which is presumably why this hasn't been noticed before -- most people build/ship Release. This is a general defect, not specific to any particular test: reproduced with a single JUnit test class and as few as 2 browser create/dispose cycles (ModifiedUtf8Testalone, 100% reproducible across multiple runs).Reproduction
Individual test logic completes successfully every time (confirmed via debug prints --
onBeforeClose/cleanupTest/awaitCompletion returnedall fire for every test before the crash). The DCHECK fires only in the final process-wideCefApp.dispose()/shutdown teardown, after every test has already finished cleanly.Impact
Blocks native coverage measurement (gcov/gcovr requires a Debug build for reliable instrumentation) -- see #2. Since the process is killed by the crash before any C++
atexithandler runs, coverage data (.gcdafiles) is never written, so no native coverage can currently be collected at all, independent of what a Debug build is used for.Environment