Clang++'s leak sanitizer claims I have a memory leak in one of my unit tests. I'm inclined to believe it, but I can't find it by inspection.
I'm compiling with the following options:
/usr/bin/clang++ -std=c++14 -g -Wall -Wextra -pedantic -O0 -fuse-ld=gold -fsanitize=address
I get output looking like
=================================================================
==8611==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 8 byte(s) in 1 object(s) allocated from:
#0 0x54a650 (~/tmp/tests/utest-...+0x54a650)
#1 0x61bfc9 (~/tmp/tests/utest-...+0x61bfc9)
#2 0x55242f (~/tmp/tests/utest-...+0x55242f)
#3 0x550a01 (~/tmp/tests/utest-...+0x550a01)
#4 0x54f928 (~/tmp/tests/utest-...+0x54f928)
#5 0x5706fa (~/tmp/tests/utest-...+0x5706fa)
#6 0x55b8d9 (~/tmp/tests/utest-...+0x55b8d9)
#7 0x5e0914 (~/tmp/tests/utest-...+0x5e0914)
#8 0x5deae8 (~/tmp/tests/utest-...+0x5deae8)
#9 0x5c8bde (~/tmp/tests/utest-...+0x5c8bde)
#10 0x5b23fa (~/tmp/tests/utest-...+0x5b23fa)
#11 0x5a1ee9 (~/tmp/tests/utest-...+0x5a1ee9)
#12 0x56dcdf (~/tmp/tests/utest-...+0x56dcdf)
#13 0x566d57 (~/tmp/tests/utest-...+0x566d57)
#14 0x7f9fb622e60f (/usr/lib/libc.so.6+0x2060f)
(with unimportant information removed).
The problem with the above output is that I get memory addresses instead of file and line numbers so that I can figure out what is being leaked!
According to Chandler Carruth of Clang at Google fame, enabling debugging output ('-g') should cause the memory addresses in the stack trace to be replaced by file and line numbers. (You can specifically see him apply that here.) As you can see from my compile flags, I am emitting debug info.
Any idea what I may be neglecting?