Skip to content

[libFuzzer] Add Windows merge watchdog config and stall-timeout helpers - #5679

Draft
Xeicker wants to merge 1 commit into
masterfrom
fix/win-merge-watchdog-1-config
Draft

Xeicker wants to merge 1 commit into
masterfrom
fix/win-merge-watchdog-1-config

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 calls _Exit(), which can deadlock in LdrShutdownProcess while unloading COM/Media DLLs. Because the outer merge process waits synchronously for that child to exit, corpus pruning hangs until the 22-hour outer merge timeout.

Fix Description

Adds the -merge_inner flag constant and the standalone flag-parsing, stall-timeout, and live file-size helpers in merge_watchdog.py. This PR is not wired into LibFuzzerRunner yet, so there is no runtime behavior change on its own.

Windows libFuzzer checks its per-unit alarm every (timeout // 2) + 1 seconds, so the stall threshold adds 30 seconds of exit headroom above that worst-case window with a 60-second floor for cold-start DLL loading. File length is queried with SEEK_END rather than os.path.getsize() because NTFS directory metadata can lag behind an active writer.

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.
  • 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