Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve MSAN under JIT #7059

Merged
merged 1 commit into from
Oct 6, 2022
Merged

Improve MSAN under JIT #7059

merged 1 commit into from
Oct 6, 2022

Conversation

steven-johnson
Copy link
Contributor

@steven-johnson steven-johnson commented Oct 4, 2022

Running JIT code under MSAN is (still) not officially supported, as it can (and does) give false positives; that said, this PR reduces the false positives in some cases.

Specifically:
(1) if we are building a JIT shared runtime (ie, we are jitting), and we are compiling with MSAN enabled (detected via preprocessor), we should always use the real MSAN stubs, even if the Target::MSan feature has been cleared (because JITModule::make_module() clears it).
(2) Target::get_jit_from_environment() should add any detected sanitizer bits to the target sniffed from HL_JIT_TARGET

Running JIT code under MSAN is (still) not officially supported, as it can (and does) give false positives; that said, this PR reduces the false positives in some cases.

Specifically:
(1) if we are building a JIT shared runtime (ie, we are jitting), and we are compiling with MSAN enabled (detected via preprocessor), we should always use the real MSAN stubs, even if the Target::MSan feature has been cleared (because JITModule::make_module() clears it).
(2) Target::get_jit_from_environment() should add any detected sanitizer bits to the target sniffed from HL_JIT_TARGET
@steven-johnson
Copy link
Contributor Author

Gentle review ping

@abadams
Copy link
Member

abadams commented Oct 5, 2022

This is for when the Halide compiler itself is compiled under a sanitizer and you're executing JIT-compiled code? I'm surprised that works at all.

@steven-johnson steven-johnson merged commit f360427 into main Oct 6, 2022
@steven-johnson steven-johnson deleted the srj/msan-jit branch October 6, 2022 17:21
ardier pushed a commit to ardier/Halide-mutation that referenced this pull request Mar 3, 2024
Running JIT code under MSAN is (still) not officially supported, as it can (and does) give false positives; that said, this PR reduces the false positives in some cases.

Specifically:
(1) if we are building a JIT shared runtime (ie, we are jitting), and we are compiling with MSAN enabled (detected via preprocessor), we should always use the real MSAN stubs, even if the Target::MSan feature has been cleared (because JITModule::make_module() clears it).
(2) Target::get_jit_from_environment() should add any detected sanitizer bits to the target sniffed from HL_JIT_TARGET
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