Skip to content

[libFuzzer] Add Windows -merge_inner process discovery and tree termination helpers - #5680

Draft
Xeicker wants to merge 1 commit into
fix/win-merge-watchdog-1-configfrom
fix/win-merge-watchdog-2-process-tree
Draft

Xeicker wants to merge 1 commit into
fix/win-merge-watchdog-1-configfrom
fix/win-merge-watchdog-2-process-tree

Conversation

@Xeicker

@Xeicker Xeicker commented Nov 30, 2026

Copy link
Copy Markdown
Collaborator

Context

On Windows Server 2025, a libFuzzer -merge_inner child that hits a per-unit timeout can deadlock in LdrShutdownProcess while unloading COM/Media DLLs, leaving the outer merge process stuck until its 22-hour timeout. To recover safely, the watchdog must find the active -merge_inner child under the outer merge process and terminate only that child tree without hitting unrelated processes or recycled PIDs.

Fix Description

Adds process discovery and bottom-up process-tree termination helpers to merge_watchdog.py. This PR is not wired into LibFuzzerRunner yet, so there is no runtime behavior change on its own.

Discovery walks descendants of the outer merge process, skips cmd.exe shell intermediaries, matches any positive -merge_inner flag (1 for standard merge and 2 for set-cover merge, ignoring 0), and picks the top-most matched ancestor (tie-breaking by oldest create_time, then PID) so wrapper-launched targets are terminated as a unit. Termination kills descendants bottom-up using the inspected psutil.Process handles so psutil's create_time check prevents killing a reused PID.

Tests

  • Local checks: python butler.py format, python butler.py lint, pyright, and python butler.py py_unittest -t core -p merge_watchdog_test.py (2/2 passing).
  • Windows Server 2025 dev VM A/B test (the complete PR stack): reproduced the geolocation_element_css_fuzzer.exe shutdown deadlock on unpatched code (timed_out=True at 240.4s); with the watchdog enabled, the stalled -merge_inner child was terminated at 60.6s and the merge completed cleanly in 92.5s (rc=0, 3 valid units kept, 1 bad unit skipped, 0 orphans).
  • Live dev branch soak (the complete PR stack): running on Windows Server 2025 dev bots across real corpus_pruning merges with zero watchdog errors or false kills.

@Xeicker
Xeicker added this pull request to stack #5683 November 30, 2026 22:27

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant