Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:11193 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 80920 invoked by uid 1010); 13 Jul 2004 17:07:54 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 80797 invoked from network); 13 Jul 2004 17:07:54 -0000 Received: from unknown (HELO is.magroup.ru) (213.33.179.242) by pb1.pair.com with SMTP; 13 Jul 2004 17:07:54 -0000 Received: from localhost.localdomain ([192.168.3.226]) by is.magroup.ru with Microsoft SMTPSVC(5.0.2195.6713); Tue, 13 Jul 2004 21:08:46 +0400 Date: Tue, 13 Jul 2004 21:08:45 +0400 To: internals@lists.php.net Message-ID: <20040713210845.3861733c.tony2001@phpclub.net> In-Reply-To: <20040713153428.109b8e82.tony2001@phpclub.net> References: <5.1.0.14.2.20040712141042.03166120@127.0.0.1> <20040713153428.109b8e82.tony2001@phpclub.net> X-Mailer: Sylpheed version 0.9.12 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart=_Tue__13_Jul_2004_21_08_45_+0400_s80XnA2=BYMSjlks" X-OriginalArrivalTime: 13 Jul 2004 17:08:46.0272 (UTC) FILETIME=[0ECF2400:01C468FC] Subject: Re: [PHP-DEV] PHP 5.0.0 Test roll From: tony2001@phpclub.net (Antony Dovgal) --Multipart=_Tue__13_Jul_2004_21_08_45_+0400_s80XnA2=BYMSjlks Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Tue, 13 Jul 2004 15:34:28 +0400 Antony Dovgal wrote: > Hi all! > > That's what valgrind says: > > 1) > Zend/tests/bug26166.phpt > > Zend/zend_execute.c:1352 > EX(Ts) = (temp_variable *) safe_emalloc(sizeof(temp_variable), > op_array->T, 0); > > ==8511== 40 bytes in 1 blocks are still reachable in loss record 2 of > 7==8511== at 0x3C01E375: malloc (vg_replace_malloc.c:105) > ==8511== by 0x8222A55: _emalloc (zend_alloc.c:182) > ==8511== by 0x8222C77: _safe_emalloc (zend_alloc.c:238) > ==8511== by 0x8266E78: execute (zend_execute.c:1352) > > 2) > Zend/tests/bug20240.phpt > > ==8478== 40 bytes in 1 blocks are still reachable in loss record 2 of > 7==8478== at 0x3C01E375: malloc (vg_replace_malloc.c:105) > ==8478== by 0x8222A55: _emalloc (zend_alloc.c:182) > ==8478== by 0x8231488: call_user_function (zend_execute_API.c:517) > ==8478== by 0x816D03B: user_shutdown_function_call > (basic_functions.c:2088) Dunno if it's the right thing to add if()'s around emalloc(), but with attached patch these warnings disappear, reducing valgrind logs in a half. --- WBR, Antony Dovgal aka tony2001 tony2001@phpclub.net || antony@dovgal.com --Multipart=_Tue__13_Jul_2004_21_08_45_+0400_s80XnA2=BYMSjlks Content-Type: text/plain; name="shut_valgrind_up.txt" Content-Disposition: attachment; filename="shut_valgrind_up.txt" Content-Transfer-Encoding: 7bit Index: zend_execute_API.c =================================================================== RCS file: /repository/ZendEngine2/zend_execute_API.c,v retrieving revision 1.287 diff -u -r1.287 zend_execute_API.c --- zend_execute_API.c 18 May 2004 20:14:54 -0000 1.287 +++ zend_execute_API.c 13 Jul 2004 17:04:14 -0000 @@ -514,11 +514,15 @@ int call_user_function(HashTable *function_table, zval **object_pp, zval *function_name, zval *retval_ptr, zend_uint param_count, zval *params[] TSRMLS_DC) { - zval ***params_array = (zval ***) emalloc(sizeof(zval **)*param_count); + zval ***params_array = NULL; zend_uint i; int ex_retval; zval *local_retval_ptr; + if (param_count) { + params_array = (zval ***) emalloc(sizeof(zval **)*param_count); + } + for (i=0; iT, 0); + EX(Ts) = NULL; + if (op_array->T) { + EX(Ts) = (temp_variable *) safe_emalloc(sizeof(temp_variable), op_array->T, 0); + } EX(op_array) = op_array; EX(original_in_execution) = EG(in_execution); EX(prev_execute_data) = EG(current_execute_data); --Multipart=_Tue__13_Jul_2004_21_08_45_+0400_s80XnA2=BYMSjlks--