no symbol names when use sanitizer ?

Hi all,
I follow this page http://clang.llvm.org/docs/MemorySanitizer.html to play the sanitizer, but the output of the example does not have symbol names.

$ cat umr.cc
#include <stdio.h>

int main(int argc, char** argv) {
int* a = new int[10];
a[5] = 0;
if (a[argc])
printf(“xx\n”);
return 0;
}

$ clang -fsanitize=memory -fno-omit-frame-pointer -g -O2 umr.cc

$ ./a.out
==22181== WARNING: MemorySanitizer: use-of-uninitialized-value
#0 0x7fde2aa395f6 (/home/jianjun/tmp/a.out+0x7d5f6)
#1 0x7fde298bd76c (/lib/x86_64-linux-gnu/libc.so.6+0x2176c)
#2 0x7fde2aa3941c (/home/jianjun/tmp/a.out+0x7d41c)

SUMMARY: MemorySanitizer: use-of-uninitialized-value ??:0 ??
Exiting

OS: ubuntu 12.04lts x86_64

$ clang -fsanitize=memory -fno-omit-frame-pointer -g -O2 umr.cc -v

Ubuntu clang version 3.5-1~exp1 (trunk) (based on LLVM 3.5)
Target: x86_64-pc-linux-gnu
Thread model: posix
Found candidate GCC installation: /usr/bin/…/lib/gcc/i686-linux-gnu/4.8
Found candidate GCC installation: /usr/bin/…/lib/gcc/i686-linux-gnu/4.8.1
Found candidate GCC installation: /usr/bin/…/lib/gcc/x86_64-linux-gnu/4.6
Found candidate GCC installation: /usr/bin/…/lib/gcc/x86_64-linux-gnu/4.6.3
Found candidate GCC installation: /usr/bin/…/lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/bin/…/lib/gcc/x86_64-linux-gnu/4.8.1
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.8.1
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6.3
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.1
Selected GCC installation: /usr/bin/…/lib/gcc/x86_64-linux-gnu/4.8
“/usr/bin/clang” -cc1 -triple x86_64-pc-linux-gnu -emit-obj -disable-free -disable-llvm-verifier -main-file-name tst.cc -mrelocation-model pic -pic-level 2 -pie-level 2 -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64 -target-linker-version 2.22 -momit-leaf-frame-pointer -v -g -resource-dir /usr/bin/…/lib/clang/3.5 -internal-isystem /usr/bin/…/lib/gcc/x86_64-linux-gnu/4.8/…/…/…/…/include/c++/4.8 -internal-isystem /usr/bin/…/lib/gcc/x86_64-linux-gnu/4.8/…/…/…/…/include/c++/4.8/x86_64-linux-gnu -internal-isystem /usr/bin/…/lib/gcc/x86_64-linux-gnu/4.8/…/…/…/…/include/c++/4.8/backward -internal-isystem /usr/bin/…/lib/gcc/x86_64-linux-gnu/4.8/…/…/…/…/include/x86_64-linux-gnu/c++/4.8 -internal-isystem /usr/local/include -internal-isystem /usr/bin/…/lib/clang/3.5/include -internal-externc-isystem /usr/bin/…/lib/gcc/x86_64-linux-gnu/4.8/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -fdeprecated-macro -fdebug-compilation-dir /home/jianjun/tmp -ferror-limit 19 -fmessage-length 0 -fsanitize=memory -fno-assume-sane-operator-new -mstackrealign -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -vectorize-loops -vectorize-slp -o /tmp/tst-8d6366.o -x c++ tst.cc
clang -cc1 version 3.5 based upon LLVM 3.5 default target x86_64-pc-linux-gnu
ignoring nonexistent directory “/usr/bin/…/lib/gcc/x86_64-linux-gnu/4.8/…/…/…/…/include/c++/4.8/x86_64-linux-gnu”
ignoring nonexistent directory “/include”
#include “…” search starts here:
#include <…> search starts here:
/usr/bin/…/lib/gcc/x86_64-linux-gnu/4.8/…/…/…/…/include/c++/4.8
/usr/bin/…/lib/gcc/x86_64-linux-gnu/4.8/…/…/…/…/include/c++/4.8/backward
/usr/bin/…/lib/gcc/x86_64-linux-gnu/4.8/…/…/…/…/include/x86_64-linux-gnu/c++/4.8
/usr/local/include
/usr/bin/…/lib/clang/3.5/include
/usr/bin/…/lib/gcc/x86_64-linux-gnu/4.8/include
/usr/include/x86_64-linux-gnu
/usr/include
End of search list.
“/usr/bin/ld” -whole-archive /usr/bin/…/lib/clang/3.5/lib/linux/libclang_rt.msan-x86_64.a -no-whole-archive -pie -z relro --hash-style=gnu --build-id --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o a.out /usr/bin/…/lib/gcc/x86_64-linux-gnu/4.8/…/…/…/x86_64-linux-gnu/Scrt1.o /usr/bin/…/lib/gcc/x86_64-linux-gnu/4.8/…/…/…/x86_64-linux-gnu/crti.o /usr/bin/…/lib/gcc/x86_64-linux-gnu/4.8/crtbeginS.o -L/usr/bin/…/lib/gcc/x86_64-linux-gnu/4.8 -L/usr/bin/…/lib/gcc/x86_64-linux-gnu/4.8/…/…/…/x86_64-linux-gnu -L/lib/x86_64-linux-gnu -L/lib/…/lib64 -L/usr/lib/x86_64-linux-gnu -L/usr/bin/…/lib/gcc/x86_64-linux-gnu/4.8/…/…/… -L/lib -L/usr/lib /tmp/tst-8d6366.o -lpthread -lrt -ldl -lm -export-dynamic -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/bin/…/lib/gcc/x86_64-linux-gnu/4.8/crtendS.o /usr/bin/…/lib/gcc/x86_64-linux-gnu/4.8/…/…/…/x86_64-linux-gnu/crtn.o

Anything wrong with my compilation and linkage?

Thanks,
Jianjun.

I follow this page http://clang.llvm.org/docs/MemorySanitizer.html to

> play the sanitizer, but the output of the example does not have symbol
> names.

Have a look at llvm-symbolizer: http://code.google.com/p/address-sanitizer/wiki/CallStack

-Y

Thank you Yury.
OK I know the problem now, I need to use asan_symbolize(in fact addr2line) to find symbols.