Bug #51347 [Fbk->Opn]: mysqli_close / connection memory leak

From: Date: Thu, 15 Apr 2010 11:01:42 +0000
Subject: Bug #51347 [Fbk->Opn]: mysqli_close / connection memory leak
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-149583@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=51347&edit=1

 ID:               51347
 User updated by:  mat999 at gmail dot com
 Reported by:      mat999 at gmail dot com
 Summary:          mysqli_close / connection memory leak
-Status:           Feedback
+Status:           Open
 Type:             Bug
 Package:          MySQLi related
 Operating System: Debian Lenny / Linux
 PHP Version:      5.3.2
 Assigned To:      mysql

 New Comment:

ok on the weekend Ill remake my build environment and see what I can do.


Previous Comments:
------------------------------------------------------------------------
[2010-04-15 12:50:54] andrey@php.net

Can you try with 5.3.3-dev. I am sure I fixed this. Not a real leak,
more like streams were freeing memory too late. Please try a snapshot
from snaps.php.net

------------------------------------------------------------------------
[2010-04-06 07:38:40] mat999 at gmail dot com

Gee, no responses on a proven bug...

Heres valgrind info, sorry no debug symbols for php5-mysql


[...]
==49959== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 52 from
4)
--49959--
--49959-- supp:     22 dl-hack4-64bit-addr-1
--49959-- supp:      2 dl-hack3-cond-2
--49959-- supp:     27 dl-hack3-cond-1
--49959-- supp:      1 dl-hack4-64bit-addr-2
==49959== malloc/free: in use at exit: 6,394 bytes in 22 blocks.
==49959== malloc/free: 31,095 allocs, 31,073 frees, 4,718,692 bytes
allocated.
==49959==
==49959== searching for pointers to 22 not-freed blocks.
==49959== checked 1,626,688 bytes.
==49959==
==49959== 5 bytes in 1 blocks are indirectly lost in loss record 1 of
11
==49959==    at 0x4C2260E: malloc (vg_replace_malloc.c:207)
==49959==    by 0x9161D71: strdup (in /lib/libc-2.7.so)
==49959==    by 0x91A0036: (within /lib/libc-2.7.so)
==49959==    by 0x91A1F78: getaddrinfo (in /lib/libc-2.7.so)
==49959==    by 0xA5C017E: ???
==49959==    by 0xA5C030D: ???
==49959==    by 0xA5C0488: ???
==49959==    by 0xA5C04A9: ???
==49959==    by 0xA5C7D96: ???
==49959==    by 0xA38C5FC: ???
==49959==    by 0x74A6CA: zend_startup_module_ex (in /usr/bin/php5)
==49959==    by 0x752E3A: zend_hash_apply (in /usr/bin/php5)
==49959==
==49959==
==49959== 12 bytes in 1 blocks are still reachable in loss record 2 of
11
==49959==    at 0x4C2260E: malloc (vg_replace_malloc.c:207)
==49959==    by 0x9161D71: strdup (in /lib/libc-2.7.so)
==49959==    by 0x555354: zm_startup_intl (in /usr/bin/php5)
==49959==    by 0x74A6CA: zend_startup_module_ex (in /usr/bin/php5)
==49959==    by 0x752E3A: zend_hash_apply (in /usr/bin/php5)
==49959==    by 0x74DC29: zend_startup_modules (in /usr/bin/php5)
==49959==    by 0x6F1399: php_module_startup (in /usr/bin/php5)
==49959==    by 0x7D7B4C: php_cli_startup (in /usr/bin/php5)
==49959==    by 0x7D850F: main (in /usr/bin/php5)
==49959==
==49959==
==49959== 12 bytes in 1 blocks are still reachable in loss record 3 of
11
==49959==    at 0x4C2260E: malloc (vg_replace_malloc.c:207)
==49959==    by 0x777588D: uprv_getDefaultLocaleID_3_8 (in
/usr/lib/libicuuc.so.38.1)
==49959==    by 0x77AC129: (within /usr/lib/libicuuc.so.38.1)
==49959==    by 0x77AC2AE: icu_3_8::Locale::getDefault() (in
/usr/lib/libicuuc.so.38.1)
==49959==    by 0x77AD7C8: (within /usr/lib/libicuuc.so.38.1)
==49959==    by 0x55534C: zm_startup_intl (in /usr/bin/php5)
==49959==    by 0x74A6CA: zend_startup_module_ex (in /usr/bin/php5)
==49959==    by 0x752E3A: zend_hash_apply (in /usr/bin/php5)
==49959==    by 0x74DC29: zend_startup_modules (in /usr/bin/php5)
==49959==    by 0x6F1399: php_module_startup (in /usr/bin/php5)
==49959==    by 0x7D7B4C: php_cli_startup (in /usr/bin/php5)
==49959==    by 0x7D850F: main (in /usr/bin/php5)
==49959==
==49959==
==49959== 32 bytes in 1 blocks are still reachable in loss record 4 of
11
==49959==    at 0x4C203E4: calloc (vg_replace_malloc.c:397)
==49959==    by 0x66C73DF: (within /lib/libdl-2.7.so)
==49959==    by 0x66C6F20: dlopen (in /lib/libdl-2.7.so)
==49959==    by 0x752274: zend_load_extension (in /usr/bin/php5)
==49959==    by 0x73D30D: zend_llist_apply (in /usr/bin/php5)
==49959==    by 0x6F8226: php_ini_register_extensions (in
/usr/bin/php5)
==49959==    by 0x6F1394: php_module_startup (in /usr/bin/php5)
==49959==    by 0x7D7B4C: php_cli_startup (in /usr/bin/php5)
==49959==    by 0x7D850F: main (in /usr/bin/php5)
==49959==
==49959==
==49959== 53 bytes in 2 blocks are definitely lost in loss record 5 of
11
==49959==    at 0x4C2260E: malloc (vg_replace_malloc.c:207)
==49959==    by 0xA5BF317: ???
==49959==    by 0xA5C0269: ???
==49959==    by 0xA5C030D: ???
==49959==    by 0xA5C0488: ???
==49959==    by 0xA5C04A9: ???
==49959==    by 0xA5C7D96: ???
==49959==    by 0xA38C5FC: ???
==49959==    by 0x74A6CA: zend_startup_module_ex (in /usr/bin/php5)
==49959==    by 0x752E3A: zend_hash_apply (in /usr/bin/php5)
==49959==    by 0x74DC29: zend_startup_modules (in /usr/bin/php5)
==49959==    by 0x6F1399: php_module_startup (in /usr/bin/php5)
==49959==
==49959==
==49959== 69 (64 direct, 5 indirect) bytes in 1 blocks are definitely
lost in loss record 6 of 11
==49959==    at 0x4C2260E: malloc (vg_replace_malloc.c:207)
==49959==    by 0x919FC83: (within /lib/libc-2.7.so)
==49959==    by 0x91A1F78: getaddrinfo (in /lib/libc-2.7.so)
==49959==    by 0xA5C017E: ???
==49959==    by 0xA5C030D: ???
==49959==    by 0xA5C0488: ???
==49959==    by 0xA5C04A9: ???
==49959==    by 0xA5C7D96: ???
==49959==    by 0xA38C5FC: ???
==49959==    by 0x74A6CA: zend_startup_module_ex (in /usr/bin/php5)
==49959==    by 0x752E3A: zend_hash_apply (in /usr/bin/php5)
==49959==    by 0x74DC29: zend_startup_modules (in /usr/bin/php5)
==49959==
==49959==
==49959== 176 bytes in 1 blocks are still reachable in loss record 7 of
11
==49959==    at 0x4C2260E: malloc (vg_replace_malloc.c:207)
==49959==    by 0x77AC169: (within /usr/lib/libicuuc.so.38.1)
==49959==    by 0x77AC2AE: icu_3_8::Locale::getDefault() (in
/usr/lib/libicuuc.so.38.1)
==49959==    by 0x77AD7C8: (within /usr/lib/libicuuc.so.38.1)
==49959==    by 0x55534C: zm_startup_intl (in /usr/bin/php5)
==49959==    by 0x74A6CA: zend_startup_module_ex (in /usr/bin/php5)
==49959==    by 0x752E3A: zend_hash_apply (in /usr/bin/php5)
==49959==    by 0x74DC29: zend_startup_modules (in /usr/bin/php5)
==49959==    by 0x6F1399: php_module_startup (in /usr/bin/php5)
==49959==    by 0x7D7B4C: php_cli_startup (in /usr/bin/php5)
==49959==    by 0x7D850F: main (in /usr/bin/php5)
==49959==
==49959==
==49959== 672 bytes in 1 blocks are still reachable in loss record 8 of
11
==49959==    at 0x4C2260E: malloc (vg_replace_malloc.c:207)
==49959==    by 0x4011429: (within /lib/ld-2.7.so)
==49959==    by 0x4011A24: (within /lib/ld-2.7.so)
==49959==    by 0x400D385: (within /lib/ld-2.7.so)
==49959==    by 0x401111A: (within /lib/ld-2.7.so)
==49959==    by 0x66C6FBA: (within /lib/libdl-2.7.so)
==49959==    by 0x400D385: (within /lib/ld-2.7.so)
==49959==    by 0x66C736B: (within /lib/libdl-2.7.so)
==49959==    by 0x66C6F20: dlopen (in /lib/libdl-2.7.so)
==49959==    by 0x66A870: php_load_extension (in /usr/bin/php5)
==49959==    by 0x73D30D: zend_llist_apply (in /usr/bin/php5)
==49959==    by 0x6F8239: php_ini_register_extensions (in
/usr/bin/php5)
==49959==
==49959==
==49959== 1,272 bytes in 11 blocks are still reachable in loss record 9
of 11
==49959==    at 0x4C2260E: malloc (vg_replace_malloc.c:207)
==49959==    by 0x59BB8F2: CRYPTO_malloc (in
/usr/lib/libcrypto.so.0.9.8)
==49959==    by 0x5A1C2DE: sk_new (in /usr/lib/libcrypto.so.0.9.8)
==49959==    by 0x572D649: (within /usr/lib/libssl.so.0.9.8)
==49959==    by 0x572D858: SSL_COMP_get_compression_methods (in
/usr/lib/libssl.so.0.9.8)
==49959==    by 0x5733A0F: SSL_library_init (in
/usr/lib/libssl.so.0.9.8)
==49959==    by 0x468BCE: zm_startup_openssl (in /usr/bin/php5)
==49959==    by 0x74A6CA: zend_startup_module_ex (in /usr/bin/php5)
==49959==    by 0x752E3A: zend_hash_apply (in /usr/bin/php5)
==49959==    by 0x74DC29: zend_startup_modules (in /usr/bin/php5)
==49959==    by 0x6F1399: php_module_startup (in /usr/bin/php5)
==49959==    by 0x7D7B4C: php_cli_startup (in /usr/bin/php5)
==49959==
==49959==
==49959== 2,048 bytes in 1 blocks are still reachable in loss record 10
of 11
==49959==    at 0x4C2260E: malloc (vg_replace_malloc.c:207)
==49959==    by 0x753619: _zend_hash_init (in /usr/bin/php5)
==49959==    by 0x75366C: _zend_hash_init_ex (in /usr/bin/php5)
==49959==    by 0x7472D5: zend_startup (in /usr/bin/php5)
==49959==    by 0x6F0DCF: php_module_startup (in /usr/bin/php5)
==49959==    by 0x7D7B4C: php_cli_startup (in /usr/bin/php5)
==49959==    by 0x7D850F: main (in /usr/bin/php5)
==49959==
==49959==
==49959== 2,048 bytes in 1 blocks are still reachable in loss record 11
of 11
==49959==    at 0x4C2260E: malloc (vg_replace_malloc.c:207)
==49959==    by 0x73DC8D: zend_llist_init (in /usr/bin/php5)
==49959==    by 0x6FA902: sapi_activate (in /usr/bin/php5)
==49959==    by 0x6F0CB3: php_module_startup (in /usr/bin/php5)
==49959==    by 0x7D7B4C: php_cli_startup (in /usr/bin/php5)
==49959==    by 0x7D850F: main (in /usr/bin/php5)
==49959==
==49959== LEAK SUMMARY:
==49959==    definitely lost: 117 bytes in 3 blocks.
==49959==    indirectly lost: 5 bytes in 1 blocks.
==49959==      possibly lost: 0 bytes in 0 blocks.
==49959==    still reachable: 6,272 bytes in 18 blocks.
==49959==         suppressed: 0 bytes in 0 blocks.
--49959--  memcheck: sanity checks: 50 cheap, 4 expensive
--49959--  memcheck: auxmaps: 0 auxmap entries (0k, 0M) in use
--49959--  memcheck: auxmaps_L1: 0 searches, 0 cmps, ratio 0:10
--49959--  memcheck: auxmaps_L2: 0 searches, 0 nodes
--49959--  memcheck: SMs: n_issued      = 161 (2576k, 2M)
--49959--  memcheck: SMs: n_deissued    = 9 (144k, 0M)
--49959--  memcheck: SMs: max_noaccess  = 524287 (8388592k, 8191M)
--49959--  memcheck: SMs: max_undefined = 14 (224k, 0M)
--49959--  memcheck: SMs: max_defined   = 2155 (34480k, 33M)
--49959--  memcheck: SMs: max_non_DSM   = 160 (2560k, 2M)
--49959--  memcheck: max sec V bit nodes:    8 (0k, 0M)
--49959--  memcheck: set_sec_vbits8 calls: 13 (new: 8, updates: 5)
--49959--  memcheck: max shadow mem size:   6704k, 6M
--49959-- translate:            fast SP updates identified: 21,056 (
84.1%)
--49959-- translate:   generic_known SP updates identified: 3,640 (
14.5%)
--49959-- translate: generic_unknown SP updates identified: 331 ( 
1.3%)
--49959--     tt/tc: 44,478 tt lookups requiring 53,263 probes
--49959--     tt/tc: 44,478 fast-cache updates, 24 flushes
--49959--  transtab: new        18,748 (589,533 -> 7,876,845; ratio
133:10) [0 scs]
--49959--  transtab: dumped     0 (0 -> ??)
--49959--  transtab: discarded  1,820 (46,106 -> ??)
--49959-- scheduler: 5,020,598 jumps (bb entries).
--49959-- scheduler: 50/88,483 major/minor sched events.
--49959--    sanity: 51 cheap, 4 expensive checks.
--49959--    exectx: 12,289 lists, 10,787 contexts (avg 0 per list)
--49959--    exectx: 62,188 searches, 59,102 full compares (950 per
1000)
--49959--    exectx: 65 cmp2, 444 cmp4, 0 cmpAll
--49959--  errormgr: 44 supplist searches, 1,362 comparisons during
search
--49959--  errormgr: 52 errlist searches, 607 comparisons during search

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    http://bugs.php.net/bug.php?id=51347


-- 
Edit this bug report at http://bugs.php.net/bug.php?id=51347&edit=1


Thread (16 messages)

« previous php.bugs (#149583) next »