Le 03/04/2011 12:46, Pierre Joye a écrit : > USE_ZEND_ALLOC=0 valgrind php --leak-check=full sapi/cli/php ... (or > httpd if you use apache or only reproducible there) > > That will tell you if there are actual leaks.
it IS leaking: ==9772== Memcheck, a memory error detector ==9772== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al. ==9772== Using Valgrind-3.6.0.SVN-Debian and LibVEX; rerun with -h for copyright info ==9772== Command: /home/courtois/php-5.3.6/sapi/cgi/php-cgi ==9772== /var/www/dev4.sociatomdev.com/chroot/htdocs/templeet/fetch.php(215) : Warning - Cannot modify header information - headers already sent by (output started at /var/www/dev4.sociatomdev.com/chroot/htdocs/templeet/fetch.php:580) ==9772== ==9772== HEAP SUMMARY: ==9772== in use at exit: 60,706 bytes in 1,591 blocks ==9772== total heap usage: 1,822,108 allocs, 1,820,517 frees, 303,318,634 bytes allocated ==9772== ==9772== 21 (20 direct, 1 indirect) bytes in 1 blocks are definitely lost in loss record 27 of 136 ==9772== at 0x4023F50: malloc (vg_replace_malloc.c:236) ==9772== by 0x840F2D1: _emalloc (zend_alloc.c:2370) ==9772== by 0x845A07A: zend_assign_to_variable_reference (zend_execute.c:413) ==9772== by 0x84E558E: ZEND_ASSIGN_REF_SPEC_CV_VAR_HANDLER (zend_vm_execute.h:27383) ==9772== by 0x845CE46: execute (zend_vm_execute.h:107) ==9772== by 0x8430173: zend_execute_scripts (zend.c:1194) ==9772== by 0x83C70C8: php_execute_script (main.c:2268) ==9772== by 0x84F4A3A: main (cgi_main.c:2109) ==9772== ==9772== 21 (20 direct, 1 indirect) bytes in 1 blocks are definitely lost in loss record 28 of 136 ==9772== at 0x4023F50: malloc (vg_replace_malloc.c:236) ==9772== by 0x840F2D1: _emalloc (zend_alloc.c:2370) ==9772== by 0x845B3E4: zend_assign_to_variable (zend_execute.c:714) ==9772== by 0x84D40A3: ZEND_ASSIGN_SPEC_CV_CONST_HANDLER (zend_vm_execute.h:24059) ==9772== by 0x845CE46: execute (zend_vm_execute.h:107) ==9772== by 0x8430173: zend_execute_scripts (zend.c:1194) ==9772== by 0x83C70C8: php_execute_script (main.c:2268) ==9772== by 0x84F4A3A: main (cgi_main.c:2109) ==9772== ==9772== 39 bytes in 3 blocks are possibly lost in loss record 46 of 136 ==9772== at 0x4023F50: malloc (vg_replace_malloc.c:236) ==9772== by 0x840F2D1: _emalloc (zend_alloc.c:2370) ==9772== by 0x840F685: _estrndup (zend_alloc.c:2525) ==9772== by 0x83F588F: zend_scan_escape_string (zend_language_scanner.l:740) ==9772== by 0x83F74AC: lex_scan (zend_language_scanner.l:2037) ==9772== by 0x841CEEE: zendlex (zend_compile.c:4954) ==9772== by 0x83EF882: zendparse (zend_language_parser.c:3280) ==9772== by 0x83F517F: compile_file (zend_language_scanner.l:364) ==9772== by 0x8265A34: phar_compile_file (phar.c:3393) ==9772== by 0x83AEE26: xc_check_initial_compile_file (xcache.c:929) ==9772== by 0x84300D3: zend_execute_scripts (zend.c:1186) ==9772== by 0x83C70C8: php_execute_script (main.c:2268) ==9772== ==9772== 40 bytes in 2 blocks are definitely lost in loss record 54 of 136 ==9772== at 0x4023F50: malloc (vg_replace_malloc.c:236) ==9772== by 0x840F2D1: _emalloc (zend_alloc.c:2370) ==9772== by 0x84CCA39: zend_send_by_var_helper_SPEC_CV (zend_vm_execute.h:22135) ==9772== by 0x84CD161: ZEND_SEND_VAR_SPEC_CV_HANDLER (zend_vm_execute.h:22242) ==9772== by 0x845CE46: execute (zend_vm_execute.h:107) ==9772== by 0x8430173: zend_execute_scripts (zend.c:1194) ==9772== by 0x83C70C8: php_execute_script (main.c:2268) ==9772== by 0x84F4A3A: main (cgi_main.c:2109) ==9772== ==9772== 54 (20 direct, 34 indirect) bytes in 1 blocks are definitely lost in loss record 65 of 136 ==9772== at 0x4023F50: malloc (vg_replace_malloc.c:236) ==9772== by 0x840F2D1: _emalloc (zend_alloc.c:2370) ==9772== by 0x845AAC6: zend_assign_to_object (zend_execute.c:558) ==9772== by 0x84D38B9: ZEND_ASSIGN_OBJ_SPEC_CV_CONST_HANDLER (zend_vm_execute.h:23966) ==9772== by 0x845CE46: execute (zend_vm_execute.h:107) ==9772== by 0x8430173: zend_execute_scripts (zend.c:1194) ==9772== by 0x83C70C8: php_execute_script (main.c:2268) ==9772== by 0x84F4A3A: main (cgi_main.c:2109) ==9772== ==9772== 75 bytes in 12 blocks are possibly lost in loss record 73 of 136 ==9772== at 0x4023F50: malloc (vg_replace_malloc.c:236) ==9772== by 0x840F2D1: _emalloc (zend_alloc.c:2370) ==9772== by 0x840F685: _estrndup (zend_alloc.c:2525) ==9772== by 0x83F588F: zend_scan_escape_string (zend_language_scanner.l:740) ==9772== by 0x83F9834: lex_scan (zend_language_scanner.l:1870) ==9772== by 0x841CEEE: zendlex (zend_compile.c:4954) ==9772== by 0x83EF882: zendparse (zend_language_parser.c:3280) ==9772== by 0x83F517F: compile_file (zend_language_scanner.l:364) ==9772== by 0x8265A34: phar_compile_file (phar.c:3393) ==9772== by 0x83AEE26: xc_check_initial_compile_file (xcache.c:929) ==9772== by 0x84300D3: zend_execute_scripts (zend.c:1186) ==9772== by 0x83C70C8: php_execute_script (main.c:2268) ==9772== ==9772== 85 bytes in 11 blocks are possibly lost in loss record 77 of 136 ==9772== at 0x4023F50: malloc (vg_replace_malloc.c:236) ==9772== by 0x840F2D1: _emalloc (zend_alloc.c:2370) ==9772== by 0x840F685: _estrndup (zend_alloc.c:2525) ==9772== by 0x8402183: lex_scan (zend_language_scanner.l:1036) ==9772== by 0x841CEEE: zendlex (zend_compile.c:4954) ==9772== by 0x83EF882: zendparse (zend_language_parser.c:3280) ==9772== by 0x83F517F: compile_file (zend_language_scanner.l:364) ==9772== by 0x8265A34: phar_compile_file (phar.c:3393) ==9772== by 0x83AEE26: xc_check_initial_compile_file (xcache.c:929) ==9772== by 0x84300D3: zend_execute_scripts (zend.c:1186) ==9772== by 0x83C70C8: php_execute_script (main.c:2268) ==9772== by 0x84F4A3A: main (cgi_main.c:2109) ==9772== ==9772== 92 (80 direct, 12 indirect) bytes in 4 blocks are definitely lost in loss record 82 of 136 ==9772== at 0x4023F50: malloc (vg_replace_malloc.c:236) ==9772== by 0x840F2D1: _emalloc (zend_alloc.c:2370) ==9772== by 0x845D63A: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:300) ==9772== by 0x84612E1: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:1606) ==9772== by 0x845CE46: execute (zend_vm_execute.h:107) ==9772== by 0x8430173: zend_execute_scripts (zend.c:1194) ==9772== by 0x83C70C8: php_execute_script (main.c:2268) ==9772== by 0x84F4A3A: main (cgi_main.c:2109) ==9772== ==9772== 100 bytes in 7 blocks are possibly lost in loss record 84 of 136 ==9772== at 0x4023F50: malloc (vg_replace_malloc.c:236) ==9772== by 0x840F2D1: _emalloc (zend_alloc.c:2370) ==9772== by 0x842CCDE: zend_str_tolower_dup (zend_operators.c:1884) ==9772== by 0x8414252: zend_do_begin_dynamic_function_call (zend_compile.c:1683) ==9772== by 0x8413D94: zend_do_begin_function_call (zend_compile.c:1575) ==9772== by 0x83F2378: zendparse (zend_language_parser.c:4652) ==9772== by 0x83F517F: compile_file (zend_language_scanner.l:364) ==9772== by 0x8265A34: phar_compile_file (phar.c:3393) ==9772== by 0x83AEE26: xc_check_initial_compile_file (xcache.c:929) ==9772== by 0x84300D3: zend_execute_scripts (zend.c:1186) ==9772== by 0x83C70C8: php_execute_script (main.c:2268) ==9772== by 0x84F4A3A: main (cgi_main.c:2109) ==9772== ==9772== 100 bytes in 12 blocks are possibly lost in loss record 85 of 136 ==9772== at 0x4023F50: malloc (vg_replace_malloc.c:236) ==9772== by 0x840F2D1: _emalloc (zend_alloc.c:2370) ==9772== by 0x840F685: _estrndup (zend_alloc.c:2525) ==9772== by 0x83FA90D: lex_scan (zend_language_scanner.l:1672) ==9772== by 0x841CEEE: zendlex (zend_compile.c:4954) ==9772== by 0x83EF882: zendparse (zend_language_parser.c:3280) ==9772== by 0x83F517F: compile_file (zend_language_scanner.l:364) ==9772== by 0x8265A34: phar_compile_file (phar.c:3393) ==9772== by 0x83AEE26: xc_check_initial_compile_file (xcache.c:929) ==9772== by 0x84300D3: zend_execute_scripts (zend.c:1186) ==9772== by 0x83C70C8: php_execute_script (main.c:2268) ==9772== by 0x84F4A3A: main (cgi_main.c:2109) ==9772== ==9772== 122 bytes in 9 blocks are possibly lost in loss record 90 of 136 ==9772== at 0x4023F50: malloc (vg_replace_malloc.c:236) ==9772== by 0x840F2D1: _emalloc (zend_alloc.c:2370) ==9772== by 0x840F685: _estrndup (zend_alloc.c:2525) ==9772== by 0x83F820E: lex_scan (zend_language_scanner.l:1695) ==9772== by 0x841CEEE: zendlex (zend_compile.c:4954) ==9772== by 0x83EF882: zendparse (zend_language_parser.c:3280) ==9772== by 0x83F517F: compile_file (zend_language_scanner.l:364) ==9772== by 0x8265A34: phar_compile_file (phar.c:3393) ==9772== by 0x83AEE26: xc_check_initial_compile_file (xcache.c:929) ==9772== by 0x84300D3: zend_execute_scripts (zend.c:1186) ==9772== by 0x83C70C8: php_execute_script (main.c:2268) ==9772== by 0x84F4A3A: main (cgi_main.c:2109) ==9772== ==9772== 182 bytes in 14 blocks are possibly lost in loss record 100 of 136 ==9772== at 0x4023F50: malloc (vg_replace_malloc.c:236) ==9772== by 0x840F2D1: _emalloc (zend_alloc.c:2370) ==9772== by 0x840F685: _estrndup (zend_alloc.c:2525) ==9772== by 0x83F9637: lex_scan (zend_language_scanner.l:1817) ==9772== by 0x841CEEE: zendlex (zend_compile.c:4954) ==9772== by 0x83EF882: zendparse (zend_language_parser.c:3280) ==9772== by 0x83F517F: compile_file (zend_language_scanner.l:364) ==9772== by 0x8265A34: phar_compile_file (phar.c:3393) ==9772== by 0x83AEE26: xc_check_initial_compile_file (xcache.c:929) ==9772== by 0x84300D3: zend_execute_scripts (zend.c:1186) ==9772== by 0x83C70C8: php_execute_script (main.c:2268) ==9772== by 0x84F4A3A: main (cgi_main.c:2109) ==9772== ==9772== 322 bytes in 34 blocks are possibly lost in loss record 112 of 136 ==9772== at 0x4023F50: malloc (vg_replace_malloc.c:236) ==9772== by 0x840F2D1: _emalloc (zend_alloc.c:2370) ==9772== by 0x842CCDE: zend_str_tolower_dup (zend_operators.c:1884) ==9772== by 0x8413D39: zend_do_begin_function_call (zend_compile.c:1571) ==9772== by 0x83F2378: zendparse (zend_language_parser.c:4652) ==9772== by 0x83F517F: compile_file (zend_language_scanner.l:364) ==9772== by 0x8265A34: phar_compile_file (phar.c:3393) ==9772== by 0x83AEE26: xc_check_initial_compile_file (xcache.c:929) ==9772== by 0x84300D3: zend_execute_scripts (zend.c:1186) ==9772== by 0x83C70C8: php_execute_script (main.c:2268) ==9772== by 0x84F4A3A: main (cgi_main.c:2109) ==9772== ==9772== 482 (144 direct, 338 indirect) bytes in 1 blocks are definitely lost in loss record 116 of 136 ==9772== at 0x4023F50: malloc (vg_replace_malloc.c:236) ==9772== by 0x840F2D1: _emalloc (zend_alloc.c:2370) ==9772== by 0x83F5086: compile_file (zend_language_scanner.l:334) ==9772== by 0x8265A34: phar_compile_file (phar.c:3393) ==9772== by 0x83AEE26: xc_check_initial_compile_file (xcache.c:929) ==9772== by 0x84300D3: zend_execute_scripts (zend.c:1186) ==9772== by 0x83C70C8: php_execute_script (main.c:2268) ==9772== by 0x84F4A3A: main (cgi_main.c:2109) ==9772== ==9772== 613 (60 direct, 553 indirect) bytes in 3 blocks are definitely lost in loss record 117 of 136 ==9772== at 0x4023F50: malloc (vg_replace_malloc.c:236) ==9772== by 0x840F2D1: _emalloc (zend_alloc.c:2370) ==9772== by 0x84CCFF2: ZEND_SEND_REF_SPEC_CV_HANDLER (zend_vm_execute.h:22226) ==9772== by 0x845CE46: execute (zend_vm_execute.h:107) ==9772== by 0x8430173: zend_execute_scripts (zend.c:1194) ==9772== by 0x83C70C8: php_execute_script (main.c:2268) ==9772== by 0x84F4A3A: main (cgi_main.c:2109) ==9772== ==9772== 679 (120 direct, 559 indirect) bytes in 6 blocks are definitely lost in loss record 121 of 136 ==9772== at 0x4023F50: malloc (vg_replace_malloc.c:236) ==9772== by 0x840F2D1: _emalloc (zend_alloc.c:2370) ==9772== by 0x845B497: zend_assign_to_variable (zend_execute.c:724) ==9772== by 0x84DB447: ZEND_ASSIGN_SPEC_CV_TMP_HANDLER (zend_vm_execute.h:25697) ==9772== by 0x845CE46: execute (zend_vm_execute.h:107) ==9772== by 0x8430173: zend_execute_scripts (zend.c:1194) ==9772== by 0x83C70C8: php_execute_script (main.c:2268) ==9772== by 0x84F4A3A: main (cgi_main.c:2109) ==9772== ==9772== 14,467 (88 direct, 14,379 indirect) bytes in 2 blocks are definitely lost in loss record 135 of 136 ==9772== at 0x4023F50: malloc (vg_replace_malloc.c:236) ==9772== by 0x840F2D1: _emalloc (zend_alloc.c:2370) ==9772== by 0x8423FFC: zend_rebuild_symbol_table (zend_execute_API.c:1699) ==9772== by 0x845B588: zend_get_target_symbol_table (zend_execute.c:766) ==9772== by 0x846082C: zend_fetch_var_address_helper_SPEC_CONST (zend_vm_execute.h:1340) ==9772== by 0x8460EA0: ZEND_FETCH_R_SPEC_CONST_HANDLER (zend_vm_execute.h:1424) ==9772== by 0x845CE46: execute (zend_vm_execute.h:107) ==9772== by 0x8430173: zend_execute_scripts (zend.c:1194) ==9772== by 0x83C70C8: php_execute_script (main.c:2268) ==9772== by 0x84F4A3A: main (cgi_main.c:2109) ==9772== ==9772== 17,328 bytes in 1 blocks are possibly lost in loss record 136 of 136 ==9772== at 0x4024046: realloc (vg_replace_malloc.c:525) ==9772== by 0x840F392: _erealloc (zend_alloc.c:2391) ==9772== by 0x8425C72: pass_two (zend_opcode.c:380) ==9772== by 0x83F51DB: compile_file (zend_language_scanner.l:376) ==9772== by 0x8265A34: phar_compile_file (phar.c:3393) ==9772== by 0x83AEE26: xc_check_initial_compile_file (xcache.c:929) ==9772== by 0x84300D3: zend_execute_scripts (zend.c:1186) ==9772== by 0x83C70C8: php_execute_script (main.c:2268) ==9772== by 0x84F4A3A: main (cgi_main.c:2109) ==9772== ==9772== LEAK SUMMARY: ==9772== definitely lost: 592 bytes in 21 blocks ==9772== indirectly lost: 15,877 bytes in 524 blocks ==9772== possibly lost: 18,353 bytes in 103 blocks ==9772== still reachable: 25,884 bytes in 943 blocks ==9772== suppressed: 0 bytes in 0 blocks ==9772== Reachable blocks (those to which a pointer was found) are not shown. ==9772== To see them, rerun with: --leak-check=full --show-reachable=yes ==9772== ==9772== For counts of detected and suppressed errors, rerun with: -v ==9772== ERROR SUMMARY: 18 errors from 18 contexts (suppressed: 38 from 11) -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php