[compiler-rt] [ASan][Windows] Honor asan config flags on windows when set through the user function (PR #122990)
David Justo via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 27 16:56:57 PST 2025
================
@@ -390,17 +390,57 @@ void PrintAddressSpaceLayout() {
kHighShadowBeg > kMidMemEnd);
}
+// Apply most options specified either through the ASAN_OPTIONS
----------------
davidmrdavid wrote:
I took some time to investigate this.
Indeed, there's a **gap** - this PR does not handle the case where `ApplyFlags` is invoked while Asan is *deactivated*. In that case, when Asan is re-activation - the configuration that was "stashed away" during deactivation will override any options set in the interim (i.e any options set through the weak callback's invocation of `ApplyFlags``).
Naively speaking, `ApplyFlags` could check for this case, and temporarily activate ASan to do it's work, but that's actually quite expensive (requires re-initializing the allocator which does a whole pass over the memory map _afaict_) and other troublesome bits. For that reason, I'm hesitant to address it at this time.
There are less naive ways to solve this too, but they'd grow the scope of this PR a fair bit.
This PR does not make things worse in that area, it just does not address that pre-existing gap. For that reason, I'm curious if we could just document that as a gap (like #117925) and move forward with this fix, or if you'd prefer that it all be tackled in one go? Please let me know. In the meantime, I'll mark this as ready-for-review again.
https://github.com/llvm/llvm-project/pull/122990
More information about the llvm-commits
mailing list