Code simular to code here: Why tcmalloc don't print function name, which provided via dlopen
makefile:
- all:
- g++ -fPIC -g -c shared.cpp -ltcmalloc
- g++ -shared -o shared_libs/libshared.so -g shared.o -ltcmalloc
- g++ -L shared_libs/ -g main.cpp -ldl -ltcmalloc
When I execute my program:
$ HEAPCHECK=normal ./a.out
No live heap object at 0x2582aa0 to ignore
Check failed: heap_profile->FindAlloc(test_str, &size): our own new/delete not linked?
Aborted (core dumped)
gdb with core file says:
Core was generated by `./a.out'.
Program terminated with signal SIGABRT, Aborted.
#0 0x00007f51bfef6cc9 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
Traceback (most recent call last):
File "/usr/share/gdb/auto-load/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.19-gdb.py", line 63, in <module>
from libstdcxx.v6.printers import register_libstdcxx_printers
ImportError: No module named 'libstdcxx'