Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:15142 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 88861 invoked by uid 1010); 22 Feb 2005 03:37:34 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 88846 invoked from network); 22 Feb 2005 03:37:34 -0000 Received: from unknown (HELO proposaltech.com) (127.0.0.1) by localhost with SMTP; 22 Feb 2005 03:37:34 -0000 X-Host-Fingerprint: 66.163.170.82 smtp812.mail.sc5.yahoo.com Received: from ([66.163.170.82:38364] helo=smtp812.mail.sc5.yahoo.com) by pb1.pair.com (ecelerity HEAD r(5097)) with SMTP id 50/98-02951-DF8AA124 for ; Mon, 21 Feb 2005 22:37:34 -0500 Received: from unknown (HELO 192.168.2.101) (jabouillei@69.105.128.73 with plain) by smtp812.mail.sc5.yahoo.com with SMTP; 22 Feb 2005 03:37:31 -0000 Reply-To: truth@proposaltech.com To: Michael Walter , artin Sarsale , Derick Rethans , internals@lists.php.net Cc: M In-Reply-To: <877e9a1705022118216f205e0e@mail.gmail.com> References: <421A26A4.70104@tnsweb.com> <421A2EE2.7070300@tnsweb.com> <877e9a1705022118216f205e0e@mail.gmail.com> Content-Type: text/plain Date: Mon, 21 Feb 2005 19:37:26 -0800 Message-ID: <1109043446.1581.27.camel@notebook.local> Mime-Version: 1.0 X-Mailer: Evolution 2.0.1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] segmentation fault when passing arguments by reference or importing global variables From: truth@proposaltech.com (Todd Ruth) Ahh... my favorite topic. I think I covered all the cases our company has hit in the following message to this list: http://marc.theaimsgroup.com/?l=php-dev&m=109631219107237&w=2 I've never seen a response as to whether there is hope for fixes of these problems. I ended up hacking at an already very ugly p*rl script (a language that shouldn't be mentioned on this list) to look for attempts to use non-referencable things as references. Unfortunately, not only is it in the language which must not be named, but it also makes some assumptions about the code based on company standards. I keep my fingers crossed that someone with appropriate skills will write a tool to do the check right. The problems can be painful to find. e.g. function g() { return NULL; } function h(&$x) { $x = 5; } h(g()); can cause php to crash. (Don't bother trying to reproduce it though. It only causes a crash with a _lot_ of other php code with it to make things interesting.) Good luck! - Todd On Mon, 2005-02-21 at 21:21 -0500, Michael Walter wrote: > I've as well experienced this problem several times (in a medium-size > code base). > > By returning-by-reference in the wrong places, do you mean something like > function foo() { return 10;} > $bar=&foo(); > I'm pretty convinced that even with "correct" (in that respect) code > the crash still occurs. > > Michael > > > On Mon, 21 Feb 2005 15:56:34 -0300, Martin Sarsale > wrote: > > Derick Rethans wrote: > > > > > I've been noticing the same things, and still trying to figure out where > > > it happens. It has most likely to do with returning-by-reference in the > > > wrong places. > > > > What do you mean with returning by reference in the wrong places? could > > you give me an example? > > > > > > -- > > No virus found in this outgoing message. > > Checked by AVG Anti-Virus. > > Version: 7.0.300 / Virus Database: 266.2.0 - Release Date: 2/21/2005 > > > > -- > > PHP Internals - PHP Runtime Development Mailing List > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > >