#53066: fix: wait for child processes to dump PGO profiles before shutdown
Merged
Created: Aug 21, 2026, 2:12:40 AM
Merged: Aug 21, 2026, 4:57:06 AM
5 comments
Target: main
Root-cause fix for the corrupt profraw files behind microsoft/vscode#331672 (see #53064 for the 42-x-y profile restore and #53065 for the merge gate).
- In
chrome_pgo_phase = 1builds, sandboxed children write their counters through a file handle the browser hands them (CLANG_PROFILING_INSIDE_SANDBOX), and only do so when asked or on clean exit. Electron never asked:app.quit()quit the main loop, the sandbox job object killed any child still writing, and the truncatedchild_pool-*.profrawwas dropped at merge. The loser is usually the benchmark renderer, so Blink ends up cold in the published profile. 42-x-y win-x64 lost this race 3/3 runs since 2026-08-02;mainwin-arm64's latest profile is partially hit. - Mirror
chrome/browser/lifetime/browser_shutdown.cc: at the start ofBrowser::Shutdown()callcontent::AskAllChildrenToDumpProfilingData()and run a nested loop until every child has flushed. Guarded byCLANG_PROFILING_INSIDE_SANDBOX && CLANG_PGO_PROFILING, so it compiles out of every shipping build. - Verified the TU compiles with the current tree both with the flags off and with them forced on (object then references
AskAllChildrenToDumpProfilingData). End-to-end check: apgo-generationdispatch on this branch should yield 4 validchild_poolfiles for win-x64 with nofile header is corruptwarnings in the Merge Profiles job.
Notes: none
Backports
Semver Impact
Major
Breaking changes
Minor
New features
Patch
Bug fixes
None
Docs, tests, etc.
Semantic Versioning helps users understand the impact of updates:
- Major (X.y.z): Breaking changes that may require code modifications
- Minor (x.Y.z): New features that maintain backward compatibility
- Patch (x.y.Z): Bug fixes that don't change the API
- None: Changes that don't affect using facing parts of Electron