This is an archive of the discontinued LLVM Phabricator instance.

[asan] -fsanitize-address-outline-instrumentation -> -asan-max-inline-poisoning-size=0
Needs RevisionPublic

Authored by rsundahl on Nov 14 2022, 3:23 PM.

Details

Summary

The clang flag -fsanitize-address-outline-instrumentation should not only pass
-asan-instrumentation-with-call-threshold=0 to the sanitizer, but should also
pass -asan-max-inline-poisoning-size=0. Both flags' cutoff values need to be set
to zero to suppress inlining in favor of making calls into compiler-rt.

Diff Detail

Event Timeline

rsundahl created this revision.Nov 14 2022, 3:23 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 14 2022, 3:23 PM
rsundahl requested review of this revision.Nov 14 2022, 3:23 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 14 2022, 3:23 PM
rsundahl updated this revision to Diff 475497.Nov 15 2022, 8:41 AM

Removed extraneous blank line.

vitalybuka added inline comments.
clang/lib/Driver/SanitizerArgs.cpp
1256

CC @kstoimenov

it's maybe not the best name for flag, but the point of AsanOutlineInstrumentation was to reduce binary size.

for -asan-instrumentation-with-call-threshold=0 sizeof(check+asan_report) > sizeof(outlined_check_report), so it helps with size
for -asan-max-inline-poisoning-size=0: usually sizeof(small store/load) < sizeof(poisoning_callbac). It usually increases the size.

Out internal setup expects the current size saving behavior of this flag.

So to move forward we can do the following instead:

  1. Create a new flag for -asan-max-inline-poisoning-size=0, e.g. AsanOutlinePoisoning
  2. Create a clone flag for -asan-instrumentation-with-call-threshold=0, e.g. AsanOutlineChecks
  3. We switch out build system to the clone
  4. Extend (or delete) AsanOutlineInstrumentation as in this patch
1260

For changes like this we need to update llvm-project/clang/test/Driver/fsanitize.c

vitalybuka requested changes to this revision.Dec 7 2022, 1:59 PM
This revision now requires changes to proceed.Dec 7 2022, 1:59 PM