From:             [EMAIL PROTECTED]
Operating system: Linux 2.4.22 (Fedora Core 1)
PHP version:      4.3.4
PHP Bug Type:     Reproducible crash
Bug description:  CGI 'php -n' + php_ini_scanned_files() == segfault

Description:
------------
On a recent install of PHP 4.3.4 (from RPM, not compile), the 

CGI binary segfaults if php is given the -n switch, either

on the command line or the bang-hash line.



Note: I just tried this script on FreeBSD 4.8-stable and it

worked fine (no segfault). 

Reproduce code:
---------------
#!/usr/bin/php -qn

<?php



echo phpversion() . "\n";



$inis = php_ini_scanned_files();



var_dump($inis);



?>





Expected result:
----------------
4.3.4

string(63) "/etc/php.d/imap.ini,

/etc/php.d/ldap.ini,

/etc/php.d/mysql.ini

"



Actual result:
--------------
Script output:

------------------------

4.3.4

Segmentation fault





Backtrace: (I know there're no symbols, but it seems to

point to strlen()).

------------------------

GNU gdb Red Hat Linux (5.3.90-0.20030710.41rh)

Copyright 2003 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 "i386-redhat-linux-gnu".

(gdb) file /usr/bin/php

Reading symbols from /usr/bin/php...(no debugging symbols found)...done.

Using host libthread_db library "/lib/tls/libthread_db.so.1".

(gdb) run -n -q ../bin/test.php

Starting program: /usr/bin/php -n -q ../bin/test.php

(no debugging symbols found)...(no debugging symbols found)...(no
debugging symbols found)...(no debugging symbols found)...[Thread
debugging using libthread_db enabled]

[New Thread -1085134208 (LWP 9427)]

4.3.4



Program received signal SIGSEGV, Segmentation fault.

[Switching to Thread -1085134208 (LWP 9427)]

0x00707043 in strlen () from /lib/tls/libc.so.6

(gdb)



-- 
Edit bug report at http://bugs.php.net/?id=27998&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=27998&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=27998&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=27998&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=27998&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=27998&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=27998&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=27998&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=27998&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=27998&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=27998&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=27998&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=27998&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=27998&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=27998&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=27998&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=27998&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=27998&r=float

Reply via email to