Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/137.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用泄漏消毒剂查找内存泄漏原因 我有一个使用TBB的C++程序,我在G64上编译了64位Linux。 当我使用地址消毒器(-fsanize=address)编译并运行单元测试时,会生成以下输出: ... [ PASSED ] 56 tests. ================================================================= ==12326==ERROR: LeakSanitizer: detected memory leaks Direct leak of 54 byte(s) in 3 object(s) allocated from: #0 0x7f4c634fd020 in strdup (/usr/lib64/libasan.so.3+0x58020) #1 0x301d215bb4 (/usr/lib64/libtbb.so.2+0x301d215bb4) SUMMARY: AddressSanitizer: 54 byte(s) leaked in 3 allocation(s). make[3]: *** [CMakeFiles/check] Error 1 make[2]: *** [CMakeFiles/check.dir/all] Error 2 make[1]: *** [CMakeFiles/check.dir/rule] Error 2 make: *** [check] Error 2_C++_Memory Leaks_Address Sanitizer - Fatal编程技术网

如何使用泄漏消毒剂查找内存泄漏原因 我有一个使用TBB的C++程序,我在G64上编译了64位Linux。 当我使用地址消毒器(-fsanize=address)编译并运行单元测试时,会生成以下输出: ... [ PASSED ] 56 tests. ================================================================= ==12326==ERROR: LeakSanitizer: detected memory leaks Direct leak of 54 byte(s) in 3 object(s) allocated from: #0 0x7f4c634fd020 in strdup (/usr/lib64/libasan.so.3+0x58020) #1 0x301d215bb4 (/usr/lib64/libtbb.so.2+0x301d215bb4) SUMMARY: AddressSanitizer: 54 byte(s) leaked in 3 allocation(s). make[3]: *** [CMakeFiles/check] Error 1 make[2]: *** [CMakeFiles/check.dir/all] Error 2 make[1]: *** [CMakeFiles/check.dir/rule] Error 2 make: *** [check] Error 2

如何使用泄漏消毒剂查找内存泄漏原因 我有一个使用TBB的C++程序,我在G64上编译了64位Linux。 当我使用地址消毒器(-fsanize=address)编译并运行单元测试时,会生成以下输出: ... [ PASSED ] 56 tests. ================================================================= ==12326==ERROR: LeakSanitizer: detected memory leaks Direct leak of 54 byte(s) in 3 object(s) allocated from: #0 0x7f4c634fd020 in strdup (/usr/lib64/libasan.so.3+0x58020) #1 0x301d215bb4 (/usr/lib64/libtbb.so.2+0x301d215bb4) SUMMARY: AddressSanitizer: 54 byte(s) leaked in 3 allocation(s). make[3]: *** [CMakeFiles/check] Error 1 make[2]: *** [CMakeFiles/check.dir/all] Error 2 make[1]: *** [CMakeFiles/check.dir/rule] Error 2 make: *** [check] Error 2,c++,memory-leaks,address-sanitizer,C++,Memory Leaks,Address Sanitizer,代码在编译时关闭了优化(-O0)并且-fno忽略了帧指针。如何获得有关泄漏的更多信息?泄漏发生在一个系统库中,该库可能在编译时未使用-fn忽略帧指针,因此Asan无法使用帧指针在其中展开。您可以尝试通过设置 # Or LSAN_OPTIONS, if you use standalone LSan export ASAN_OPTIONS=fast_unwind_on_malloc=0 有关运行时标志的更多详细信息,请参阅和 顺便说一句,您可以通过 # Or LSAN_OPTIONS, if y

代码在编译时关闭了优化(-O0)并且-fno忽略了帧指针。如何获得有关泄漏的更多信息?

泄漏发生在一个系统库中,该库可能在编译时未使用
-fn忽略帧指针
,因此Asan无法使用帧指针在其中展开。您可以尝试通过设置

# Or LSAN_OPTIONS, if you use standalone LSan
export ASAN_OPTIONS=fast_unwind_on_malloc=0
有关运行时标志的更多详细信息,请参阅和

顺便说一句,您可以通过

# Or LSAN_OPTIONS, if you use standalone LSan
export ASAN_OPTIONS=exitcode=0:...

你试过valgrid吗?很好@gsamaras我会试着看看valgrind是否返回更多信息。我试过在_malloc上禁用fast_unwind_并获得更多信息,但仍然不足以确定问题所在,似乎这也与pthread有关。我将不得不更多地研究它,但谢谢你给我的方向和我的问题的答案!