最近我用valgrind调试了一些应用程序,但从dlopen
中得到的报告非常奇怪。
==1987== 32 bytes in 1 blocks are still reachable in loss record 1 of 2
==1987== at 0x4C24477: calloc (vg_replace_malloc.c:418)
==1987== by 0x570F31F: _dlerror_run (dlerror.c:142)
==1987== by 0x570EEE0: dlopen@@GLIBC_2.2.5 (dlopen.c:88)
<my call to dlopen>
==1987==
==1987== 264 bytes in 1 blocks are still reachable in loss record 2 of 2
==1987== at 0x4C25153: malloc (vg_replace_malloc.c:195)
==1987== by 0x400CD44: _dl_map_object_deps (dl-deps.c:506)
==1987== by 0x4012DA2: dl_open_worker (dl-open.c:326)
==1987== by 0x400E385: _dl_catch_error (dl-error.c:178)
==1987== by 0x40126C6: _dl_open (dl-open.c:615)
==1987== by 0x570EF65: dlopen_doit (dlopen.c:67)
==1987== by 0x400E385: _dl_catch_error (dl-error.c:178)
==1987== by 0x570F2AB: _dlerror_run (dlerror.c:164)
==1987== by 0x570EEE0: dlopen@@GLIBC_2.2.5 (dlopen.c:88)
<my call to dlopen>
这看起来像是为dlerror
初始化的错误消息,但查看手册页面,它没有说明如何清除此消息。有什么想法可以正确地摆脱它吗?