Hi.
I have the following code:
This part was working just fine. If I ran my application through valgrind, it said that all blocks were freed, and no leaks are possibile, but today when I tried to do the same thing I got the following report:Code:char file_path[256]; ... handle = dlopen(file_path, RTLD_LAZY); ... dlclose(handle);
==12394== 20 bytes in 1 blocks are still reachable in loss record 1 of 1
==12394== at 0x40053B3: calloc (vg_replace_malloc.c:467)
==12394== by 0x5860A5: _dlerror_run (dlerror.c:142)
==12394== by 0x585B70: dlopen@@GLIBC_2.1 (dlopen.c:88)
and at the end:
==12394== LEAK SUMMARY:
==12394== definitely lost: 0 bytes in 0 blocks
==12394== indirectly lost: 0 bytes in 0 blocks
==12394== possibly lost: 0 bytes in 0 blocks
==12394== still reachable: 20 bytes in 1 blocks
==12394== suppressed: 0 bytes in 0 blocks
It is true that I made some changes to the source code, but not to this part, and even if I remove them, still get the same report.
I looked around on google, and saw, that some other people had the same problem, but I didn`t find a solution anywhere.
Is it possible that dlopen is in fact leaking memory, or maybe there is a bug in valgrind?
My OS is CentOS 6 with kernel version 2.6.32-279.5.2.el6.i686.
Thank you.
P.S. The last update I made on my computer contains a kernel-devel update, but it`s hard to believe that it is because of this.