when use valgrind to check memory leaks, I encoute开发者_JS百科r a very strange problem. On 32bit linux, the leak stack infos are very clear like:
==10650== by 0x8130FD3: SFNTSetContactServer ==10650== by 0x81106CA: CLibLicense::GetOneLicense(std::string&, void*&) ==10650== by 0x81108C2: CLibLicense::StartingGet(void*&) ==10650== by 0x810F01A: CLibLicense::GetLicense() ==10650== by 0x810DEBB: CLicenseManager::DoGetLicense(void*, unsigned int)
But on x64 linux, I can only get ??? infos like this:
==31031== 8 bytes in 1 blocks are definitely lost in loss record 196 of 2,210 ==31031== at 0x4A0646F: malloc (vg_replace_malloc.c:236) ==31031== by 0x46AF78: ??? (in /opt/usr/local/sbin/Server) ==31031== by 0x46B016: ??? (in /opt/usr/local/sbin/Server) ==31031== by 0x421F99: ??? (in /opt/usr/local/sbin/Server) ==31031== by 0x42C240: ??? (in /opt/usr/local/sbin/Server) ==31031== by 0x42D731: ??? (in /opt/usr/local/sbin/Server) ==31031== by 0x42FC65: ??? (in /opt/usr/local/sbin/Server) ==31031== by 0x465C01: ??? (in /opt/usr/local/sbin/Server) ==31031== by 0x463DB6: ??? (in /opt/usr/local/sbin/Server) ==31031== by 0x3116A1D993: (below main) (in /lib64/libc-2.5.so)
The program doesn't use dlopen/dlclose as the valgrind FAQ said.
update 1, add file stat infos
file Server Server: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9, not stripped
any comments are welcome!
Well it looks like you have stripped the symbols from your program.
精彩评论