|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-03-12 16:24 UTC] ab@php.net
[2012-03-12 16:24 UTC] ab@php.net
-Assigned To:
+Assigned To: ab
[2012-03-13 02:40 UTC] laruence@php.net
[2012-03-14 09:17 UTC] pajoye@php.net
[2012-07-17 12:39 UTC] ab@php.net
[2012-07-17 12:50 UTC] ab@php.net
[2012-07-18 17:16 UTC] ab@php.net
[2013-05-12 13:02 UTC] ab@php.net
-Status: Assigned
+Status: Closed
[2013-05-12 13:02 UTC] ab@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 08:00:01 2025 UTC |
Description: ------------ when run 5.4+APC with USE_ZEND_ALLOC=0 valgrind complain mem leaks plz note I run the test script in this way: $USE_ZEND_ALLOC=0 valgrind --leak-check=full php54 -S `hostname`:8964 and the test script should be index.php Test script: --------------- <?php $there = 'world'; class hello { function __construct($p) { $this->testme($p); } function testme($p) { echo "testme $p <br>"; } } $h = new hello($there); Expected result: ---------------- no mem leak Actual result: -------------- ==24793== ==24793== HEAP SUMMARY: ==24793== in use at exit: 3,636,679 bytes in 22,636 blocks ==24793== total heap usage: 28,009 allocs, 5,373 frees, 4,348,865 bytes allocated ==24793== ==24793== 4 bytes in 1 blocks are definitely lost in loss record 27 of 8,544 ==24793== at 0x4906ADE: malloc (vg_replace_malloc.c:263) ==24793== by 0x8F0B269: apc_pthreadmutex_create (apc_pthreadmutex.c:30) ==24793== by 0x8F0BC00: apc_sma_init (apc_sma.c:382) ==24793== by 0x8F0A8C1: apc_module_init (apc_main.c:805) ==24793== by 0x8EFC131: zm_startup_apc (php_apc.c:347) ==24793== by 0x8AA9DE: zend_startup_module_ex (zend_API.c:1656) ==24793== by 0x8B48BA: zend_hash_apply (zend_hash.c:716) ==24793== by 0x8AAE9B: zend_startup_modules (zend_API.c:1783) ==24793== by 0x8233E4: php_module_startup (main.c:2191) ==24793== by 0x9CC1DA: sapi_cli_server_startup (php_cli_server.c:416) ==24793== by 0x9C7199: main (php_cli.c:1336) ==24793== ==24793== 4 bytes in 1 blocks are definitely lost in loss record 28 of 8,544 ==24793== at 0x4906ADE: malloc (vg_replace_malloc.c:263) ==24793== by 0x8F0B269: apc_pthreadmutex_create (apc_pthreadmutex.c:30) ==24793== by 0x8F006B6: apc_cache_create (apc_cache.c:301) ==24793== by 0x8F0A8EB: apc_module_init (apc_main.c:809) ==24793== by 0x8EFC131: zm_startup_apc (php_apc.c:347) ==24793== by 0x8AA9DE: zend_startup_module_ex (zend_API.c:1656) ==24793== by 0x8B48BA: zend_hash_apply (zend_hash.c:716) ==24793== by 0x8AAE9B: zend_startup_modules (zend_API.c:1783) ==24793== by 0x8233E4: php_module_startup (main.c:2191) ==24793== by 0x9CC1DA: sapi_cli_server_startup (php_cli_server.c:416) ==24793== by 0x9C7199: main (php_cli.c:1336) ==24793== ==24793== 4 bytes in 1 blocks are definitely lost in loss record 29 of 8,544 ==24793== at 0x4906ADE: malloc (vg_replace_malloc.c:263) ==24793== by 0x8F0B269: apc_pthreadmutex_create (apc_pthreadmutex.c:30) ==24793== by 0x8F006C7: apc_cache_create (apc_cache.c:303) ==24793== by 0x8F0A8EB: apc_module_init (apc_main.c:809) ==24793== by 0x8EFC131: zm_startup_apc (php_apc.c:347) ==24793== by 0x8AA9DE: zend_startup_module_ex (zend_API.c:1656) ==24793== by 0x8B48BA: zend_hash_apply (zend_hash.c:716) ==24793== by 0x8AAE9B: zend_startup_modules (zend_API.c:1783) ==24793== by 0x8233E4: php_module_startup (main.c:2191) ==24793== by 0x9CC1DA: sapi_cli_server_startup (php_cli_server.c:416) ==24793== by 0x9C7199: main (php_cli.c:1336) ==24793== ==24793== 4 bytes in 1 blocks are definitely lost in loss record 30 of 8,544 ==24793== at 0x4906ADE: malloc (vg_replace_malloc.c:263) ==24793== by 0x8F0B269: apc_pthreadmutex_create (apc_pthreadmutex.c:30) ==24793== by 0x8F006B6: apc_cache_create (apc_cache.c:301) ==24793== by 0x8F0A922: apc_module_init (apc_main.c:810) ==24793== by 0x8EFC131: zm_startup_apc (php_apc.c:347) ==24793== by 0x8AA9DE: zend_startup_module_ex (zend_API.c:1656) ==24793== by 0x8B48BA: zend_hash_apply (zend_hash.c:716) ==24793== by 0x8AAE9B: zend_startup_modules (zend_API.c:1783) ==24793== by 0x8233E4: php_module_startup (main.c:2191) ==24793== by 0x9CC1DA: sapi_cli_server_startup (php_cli_server.c:416) ==24793== by 0x9C7199: main (php_cli.c:1336) ==24793== ==24793== 4 bytes in 1 blocks are definitely lost in loss record 31 of 8,544 ==24793== at 0x4906ADE: malloc (vg_replace_malloc.c:263) ==24793== by 0x8F0B269: apc_pthreadmutex_create (apc_pthreadmutex.c:30) ==24793== by 0x8F006C7: apc_cache_create (apc_cache.c:303) ==24793== by 0x8F0A922: apc_module_init (apc_main.c:810) ==24793== by 0x8EFC131: zm_startup_apc (php_apc.c:347) ==24793== by 0x8AA9DE: zend_startup_module_ex (zend_API.c:1656) ==24793== by 0x8B48BA: zend_hash_apply (zend_hash.c:716) ==24793== by 0x8AAE9B: zend_startup_modules (zend_API.c:1783) ==24793== by 0x8233E4: php_module_startup (main.c:2191) ==24793== by 0x9CC1DA: sapi_cli_server_startup (php_cli_server.c:416) ==24793== by 0x9C7199: main (php_cli.c:1336) ==24793== ==24793== 4 bytes in 1 blocks are definitely lost in loss record 32 of 8,544 ==24793== at 0x4906ADE: malloc (vg_replace_malloc.c:263) ==24793== by 0x8F0B269: apc_pthreadmutex_create (apc_pthreadmutex.c:30) ==24793== by 0x8F14DBD: apc_interned_strings_init (apc_string.c:204) ==24793== by 0x8F0AA65: apc_module_init (apc_main.c:845) ==24793== by 0x8EFC131: zm_startup_apc (php_apc.c:347) ==24793== by 0x8AA9DE: zend_startup_module_ex (zend_API.c:1656) ==24793== by 0x8B48BA: zend_hash_apply (zend_hash.c:716) ==24793== by 0x8AAE9B: zend_startup_modules (zend_API.c:1783) ==24793== by 0x8233E4: php_module_startup (main.c:2191) ==24793== by 0x9CC1DA: sapi_cli_server_startup (php_cli_server.c:416) ==24793== by 0x9C7199: main (php_cli.c:1336) ==24793== ==24793== 4 bytes in 1 blocks are definitely lost in loss record 33 of 8,544 ==24793== at 0x4906ADE: malloc (vg_replace_malloc.c:263) ==24793== by 0x8712F8: _emalloc (zend_alloc.c:2423) ==24793== by 0x8F0CC29: apc_php_malloc (apc_zend.c:38) ==24793== by 0x8F0E9F6: apc_unpool_alloc (apc_pool.c:91) ==24793== by 0x8F0F0B6: apc_pmemcpy (apc_pool.c:492) ==24793== by 0x8F07CDB: apc_copy_op_array_for_execution (apc_compile.c:1657) ==24793== by 0x8F095F6: cached_compile (apc_main.c:373) ==24793== by 0x8F09DA1: my_compile_file (apc_main.c:552) ==24793== by 0x6AF935: phar_compile_file (phar.c:3391) ==24793== by 0x8A3B21: zend_execute_scripts (zend.c:1264) ==24793== by 0x8239FC: php_execute_script (main.c:2473) ==24793== by 0x9D06F2: php_cli_server_dispatch_script (php_cli_server.c:1875) ==24793== ==24793== 32 bytes in 1 blocks are definitely lost in loss record 2,830 of 8,544 ==24793== at 0x4906ADE: malloc (vg_replace_malloc.c:263) ==24793== by 0x8712F8: _emalloc (zend_alloc.c:2423) ==24793== by 0x8F08A54: apc_register_serializer (apc_serializer.h:62) ==24793== by 0x8F0A9D9: apc_module_init (apc_main.c:820) ==24793== by 0x8EFC131: zm_startup_apc (php_apc.c:347) ==24793== by 0x8AA9DE: zend_startup_module_ex (zend_API.c:1656) ==24793== by 0x8B48BA: zend_hash_apply (zend_hash.c:716) ==24793== by 0x8AAE9B: zend_startup_modules (zend_API.c:1783) ==24793== by 0x8233E4: php_module_startup (main.c:2191) ==24793== by 0x9CC1DA: sapi_cli_server_startup (php_cli_server.c:416) ==24793== by 0x9C7199: main (php_cli.c:1336) ==24793== ==24793== 1,738 (8 direct, 1,730 indirect) bytes in 1 blocks are definitely lost in loss record 8,314 of 8,544 ==24793== at 0x4906ADE: malloc (vg_replace_malloc.c:263) ==24793== by 0x8712F8: _emalloc (zend_alloc.c:2423) ==24793== by 0x8F0CC29: apc_php_malloc (apc_zend.c:38) ==24793== by 0x8F08DF9: install_class (apc_main.c:168) ==24793== by 0x8F09518: cached_compile (apc_main.c:357) ==24793== by 0x8F09DA1: my_compile_file (apc_main.c:552) ==24793== by 0x6AF935: phar_compile_file (phar.c:3391) ==24793== by 0x8A3B21: zend_execute_scripts (zend.c:1264) ==24793== by 0x8239FC: php_execute_script (main.c:2473) ==24793== by 0x9D06F2: php_cli_server_dispatch_script (php_cli_server.c:1875) ==24793== by 0x9D178C: php_cli_server_dispatch (php_cli_server.c:2036) ==24793== by 0x9D1DC7: php_cli_server_recv_event_read_request (php_cli_server.c:2214) ==24793== ==24793== LEAK SUMMARY: ==24793== definitely lost: 68 bytes in 9 blocks ==24793== indirectly lost: 1,730 bytes in 15 blocks ==24793== possibly lost: 0 bytes in 0 blocks ==24793== still reachable: 3,634,881 bytes in 22,612 blocks ==24793== suppressed: 0 bytes in 0 blocks ==24793== Reachable blocks (those to which a pointer was found) are not shown. ==24793== To see them, rerun with: --leak-check=full --show-reachable=yes ==24793== ==24793== For counts of detected and suppressed errors, rerun with: -v ==24793== ERROR SUMMARY: 9 errors from 9 contexts (suppressed: 4 from 4)