0

如何在 clang address sanitizer 中找到直接泄漏的地址。例如,如果它返回

Direct leak of 32 byte(s) in 1 object(s) allocated from:                                                                                                                                                           
    #0 0x40926f in operator new(unsigned long) (/home/sg/Downloads/main+0x40926f)                                                                                                                                  
    #1 0x428f31 in AvlTree::insert(AvlTree::Node*, int) /home/sg/Downloads/main.cpp:161:16                                                                                                                         
    #2 0x428fbf in AvlTree::insert(AvlTree::Node*, int) /home/sg/Downloads/main.cpp:170:23                                                                                                                         
    #3 0x428e4d in AvlTree::Insert(int) /home/sg/Downloads/main.cpp:152:16                                                                                                                                         
    #4 0x4293f0 in main /home/sg/Downloads/main.cpp:302:13                                                                                                                                                         
    #5 0x7f67dd56b82f in __libc_start_main /build/glibc-bfm8X4/glibc-2.23/csu/../csu/libc-start.c:291                                                                                                              

Direct leak of 32 byte(s) in 1 object(s) allocated from:                                                                                                                                                           
    #0 0x40926f in operator new(unsigned long) (/home/sg/Downloads/main+0x40926f)                                                                                                                                  
    #1 0x428f31 in AvlTree::insert(AvlTree::Node*, int) /home/sg/Downloads/main.cpp:161:16                                                                                                                         
    #2 0x428f9e in AvlTree::insert(AvlTree::Node*, int) /home/sg/Downloads/main.cpp:166:22                                                                                                                         
    #3 0x428f9e in AvlTree::insert(AvlTree::Node*, int) /home/sg/Downloads/main.cpp:166:22                                                                                                                         
    #4 0x428e4d in AvlTree::Insert(int) /home/sg/Downloads/main.cpp:152:16                                                                                                                                         
    #5 0x4293f0 in main /home/sg/Downloads/main.cpp:302:13                                                                                                                                                         
    #6 0x7f67dd56b82f in __libc_start_main /build/glibc-bfm8X4/glibc-2.23/csu/../csu/libc-start.c:291                                                                                                              

SUMMARY: LeakSanitizer: 64 byte(s) leaked in 2 allocation(s).

我怎么知道这些泄漏的地址?

4

0 回答 0