MarshallOfSound

#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 = 1 builds, 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 truncated child_pool-*.profraw was 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; main win-arm64's latest profile is partially hit.
  • Mirror chrome/browser/lifetime/browser_shutdown.cc: at the start of Browser::Shutdown() call content::AskAllChildrenToDumpProfilingData() and run a nested loop until every child has flushed. Guarded by CLANG_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: a pgo-generation dispatch on this branch should yield 4 valid child_pool files for win-x64 with no file header is corrupt warnings in the Merge Profiles job.

Notes: none

Backports

42-x-y
Merged
PR Number
#53079
Merged At
Aug 21, 2026, 6:28:27 AM
Released In
Not yet
Release Date
Not yet
43-x-y
Merged
PR Number
#53081
Merged At
Aug 21, 2026, 7:11:10 AM
Released In
Not yet
Release Date
Not yet
44-x-y
Merged
PR Number
#53082
Merged At
Aug 21, 2026, 6:02:54 AM
Released In
Not yet
Release Date
Not yet

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