This work is being done to reduce the size of MSAN with track origins binary.
Builds upon: https://reviews.llvm.org/D131205
Paths
| Differential D131415
Remove function name from sanitize-memory-track-origins binary. ClosedPublic Authored by kda on Aug 8 2022, 10:18 AM.
Details Summary This work is being done to reduce the size of MSAN with track origins binary. Builds upon: https://reviews.llvm.org/D131205
Diff Detail
Unit TestsFailed Event TimelineHerald added projects: Restricted Project, Restricted Project. · View Herald TranscriptAug 8 2022, 10:18 AM Comment Actions Refactor to address function changes and print generic message regarding location of uninitialized stack variable. Comment Actions please show an error message on a non-trivial test case Comment Actions
Where can I get the name of the variable? (I think it is buried in the debug info some place, but I would need an example to help me extract it.) Comment Actions
Not sure I understand the question. MSan gets the variable names today just fine: % cat stack-uninit.c void bar(int *a) {} int main() { int foo; bar(&foo); if (foo) return 42; return 0; } % clang -g -fsanitize=memory -fsanitize-memory-track-origins stack-uninit.c && ./a.out ==389328==WARNING: MemorySanitizer: use-of-uninitialized-value ... Uninitialized value was created by an allocation of 'foo' in the stack frame of function 'main' Comment Actions
Absolutely. And this change will remove foo and main from the global. Uninitialized value was created on the stack (first frame below should reference the variable) I believe that foo is somewhere else in the binary, but I don't know the code which would be required to draw it out and display it in the message.
kda retitled this revision from Remove variable names from sanitize-memory-track-origins binary. to Remove function name from sanitize-memory-track-origins binary..Aug 10 2022, 11:20 AM This revision is now accepted and ready to land.Aug 10 2022, 11:26 AM
Comment Actions dropping the function name is fine, we have it from the stack traces. This revision was landed with ongoing or failed builds.Aug 10 2022, 3:45 PM Closed by commit rG057cabd997ae: Remove function name from sanitize-memory-track-origins binary. (authored by kda). · Explain Why This revision was automatically updated to reflect the committed changes. kda added a child revision: D131631: [MSAN] Separate id ptr from constant string for variable names used in track origins..Aug 11 2022, 1:49 PM kda added a parent revision: D131205: Desist from passing function location to __msan_set_alloca_origin4..
Revision Contents
Diff 451659 compiler-rt/lib/msan/msan_report.cpp
compiler-rt/test/msan/chained_origin.cpp
compiler-rt/test/msan/chained_origin_empty_stack.cpp
compiler-rt/test/msan/chained_origin_memcpy.cpp
compiler-rt/test/msan/chained_origin_memmove.cpp
compiler-rt/test/msan/msan_print_shadow.cpp
compiler-rt/test/msan/report-demangling.cpp
compiler-rt/test/msan/select_origin.cpp
compiler-rt/test/msan/stack-origin.cpp
compiler-rt/test/msan/stack-origin2.cpp
compiler-rt/test/msan/unaligned_read_origin.cpp
compiler-rt/test/msan/vararg.cpp
llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
|
It technically not the stack, just a frame.
Shorter message like this has the same meaning:
"Uninitialized value was created here:"