Skip to content

[libFuzzer] Add WindowsMergeWatchdog monitor and 3-kill circuit breaker - #5681

Draft
Xeicker wants to merge 1 commit into
fix/win-merge-watchdog-2-process-treefrom
fix/win-merge-watchdog-3-watchdog
Draft

Xeicker wants to merge 1 commit into
fix/win-merge-watchdog-2-process-treefrom
fix/win-merge-watchdog-3-watchdog

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 blocked until its 22-hour timeout. Because libFuzzer appends progress to its merge control file as inputs run, a stalled child can be distinguished from a healthy long-running merge by watching whether the control file stops growing past the per-unit stall threshold.

Fix Description

Adds WindowsMergeWatchdog, a context manager that polls the outer merge process tree every 2 seconds on a daemon thread and tracks live merge control file growth for the active -merge_inner child. This PR is not wired into LibFuzzerRunner yet, so there is no runtime behavior change on its own.

If the control file does not grow for compute_stall_timeout(unit_timeout) seconds and the outer process is still running, the watchdog terminates the stalled -merge_inner tree so the outer merge can continue with the next attempt. Missing or temporarily unreadable control files are treated as fail-safe (never killed), and a circuit breaker stops the watchdog after 3 consecutive kills with no control-file growth (allowing two retries for cold-start loading while preventing unbounded kill loops on a permanently stuck initializer).

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 (5/5 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