[Gllug] Re: PHP segmentation fault

Jon Dye jon at pecorous.co.uk
Thu Mar 15 13:53:47 UTC 2007



sas.18752793 at bloglines.com wrote:
> --- Greater London Linux User Group <gllug at gllug.org.uk wrote:
>> I'm getting a segmentation fault when running php.  I noticed that some
>> of the addresses on my website were returning a blank page and I
>> eventually
>> tracked it down to php crashing.  Now when I run php with the
>> following
>> php file it segfaults just after printing 1.
>>
>> <?php
>> print "1\n";
>> define('FOO', 'BAR');
>> print "2\n";
>> ?>
>>
>> I ran strace on php
>> and the last few lines are:
> [SNIP]
>> I don't know where to start looking
>> next, does anyone have any
>> suggestions?  This is on a Gentoo box with php
>> version 5.2.1. I have
>> already tried reinstalling (recompiling) php but
>> that didn't help.
> 
> Does this happen everytime you view that page, including
> after restarting php/apache, or does it work for a while before screwing up?

It happens everytime, both on the command line and via apache and even
after I restart apache and reinstall both apache and php.

> You could
> try installing a debug version of PHP, then running the script from the command
> line.

The debug version doesn't segfault at all.  I eventually ran valgrind on
php and it reported:

==10154== Invalid read of size 4
==10154==    at 0x829862C: _zval_ptr_dtor (in /usr/lib/php5/bin/php)
==10154==    by 0x82CF392: zend_do_fcall_common_helper_SPEC (in
/usr/lib/php5/bin/php)
==10154==    by 0x82CED9A: execute (in /usr/lib/php5/bin/php)
==10154==    by 0x82AC4EB: zend_execute_scripts (in /usr/lib/php5/bin/php)
==10154==    by 0x825D8BC: php_execute_script (in /usr/lib/php5/bin/php)
==10154==    by 0x8362A7C: main (in /usr/lib/php5/bin/php)
==10154==  Address 0x8 is not stack'd, malloc'd or (recently) free'd

JD

-- 
"Ou est la plume de ma tante. As well you know..."
		- Eddie Izzard

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 257 bytes
Desc: OpenPGP digital signature
URL: <http://mailman.lug.org.uk/pipermail/gllug/attachments/20070315/5954ddd8/attachment.pgp>
-------------- next part --------------
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug


More information about the GLLUG mailing list