在我的代码之一中,泄漏清除程序报告了一些间接泄漏,但是缺少完整的堆栈跟踪,因此我无法找到泄漏的实际位置。我需要知道泄漏的确切位置,以便我可以修复它或抑制它(如果在外部库中) 我得到的报告正在关注
* =============================================== ==================
==10166==ERROR: LeakSanitizer: detected memory leaks
Indirect leak of 1586 byte(s) in 29 object(s) allocated from:
#0 0x59fb52 in operator new(unsigned long) /local/mnt/workspace/bcain_0721/llvm/utils/release/final/llvm.src/projects/compiler-rt/lib/asan/asan_new_delete.cc:92:3
#1 0x7f3700728918 in __gnu_cxx::new_allocator<char>::allocate(unsigned long, void const*) /local/scratch/ejseado/working/gcc-7.3.0-build/x86_64-pc-linux-gnu/libstdc++-v3/include/ext/new_allocator.h:111
#2 0x7f3700728918 in std::string::_Rep::_S_create(unsigned long, unsigned long, std::allocator<char> const&) /local/scratch/ejseado/working/gcc-7.3.0-build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/basic_string.tcc:1057
Indirect leak of 59 byte(s) in 1 object(s) allocated from:
#0 0x59fb52 in operator new(unsigned long) /local/mnt/workspace/bcain_0721/llvm/utils/release/final/llvm.src/projects/compiler-rt/lib/asan/asan_new_delete.cc:92:3
#1 0x7f3700728918 in __gnu_cxx::new_allocator<char>::allocate(unsigned long, void const*) /local/scratch/ejseado/working/gcc-7.3.0-build/x86_64-pc-linux-gnu/libstdc++-v3/include/ext/new_allocator.h:111
#2 0x7f3700728918 in std::string::_Rep::_S_create(unsigned long, unsigned long, std::allocator<char> const&) /local/scratch/ejseado/working/gcc-7.3.0-build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/basic_string.tcc:1057
#3 0x60f000a8672f (<unknown module>)
Indirect leak of 59 byte(s) in 1 object(s) allocated from:
#0 0x59fb52 in operator new(unsigned long) /local/mnt/workspace/bcain_0721/llvm/utils/release/final/llvm.src/projects/compiler-rt/lib/asan/asan_new_delete.cc:92:3
#1 0x7f3700728918 in __gnu_cxx::new_allocator<char>::allocate(unsigned long, void const*) /local/scratch/ejseado/working/gcc-7.3.0-build/x86_64-pc-linux-gnu/libstdc++-v3/include/ext/new_allocator.h:111
#2 0x7f3700728918 in std::string::_Rep::_S_create(unsigned long, unsigned long, std::allocator<char> const&) /local/scratch/ejseado/working/gcc-7.3.0-build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/basic_string.tcc:1057
#3 0x7ffd510f463f ([stack]+0x5d63f)
-------------------------------------------------- ------ *
我尝试使用以下选项
setenv ASAN_OPTIONS fast_unwind_on_malloc = 0
但是所有的泄漏消失了,而文档说应该给出详细的堆栈跟踪
有人可以帮我吗?
谢谢