segmentation fault

php.internals

Oliver Block

19 years ago
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

Tijnema !

19 years ago
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
I never had any segfaults with PHP, but i think more info is needed. What is some_module_global? is it a var? did you define it? is it just a string? And maybe PHP version would be helpful. Tijnema

Richard Lynch

19 years ago
> 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?