#27968 [NEW]: segmentation violation when running cli and shebang, but not cli full path
| From: | apc at guidoni dot com | Date: | Mon, 12 Apr 2004 22:11:56 +0000 |
| Subject: | #27968 [NEW]: segmentation violation when running cli and shebang, but not cli full path | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-57983@lists.php.net to get a copy of this message | ||
From: apc at guidoni dot com
Operating system: SCO_SV localhost 3.2 5.0.5 i386
PHP version: 4CVS-2004-04-12 (stable)
PHP Bug Type: Reproducible crash
Bug description: segmentation violation when running cli and shebang, but not cli full path
Description:
------------
php-4.3.5 does not compile; php4-STABLE-200404061630
and php4-STABLE-200404122030 compile without problems.
./configure --with-curl
stock php.ini
PHP 4.3.6RC4-dev (cli) (built: Apr 12 2004 14:16:24)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend
Technologies
both snaps fail with shebangs and when calling the cli
version with the filename as the argument, eg `php
foobar.php'.
user@localhost 1% php abc.php
php: Segmentation violation -- Core dumped
user@localhost 2%
user@localhost 3% php ./abc.php
php: Segmentation violation -- Core dumped
user@localhost 4%
user@localhost 5% php ~/abc.php
hello world
user@localhost 6%
user@localhost 7% php /usr/user/abc.php
hello world
user@localhost 8%
--add the shebang #!/usr/local/bin/php to abc.php--
user@localhost 9% chmod u+x abc.php
user@localhost 10% ./abc.php
php: Segmentation violation -- Core dumped
user@localhost 11%
user@localhost 12% set path =(~/bin $path)
user@localhost 13% cp abc.php ~/bin
user@localhost 14% abc.php
hello world
user@localhost 15%
user@localhost 16% /usr/user/abc.php
hello world
user@localhost 17%
Reproduce code:
---------------
<?php
echo "hello world\n";
?>
or
#!/usr/local/bin/php
<?php
echo "hello world\n";
?>
Expected result:
----------------
hello world
Actual result:
--------------
user@localhost 6% php abc.php
php: Segmentation violation -- Core dumped
user@localhost 7% gdb /usr/local/bin/php core
GNU gdb 5.3
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public
License, and you are
welcome to change it and/or distribute copies of it
under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show
warranty" for details.
This GDB was configured as "i586-pc-sco3.2v5.0"...
Core was generated by `php'.
Program terminated with signal 11, Segmentation fault.
#0 0x80030232 in ?? ()
(gdb)
(gdb) bt
#0 0x80030232 in ?? ()
#1 0x800a4cd0 in ?? ()
#2 0x800a4fb0 in ?? ()
#3 0x08104568 in php_execute_script
(primary_file=0x8047d58) at /usr/user/php/php4-STABLE-
200404061630/main/main.c:1694
#4 0x08141ecd in main (argc=2, argv=0x8047d8c) at /
usr/user/php/php4-STABLE-200404061630/sapi/cgi/
cgi_main.c:1339
#5 0x08060dae in _start ()
(gdb)
--
Edit bug report at http://bugs.php.net/?id=27968&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=27968&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=27968&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=27968&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=27968&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=27968&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=27968&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=27968&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=27968&r=support
Expected behavior: http://bugs.php.net/fix.php?id=27968&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=27968&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=27968&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=27968&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=27968&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=27968&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=27968&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=27968&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=27968&r=float