Skip to content

[libFuzzer] Wire WindowsMergeWatchdog into LibFuzzerRunner._run_merge - #5682

Draft
Xeicker wants to merge 1 commit into
fix/win-merge-watchdog-3-watchdogfrom
fix/win-merge-watchdog-4-wire-runner
Draft

Xeicker wants to merge 1 commit into
fix/win-merge-watchdog-3-watchdogfrom
fix/win-merge-watchdog-4-wire-runner

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, causing LibFuzzerRunner.merge() to hang until the 22-hour outer merge timeout.

Fix Description

Extracts a _run_merge() hook on LibFuzzerCommon and overrides it in LibFuzzerRunner to run Windows merges under WindowsMergeWatchdog.

On non-Windows platforms, or when psutil is unavailable or no positive -timeout flag is present in the effective merge arguments, LibFuzzerRunner._run_merge() delegates directly to super()._run_merge(). Otherwise it starts the outer merge process under WindowsMergeWatchdog, stops the watchdog before killing the outer process if interrupted, and preserves Unicode output decoding.

Tests

  • Local checks: python butler.py format, python butler.py lint, pyright, python butler.py py_unittest -t core -p merge_watchdog_test.py (6/6 passing, including the real-subprocess end-to-end recovery test), and python butler.py py_unittest -t core -p libfuzzer_test.py (14/14 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