[Orclib-users] Possible memory leaks in ocilib
Open source C and C++ library for accessing Oracle Databases
Brought to you by:
vince_del_paris
From: Artem H. <ha...@qu...> - 2013-03-29 00:37:52
|
Hi, I have a very simple program which does nothing but OCI_Initialize() followed by OCI_Cleanup() and according to valgrind it leaks memory. I have tried both ocilib 3.12.0 and 3.12.1, valgrind version is 3.6.0. The code of the program as well as the valgrind output can be found below. Is this a known issue? Thank you in advance for your help! Artem. ______________________________________ #include <assert.h> #include <ocilib.h> int main(int argc, char **argv) { assert(OCI_Initialize(NULL, NULL, OCI_ENV_THREADED | OCI_ENV_CONTEXT)); assert(OCI_Cleanup()); return 0; } ______________________________________ $ valgrind --tool=memcheck --leak-check=full --leak-resolution=high --num-callers=40 --undef-value-errors=no bin/qdb_ocilib_test ==3444== Memcheck, a memory error detector ==3444== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al. ==3444== Using Valgrind-3.6.0 and LibVEX; rerun with -h for copyright info ==3444== Command: bin/qdb_ocilib_test ==3444== ==3444== ==3444== HEAP SUMMARY: ==3444== in use at exit: 537,121 bytes in 236 blocks ==3444== total heap usage: 560 allocs, 324 frees, 906,553 bytes allocated ==3444== ==3444== 99 bytes in 1 blocks are definitely lost in loss record 96 of 235 ==3444== at 0x4C26FDE: malloc (vg_replace_malloc.c:236) ==3444== by 0x74E0397: slzsetevar (in /libclntsh.so.11.1) ==3444== by 0x74E406F: lfvSetOHome (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x65C5E2F: slpmloclfv (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x65C5A3A: slpmloc (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x65C3512: lpmloadpkg (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x65A79DC: lfvLoadPkg (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x65A76D4: lfvSetShlMode (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x65A74C3: lfvini1 (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x65A731A: lfvini2 (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x6520930: lxlinit (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x64BFD90: nleminz (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x7DBFB91: nlstdggo (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x7DBEF32: nlstdgg (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x63D211E: nigini2 (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x691339B: kpeDbgGetNPDGlobal (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x691326F: kpeDbgTLSInit (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x7EE7E48: kpummTLSGET1 (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x6913532: kpeDbgProcessInit (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x6911954: kpummpin (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x62785E4: kpuenvcr (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x624A2F1: OCIEnvCreate (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x4E5B8A2: OCI_Initialize (in LIB_PATH/libocilib.so.3.12.1) ==3444== by 0x4006B6: main (qdb_ocilib_test.c:14) ==3444== ==3444== 192 bytes in 1 blocks are possibly lost in loss record 160 of 235 ==3444== at 0x4C26FDE: malloc (vg_replace_malloc.c:236) ==3444== by 0x65A411C: sltsmxi (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x65BFB8B: lmmhpinit (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x65BEDDD: lmmcis (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x65C3C40: lpmpali (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x65C2F04: lpminitm (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x65C2CEB: lpminit (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x65A7997: lfvLoadPkg (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x65A7691: lfvSetShlMode (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x65A74C3: lfvini1 (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x65A731A: lfvini2 (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x6520930: lxlinit (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x64BFD90: nleminz (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x7DBFB91: nlstdggo (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x7DBEF32: nlstdgg (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x63D211E: nigini2 (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x691339B: kpeDbgGetNPDGlobal (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x691326F: kpeDbgTLSInit (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x7EE7E48: kpummTLSGET1 (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x6913532: kpeDbgProcessInit (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x6911954: kpummpin (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x62785E4: kpuenvcr (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x624A2F1: OCIEnvCreate (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x4E5B8A2: OCI_Initialize (in LIB_PATH/libocilib.so.3.12.1) ==3444== by 0x4006B6: main (qdb_ocilib_test.c:14) ==3444== ==3444== 192 bytes in 1 blocks are possibly lost in loss record 161 of 235 ==3444== at 0x4C26FDE: malloc (vg_replace_malloc.c:236) ==3444== by 0x65A411C: sltsmxi (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x65BFB8B: lmmhpinit (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x65BEDDD: lmmcis (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x65C3C40: lpmpali (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x65C34CA: lpmloadpkg (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x65A79DC: lfvLoadPkg (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x65A76D4: lfvSetShlMode (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x65A74C3: lfvini1 (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x65A731A: lfvini2 (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x6520930: lxlinit (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x64BFD90: nleminz (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x7DBFB91: nlstdggo (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x7DBEF32: nlstdgg (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x63D211E: nigini2 (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x691339B: kpeDbgGetNPDGlobal (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x691326F: kpeDbgTLSInit (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x7EE7E48: kpummTLSGET1 (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x6913532: kpeDbgProcessInit (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x6911954: kpummpin (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x62785E4: kpuenvcr (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x624A2F1: OCIEnvCreate (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x4E5B8A2: OCI_Initialize (in LIB_PATH/libocilib.so.3.12.1) ==3444== by 0x4006B6: main (qdb_ocilib_test.c:14) ==3444== ==3444== 139,264 bytes in 1 blocks are possibly lost in loss record 235 of 235 ==3444== at 0x4C25A28: calloc (vg_replace_malloc.c:467) ==3444== by 0x65C25F8: slwmmgetmem (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x65C2390: lmmstvrt (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x65C0D1D: lmmstchnk (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x65C2215: lmmstsml (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x7E11809: lmmstmalloc (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x7E10E3D: lmmmalloc (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x65BECCC: lmmcis (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x65C3C40: lpmpali (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x65C2F04: lpminitm (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x65C2CEB: lpminit (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x65A7997: lfvLoadPkg (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x65A7691: lfvSetShlMode (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x65A74C3: lfvini1 (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x65A731A: lfvini2 (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x6520930: lxlinit (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x64BFD90: nleminz (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x7DBFB91: nlstdggo (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x7DBEF32: nlstdgg (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x63D211E: nigini2 (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x691339B: kpeDbgGetNPDGlobal (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x691326F: kpeDbgTLSInit (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x7EE7E48: kpummTLSGET1 (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x6913532: kpeDbgProcessInit (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x6911954: kpummpin (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x62785E4: kpuenvcr (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x624A2F1: OCIEnvCreate (in LIB_PATH/libclntsh.so.11.1) ==3444== by 0x4E5B8A2: OCI_Initialize (in LIB_PATH/libocilib.so.3.12.1) ==3444== by 0x4006B6: main (qdb_ocilib_test.c:14) ==3444== ==3444== LEAK SUMMARY: ==3444== definitely lost: 99 bytes in 1 blocks ==3444== indirectly lost: 0 bytes in 0 blocks ==3444== possibly lost: 139,648 bytes in 3 blocks ==3444== still reachable: 397,374 bytes in 232 blocks ==3444== suppressed: 0 bytes in 0 blocks ==3444== Reachable blocks (those to which a pointer was found) are not shown. ==3444== To see them, rerun with: --leak-check=full --show-reachable=yes ==3444== ==3444== For counts of detected and suppressed errors, rerun with: -v ==3444== ERROR SUMMARY: 4 errors from 4 contexts (suppressed: 0 from 0) $ |