[Gllug] Re: PHP segmentation fault

Nix nix at esperi.org.uk
Sat Mar 17 20:46:09 UTC 2007


On 17 Mar 2007, jon at pecorous.co.uk verbalised:

> On Fri, Mar 16, 2007 at 11:35:01PM +0000, Nix wrote:
>> On 15 Mar 2007, Jon Dye outgrape:
>> >> 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:
>> 
>> Compile with -g and get debugging, I'd guess.
>
> When I said debug version I mean I set the Gentoo debug USE flag which
> I'm pretty sure compiles with -g.  When I do that it doesn't crash at
> all.

Does it change other compilation flags? -g is not supposed to change the
output of the compiler (as in it doesn't change any sections other than
introduce debug sections). If no other flags were changed, this is a
compiler bug, and a pretty severe one.

I suspect other flags are being changed. Watch the compilation and find
out :)

>> (FWIW php 5.2.1 does not crash here nor emit any valgrind errors with the
>> testcase you provided. Are you using weird CFLAGS or a known-broken version
>> of GCC such as 4.0.0 or something?)
>
> gcc 3.4.6 with CFLAGS="-O2 -march=athlon-xp -funroll-loops -pipe"
> 
> Can't remember why I put -funroll-loops in there.

Well, take it out because it generally reduces performance on
register-poor architectures like x86.

> For now I'm running with the debug version (-g) because it works and
> I've submitted a bug report to Gentoo but I was hoping to be able to
> diagnose the problem further.

Compile it with *exactly* the same flags as it crashed with but with -g
added (and -s removed from the link line, if any) and see if it still
crashes.

-- 
`In the future, company names will be a 32-character hex string.'
  --- Bruce Schneier on the shortage of company names
-------------- 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