fix: enable HWASAN support in the runtime - #14742
Open
eric-wieser wants to merge 2 commits into
Open
Conversation
Lean's pointer packing conflicts with HWASAN allocator tagging on 64-bit machines due to top bit usage. Disable HWASAN allocator tagging around `malloc` for Lean objects in the default allocator. This allows Lean's pointer packing to coexist with HWASAN. Also enable LSAN utilities when HWASAN is active and update `LEAN_PTR_PACKING_SAFE` to assume HWASAN compatibility.
Contributor
Author
|
changelog-compiler |
|
Mathlib CI status (docs):
|
Collaborator
|
Reference manual CI status:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR allows Lean to be built with hwasan.
Lean's pointer packing conflicts with HWASAN allocator tagging on 64-bit machines due to top bit usage.
Previously we just disabled builds altogether in this configuration.
With this PR, we instead disable HWASAN allocator tagging around
mallocfor Lean objects in the default allocator.While this limits the usefulness of HWASAN for sanitization of lean itself, it at least means that larger applications that link Lean can still use hwasan on their own logic.
Also enable LSAN utilities when HWASAN is active and update
LEAN_PTR_PACKING_SAFEto indicate HWASAN compatibility.This partially addresses #13113.