On 06/16/2011 11:40 AM, Pascal COURTOIS wrote: > Le 16/06/2011 12:31, Rasmus a écrit : >> On 06/16/2011 11:03 AM, Pascal COURTOIS wrote: >>> If you followed the thread you have seen the reduced test case is >>> VERY short and the ONLY constructions involved are user functions and >>> exceptions. FULL STOP. Not even a single addition nor a loop nor nothing. >>> I can't imagine nobody uses user functions and exceptions. >> >> You might also consider that your particular case is rather unique. I > > since decoder-...@own-hero.net could reduce the case from my original > program in the conditions I stated, he could obvously detect the leaks.
I'm not saying there aren't any. There are known leaks in compile_file() when you throw an exception like that, so if you call a huge amount of these within a single request, you are going to have problems. But that is not something the average person hits, and again, they are all free'ed on request shutdown, so it isn't like it is a persistent leak. eg. rasmus@x220:~/php-src/branches/PHP_5_3$ USE_ZEND_ALLOC=0 valgrind --leak-check=full sapi/cli/php pas.php ==17658== Memcheck, a memory error detector ==17658== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al. ==17658== Using Valgrind-3.6.1 and LibVEX; rerun with -h for copyright info ==17658== Command: sapi/cli/php pas.php ==17658== ==17658== ==17658== HEAP SUMMARY: ==17658== in use at exit: 3,376 bytes in 18 blocks ==17658== total heap usage: 25,077 allocs, 25,059 frees, 3,952,839 bytes allocated ==17658== ==17658== 9 bytes in 1 blocks are possibly lost in loss record 3 of 16 ==17658== at 0x4C28FAC: malloc (vg_replace_malloc.c:236) ==17658== by 0x78F2DF: _estrndup (zend_alloc.c:2503) ==17658== by 0x78477B: lex_scan (zend_language_scanner.l:1817) ==17658== by 0x7994DF: zendlex (zend_compile.c:4969) ==17658== by 0x77B9B4: zendparse (zend_language_parser.c:3291) ==17658== by 0x77F3BE: compile_file (zend_language_scanner.l:364) ==17658== by 0x601350: phar_compile_file (phar.c:3393) ==17658== by 0x7ACF48: zend_execute_scripts (zend.c:1187) ==17658== by 0x75AA52: php_execute_script (main.c:2284) ==17658== by 0x8406D3: main (php_cli.c:1193) ==17658== ==17658== 14 bytes in 1 blocks are possibly lost in loss record 4 of 16 ==17658== at 0x4C28FAC: malloc (vg_replace_malloc.c:236) ==17658== by 0x7A8D9A: zend_str_tolower_dup (zend_operators.c:1884) ==17658== by 0x79B36E: zend_do_begin_function_call (zend_compile.c:1571) ==17658== by 0x77E64B: zendparse (zend_language_parser.y:671) ==17658== by 0x77F3BE: compile_file (zend_language_scanner.l:364) ==17658== by 0x601350: phar_compile_file (phar.c:3393) ==17658== by 0x7ACF48: zend_execute_scripts (zend.c:1187) ==17658== by 0x75AA52: php_execute_script (main.c:2284) ==17658== by 0x8406D3: main (php_cli.c:1193) ==17658== ==17658== 17 bytes in 1 blocks are possibly lost in loss record 5 of 16 ==17658== at 0x4C28FAC: malloc (vg_replace_malloc.c:236) ==17658== by 0x78F2DF: _estrndup (zend_alloc.c:2503) ==17658== by 0x78059A: lex_scan (zend_language_scanner.l:1695) ==17658== by 0x7994DF: zendlex (zend_compile.c:4969) ==17658== by 0x77B9B4: zendparse (zend_language_parser.c:3291) ==17658== by 0x77F3BE: compile_file (zend_language_scanner.l:364) ==17658== by 0x601350: phar_compile_file (phar.c:3393) ==17658== by 0x7ACF48: zend_execute_scripts (zend.c:1187) ==17658== by 0x75AA52: php_execute_script (main.c:2284) ==17658== by 0x8406D3: main (php_cli.c:1193) ==17658== ==17658== 648 (232 direct, 416 indirect) bytes in 1 blocks are definitely lost in loss record 15 of 16 ==17658== at 0x4C28FAC: malloc (vg_replace_malloc.c:236) ==17658== by 0x77F344: compile_file (zend_language_scanner.l:334) ==17658== by 0x601350: phar_compile_file (phar.c:3393) ==17658== by 0x7ACF48: zend_execute_scripts (zend.c:1187) ==17658== by 0x75AA52: php_execute_script (main.c:2284) ==17658== by 0x8406D3: main (php_cli.c:1193) ==17658== ==17658== 1,680 bytes in 1 blocks are possibly lost in loss record 16 of 16 ==17658== at 0x4C290A4: realloc (vg_replace_malloc.c:525) ==17658== by 0x7A2273: pass_two (zend_opcode.c:380) ==17658== by 0x77F407: compile_file (zend_language_scanner.l:376) ==17658== by 0x601350: phar_compile_file (phar.c:3393) ==17658== by 0x7ACF48: zend_execute_scripts (zend.c:1187) ==17658== by 0x75AA52: php_execute_script (main.c:2284) ==17658== by 0x8406D3: main (php_cli.c:1193) ==17658== ==17658== LEAK SUMMARY: ==17658== definitely lost: 232 bytes in 1 blocks ==17658== indirectly lost: 416 bytes in 6 blocks ==17658== possibly lost: 1,720 bytes in 4 blocks ==17658== still reachable: 1,008 bytes in 7 blocks ==17658== suppressed: 0 bytes in 0 blocks ==17658== Reachable blocks (those to which a pointer was found) are not shown. ==17658== To see them, rerun with: --leak-check=full --show-reachable=yes ==17658== ==17658== For counts of detected and suppressed errors, rerun with: -v ==17658== ERROR SUMMARY: 5 errors from 5 contexts (suppressed: 12 from 6) -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php