Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:22739 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 71738 invoked by uid 1010); 13 Apr 2006 22:46:07 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 71705 invoked from network); 13 Apr 2006 22:46:07 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Apr 2006 22:46:07 -0000 X-Host-Fingerprint: 204.11.219.139 lerdorf.com Linux 2.5 (sometimes 2.4) (4) Received: from ([204.11.219.139:50055] helo=lerdorf.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 2E/B8-19715-884DE344 for ; Thu, 13 Apr 2006 18:46:05 -0400 Received: from [66.228.175.145] (borndress-lm.corp.yahoo.com [66.228.175.145]) (authenticated bits=0) by lerdorf.com (8.13.6/8.13.6/Debian-1) with ESMTP id k3DMjOjK025235; Thu, 13 Apr 2006 15:45:25 -0700 Mime-Version: 1.0 (Apple Message framework v623) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-ID: Content-Transfer-Encoding: 7bit Cc: Dmitry Stogov , Andi Gutmans Date: Thu, 13 Apr 2006 15:44:34 -0700 To: PHP Internals X-Mailer: Apple Mail (2.623) Subject: Unicode conversion exceptions and memory leaks From: andrei@gravitonic.com (Andrei Zmievski) If you run this code in PHP 6 right now, you will get a nice memory leak notice. "; try { $s = (binary)$u; } catch (UnicodeConversionException $e) { } ?> /homes/andrei/dev/php-src/Zend/zend_unicode.c(461) : Freeing 0x013FC4E4 (1 bytes), script=e.php From what Dmitry tells me, it is impossible to fix this with the way our exceptions are implemented currently. I trust him on this, but at the same time I think we need to do something. The conversions will be happening in a lot of place and being able to catch an exception, if one results, is an important part of the workflow. I think Dmitry proposed that we could re-write exceptions implementation, but also said that it would be a lot of work. I think we should seriously consider it, though. Thoughts? -Andrei