Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:53329 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 1188 invoked from network); 16 Jun 2011 11:42:07 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Jun 2011 11:42:07 -0000 Authentication-Results: pb1.pair.com smtp.mail=rasmus@lerdorf.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=rasmus@lerdorf.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain lerdorf.com from 74.125.82.54 cause and error) X-PHP-List-Original-Sender: rasmus@lerdorf.com X-Host-Fingerprint: 74.125.82.54 mail-ww0-f54.google.com Received: from [74.125.82.54] ([74.125.82.54:41580] helo=mail-ww0-f54.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EE/20-32650-E0CE9FD4 for ; Thu, 16 Jun 2011 07:42:07 -0400 Received: by wwd20 with SMTP id 20so1332229wwd.11 for ; Thu, 16 Jun 2011 04:42:03 -0700 (PDT) Received: by 10.227.148.136 with SMTP id p8mr805833wbv.28.1308224523465; Thu, 16 Jun 2011 04:42:03 -0700 (PDT) Received: from [10.214.2.62] (host86-189-17-34.range86-189.btcentralplus.com [86.189.17.34]) by mx.google.com with ESMTPS id p21sm77376wbh.23.2011.06.16.04.42.01 (version=SSLv3 cipher=OTHER); Thu, 16 Jun 2011 04:42:02 -0700 (PDT) Message-ID: <4DF9EC08.10600@lerdorf.com> Date: Thu, 16 Jun 2011 12:42:00 +0100 User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110516 Thunderbird/3.1.10 MIME-Version: 1.0 To: Pascal COURTOIS CC: Internals Mailing List References: <8757232E56758B42B2EE4F9D2CA019C9014CE547@US-EX2.zend.net> <8757232E56758B42B2EE4F9D2CA019C9014D10DC@US-EX2.zend.net> <4DF9913B.4030404@nouvo.com> <4DF99EE8.3070204@nouvo.com> <1308216968.2406.3.camel@guybrush> <4DF9D4DF.90405@nouvo.com> <4DF9DB9B.40500@lerdorf.com> <4DF9DDAB.3000109@nouvo.com> In-Reply-To: <4DF9DDAB.3000109@nouvo.com> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] Give the Language a Rest motion (fwd) From: rasmus@lerdorf.com (Rasmus) 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-php@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)