Skip to content

Add Windows (clang-cl) support for continuous fuzzing#1994

Merged
copybara-service[bot] merged 3 commits intogoogle:mainfrom
posidron:windows-coverage-support
Mar 18, 2026
Merged

Add Windows (clang-cl) support for continuous fuzzing#1994
copybara-service[bot] merged 3 commits intogoogle:mainfrom
posidron:windows-coverage-support

Conversation

@posidron
Copy link
Contributor

Summary

Enable continuous fuzzing (--fuzz=) on Windows with clang-cl.

Problem

FuzzTest's continuous fuzzing mode fails on Windows with:

Despite clang-cl correctly applying -fsanitize-coverage=inline-8bit-counters and the __sanitizer_cov_8bit_counters_init callback firing, the coverage data is never used because FUZZTEST_COVERAGE_IS_AVAILABLE excludes _WIN32.

CorpusCoverage::Update() compiles as a stub returning false on Windows, so the fuzzer never considers any input as providing new coverage.

Changes

  1. Add defined(_WIN32) to the FUZZTEST_COVERAGE_IS_AVAILABLE guard - clang-cl supports the same sanitizer coverage instrumentation as clang on Linux/macOS.

  2. Use _aligned_malloc/_aligned_free on Windows — the MSVC CRT does not provide std::aligned_alloc. Memory allocated with _aligned_malloc must be freed with _aligned_free (not std::free).

@google-cla
Copy link

google-cla bot commented Feb 28, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@posidron posidron force-pushed the windows-coverage-support branch 3 times, most recently from 976dcec to b983b49 Compare February 28, 2026 06:55
@posidron posidron requested a review from fniksic March 15, 2026 04:38
@posidron
Copy link
Contributor Author

@fniksic How can we merge this? I noticed you are red for the CLA.

@fniksic
Copy link
Collaborator

fniksic commented Mar 17, 2026

@fniksic How can we merge this? I noticed you are red for the CLA.

The CLA check fails because after you incorporated my suggested fix, GitHub added me as a co-author using my private email instead of my Google email. Since I'm a Google employee, I can't really sign the CLA in the same way, so I can't fix it that way.

Can you remove me as a co-author? See these instructions: https://github.com/orgs/community/discussions/76660#discussioncomment-7649637

@posidron posidron force-pushed the windows-coverage-support branch from cb17c86 to fb1f458 Compare March 18, 2026 06:20
@posidron
Copy link
Contributor Author

@fniksic Thank you. Ready for merge. :)

@copybara-service copybara-service bot merged commit 3874258 into google:main Mar 18, 2026
18 checks passed
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.

2 participants