Skip to content

gh-156049: Add support for building with HWASAN - #156721

Open
StanFromIreland wants to merge 1 commit into
python:mainfrom
StanFromIreland:hwasan-support
Open

gh-156049: Add support for building with HWASAN#156721
StanFromIreland wants to merge 1 commit into
python:mainfrom
StanFromIreland:hwasan-support

Conversation

@StanFromIreland

@StanFromIreland StanFromIreland commented Aug 31, 2026

Copy link
Copy Markdown
Member

This supersedes GH-149166 and GH-156050, pulling in their changes and adding a --with-hwaddress-sanitizer configure option as well as a few little miscellaneous changes for better support. Note that x86-64 has to use clang's page aliasing
mode, which shares the heap across fork(), so the test suite is only reliable
on AArch64.

@AnnaAr321 and @fmayer I'd appreciate your reviews :-)

Co-authored-by: Florian Mayer <fmayer@google.com>
Co-authored-by: Anna <araslanova.anna.a@gmail.com>
@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #34314363 | 📁 Comparing 7b1be6e against main (d87ee27)

  🔍 Preview build  

3 files changed
± using/configure.html
± whatsnew/3.16.html
± whatsnew/changelog.html

Comment thread Doc/using/configure.rst
Enable HWAddressSanitizer memory error detector, ``hwasan`` (default is no).
Note that on x86-64 this uses `page aliasing
<https://clang.llvm.org/docs/HardwareAssistedAddressSanitizerDesign.html#supported-architectures>`_,
which only tags heap allocations and is unsafe for programs that ``fork()``,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think implicitly this means "Do not use on x86-64", right?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty much, you could try using it if you're careful (as such it's an option).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants