How do I get line numbers in the debug output with clang's -fsanitize=address?

后端 未结 5 1855
囚心锁ツ
囚心锁ツ 2021-02-05 18:02

I am trying to debug a memory error detected by clang with asan, but missed by valgrind. But I cannot get my clang built bina

5条回答
  •  不要未来只要你来
    2021-02-05 18:11

    For me, there is no llvm-symbolizer in /usr/bin, I need to first use

    sudo ln -s /usr/bin/llvm-symbolizer-3.8 /usr/bin/llvm-symbolizer
    

    to create the symbolizer and then add it to the PATH:

    ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer ./test
    

提交回复
热议问题