Skip to content

Pin handle_sigill and symbolize in Windows ASAN_OPTIONS - #5684

Open
Xeicker wants to merge 1 commit into
masterfrom
pin-win-asan-options
Open

Xeicker wants to merge 1 commit into
masterfrom
pin-win-asan-options

Conversation

@Xeicker

@Xeicker Xeicker commented Nov 30, 2026

Copy link
Copy Markdown
Collaborator

Problem

On Windows, a Chromium CHECK failure aborts with an illegal-instruction trap and prints Chromium's own DbgHelp stack trace first. Because DbgHelp output differs across Windows versions (Windows Server 2016 vs. 2025), that first stack causes crash states to drift across bots.

AddressSanitizer (ASan) on Windows defaults to handle_sigill=0 and symbolize=1. Without handle_sigill=1, ASan skips its report on CHECK crashes. Without symbolize=0, ASan symbolizes in-process with DbgHelp instead of leaving raw offsets for offline llvm-symbolizer.

During libFuzzer option minimization, ClusterFuzz tests removing each flag in ASAN_OPTIONS. Because Chromium's first stack keeps the crash state unchanged, minimization drops both flags and often stores {'ASAN_OPTIONS': {}} in testcase env metadata. Later replay tasks treat that empty dict as a signal to unset ASAN_OPTIONS instead of applying job defaults.

Fix

Pin handle_sigill=1 and symbolize=0 on Windows via a shared REQUIRED_WINDOWS_ASAN_OPTIONS constant (environment.py):

  • Skip removing handle_sigill and symbolize from ASAN_OPTIONS on Windows during libFuzzer option minimization (minimize_task.py). Other flags still minimize normally.
  • When loading stored testcase env metadata on Windows (setup.py), merge REQUIRED_WINDOWS_ASAN_OPTIONS into a copy of stored ASAN_OPTIONS after type validation and before the empty-dict check. Existing testcases with empty, partial, or conflicting maps regain both flags without mutating stored metadata.
  • If stored metadata applies another sanitizer variable (such as UBSAN_OPTIONS) without ASAN_OPTIONS on Windows, restore REQUIRED_WINDOWS_ASAN_OPTIONS after the loop. This fallback only runs when the job uses ASAN.

Compatibility & Verification

  • Non-Windows platforms and non-ASan Windows jobs have no behavior change.
  • Added unit tests in setup_test.py and minimize_task_test.py for Windows minimization and empty, partial, conflicting, and omitted ASAN_OPTIONS.
  • Verified locally with setup_test.py (42/42), minimize_task_test.py (20 run, 1 skipped), full core suite (2,741 run, 203 skipped, 0 failures), full appengine suite (842 run, 6 skipped; 1 transient datastore emulator port collision in grouper_test.py, which passed 24/24 standalone), butler.py format, and butler.py lint.

@Xeicker
Xeicker requested a review from a team as a code owner November 30, 2026 23:16

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