[PATCH] D131415: Remove variable names from sanitize-memory-track-origins binary.

Kostya Serebryany via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 10 09:16:46 PDT 2022


kcc added a comment.

> 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.)
> An alternative I thought of was putting this behind a flag.

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'


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D131415/new/

https://reviews.llvm.org/D131415



More information about the llvm-commits mailing list