Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:28464 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 54436 invoked by uid 1010); 19 Mar 2007 22:13:30 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 54421 invoked from network); 19 Mar 2007 22:13:30 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Mar 2007 22:13:30 -0000 Authentication-Results: pb1.pair.com smtp.mail=ceo@l-i-e.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=ceo@l-i-e.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain l-i-e.com from 67.139.134.202 cause and error) X-PHP-List-Original-Sender: ceo@l-i-e.com X-Host-Fingerprint: 67.139.134.202 o2.hostbaby.com FreeBSD 4.7-5.2 (or MacOS X 10.2-10.3) (2) Received: from [67.139.134.202] ([67.139.134.202:2563] helo=o2.hostbaby.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FF/D6-01604-60B0FF54 for ; Mon, 19 Mar 2007 17:13:29 -0500 Received: (qmail 89871 invoked by uid 98); 19 Mar 2007 22:13:27 -0000 Received: from 127.0.0.1 by o2.hostbaby.com (envelope-from , uid 1013) with qmail-scanner-1.25 (clamdscan: 0.88.7/2871. Clear:RC:1(127.0.0.1):. Processed in 0.074979 secs); 19 Mar 2007 22:13:27 -0000 X-Qmail-Scanner-Mail-From: ceo@l-i-e.com via o2.hostbaby.com X-Qmail-Scanner: 1.25 (Clear:RC:1(127.0.0.1):. Processed in 0.074979 secs) Received: from localhost (HELO l-i-e.com) (127.0.0.1) by localhost with SMTP; 19 Mar 2007 22:13:26 -0000 Received: from 216.230.84.67 (SquirrelMail authenticated user ceo@l-i-e.com) by www.l-i-e.com with HTTP; Mon, 19 Mar 2007 17:13:26 -0500 (CDT) Message-ID: <53557.216.230.84.67.1174342406.squirrel@www.l-i-e.com> In-Reply-To: References: <200703160308.36432.lists@block-online.eu> Date: Mon, 19 Mar 2007 17:13:26 -0500 (CDT) To: "Oliver Block" Cc: internals@lists.php.net Reply-To: ceo@l-i-e.com User-Agent: Hostbaby Webmail MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal Subject: Re: [PHP-DEV] segmentation fault From: ceo@l-i-e.com ("Richard Lynch") > On 3/16/07, Oliver Block wrote: >> Hello, >> >> I receive a segmentation fault on a >> >> RETVAL_STRING(some_module_global, 1); >> >> The problem disappears if I change it to >> >> RETVAL_STRING(some_module_global, 0); >> >> Is anybody interested in the data? >> >> Regards, >> >> Oliver As I understand it (or don't, more likely) the whole point of the 0 versus 1 there is "who is going to deallocate the string" you are returning. If you use the wrong thing, and both PHP and *you* deallocate the string, then one of you is doing a "free" on NULL and PHP will segfault. Don't do that. :-) So, I suspect that nobody really wants the data, as you did something you shouldn't have, and now you've fixed it. Please understand that my experience in this matter is limited to writing one (1) extension of dubious value, at best: http://l-i-e.com/perror -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So?