gopalshankar / address-sanitizer

Automatically exported from code.google.com/p/address-sanitizer
0 stars 0 forks source link

llvm-symbolizer does not see inlined functions #300

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
$ cat ../1.cc
#include <stdio.h>

void f() {
  int * volatile p = new int;
  if (*p)
    printf("zzz\n");
}

int main(void) {
  f();
  return 0;
}
$ bin/clang++ -O2 -g ../1.cc -fsanitize=memory -o 1
$ MSAN_SYMBOLIZER_PATH=bin/llvm-symbolizer ./1
==7082== WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x7f33c05fcc73 in main /code/llvm/build0/../1.cc:6
    #1 0x7f33bf17b76c in __libc_start_main /build/buildd/eglibc-2.15/csu/libc-start.c:226
    #2 0x7f33c05fca40 in _start (/code/llvm/build0/1+0x82a40)

Line number correctly points inside f() but function name is wrong. We used to 
have one more line in the stack with the same pc pointing to f(), right?

Original issue reported on code.google.com by euge...@google.com on 25 Apr 2014 at 9:39

GoogleCodeExporter commented 9 years ago
I blame Clang's debug info for that. Let me verify it and file a Clang bug 
report.

Original comment by samso...@google.com on 25 Apr 2014 at 6:51

GoogleCodeExporter commented 9 years ago
http://llvm.org/bugs/show_bug.cgi?id=19563

Original comment by samso...@google.com on 25 Apr 2014 at 7:12

GoogleCodeExporter commented 9 years ago
Confirmed fixed in http://llvm.org/bugs/show_bug.cgi?id=19563.

    #0 0x7fa1704dc843 in f() /code/llvm/build0/../1.cc:6
    #1 0x7fa1704dc843 in main /code/llvm/build0/../1.cc:11
    #2 0x7fa16f05876c in __libc_start_main /build/buildd/eglibc-2.15/csu/libc-start.c:226
    #3 0x7fa1704dc610 in _start (/code/llvm/build0/1+0x85610

Original comment by euge...@google.com on 28 Apr 2014 at 7:39