Re: segmentation fault

From: Date: Mon, 19 Mar 2007 22:13:26 +0000
Subject: Re: segmentation fault
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-28464@lists.php.net to get a copy of this message
> On 3/16/07, Oliver Block <lists@block-online.eu> 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?

« previous php.internals (#28464) next »