[php-maint] Bug#528600: Bug#528600: gforge: massmail.php segfault

Raphael Geissert atomo64 at gmail.com
Fri May 15 16:22:43 UTC 2009


clone 528600 -1
reassign -1 gforge
retitle -1 gforge: shebangs should not pass an empty -f parameter
severity 528600 minor
thanks

On Friday 15 May 2009 08:27:05 Roland Mas wrote:
> Niu Kun, 2009-05-15 20:27:39 +0800 :
> > Hi Roland,
> > Funny thing has been detected that the first line of my massmail.php
> > is written like this:
> > #! /usr/bin/php5 -f
> > When I change the line to "#!/usr/bin/php5 -f", the seg fault remains
> > the same.
> > But when I change the line to "#!/usr/bin/php5" or "#! /usr/bin/php5",
> > seg fault disappeared.
> > Does it mean that this bug is caused by php5?
>
> Interesting.  I think it could very well be a bug in PHP indeed (and the
> bug has been reassigned already).

It is a bug the fact that it segfaults, but calling php5 with -f but without 
passing it a file name is a bug on your side. The man page specifically says 

php5(1):
> You can parse and execute files by using parameter -f followed by the name
> of the file to be executed. 
[...]
> If  none of -r -f -B -R -F or -E is present but a single parameter is given
> then this parameter is taken as the filename to parse and execute (same as
> with -f). If no parameter is  present  then  the  standard input is read and
> executed. 

So am cloning the report and assigning the copy back to gforge.

I've tried to but failed at reproducing the bug with a simple script. So, Niu, 
could you please install the php5-dbg package and run the following commands?

$ cat > test.php <<'FOO'
#!/usr/bin/php5 -f
<?php
echo "hello world\n";
?>
FOO
$ chmod +x test.php
$ ./test.php

And see if it segfaults? if it does, then please run:

$ ulimit -c unlimited
$ ./test.php
$ gdb -c core
(gdb) bt
<attach in your reply what is displayed here>
(gdb) q

If it doesn't segfault then please repeat the same steps but instead of 
running the test script run the massmail.php script as you did before.

Cheers,
-- 
Raphael Geissert - Debian Maintainer
www.debian.org - get.debian.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.alioth.debian.org/pipermail/pkg-php-maint/attachments/20090515/388111a5/attachment.pgp>


More information about the pkg-php-maint mailing list