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

后端 未结 5 1799
囚心锁ツ
囚心锁ツ 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:24

    Sometimes using a symbolizer with a version number will give the error:

    ERROR: External symbolizer path is set to '/usr/bin/llvm-symbolizer-5.0' which isn't a known symbolizer. Please set the path to the llvm-symbolizer binary or other known tool.
    

    This can be fixed by pointing to an unadorned llvm-symbolizer binary:

    export ASAN_SYMBOLIZER_PATH=/usr/lib/llvm-5.0/bin/llvm-symbolizer
    

    Then ran your executable as you normally would.

提交回复
热议问题