From: jan at horde dot org
Operating system: Linux
PHP version: 4CVS-2004-07-20 (stable)
PHP Bug Type: Reproducible crash
Bug description: realpath segfault
Description:
------------
Calling a certain script leads to a segfault with the following bt (I'll
try to create a reproduce script later):
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16384 (LWP 5897)]
0x40281e09 in __old__lxstat64 () from /lib/libc.so.6
(gdb) bt
#0 0x40281e09 in __old__lxstat64 () from /lib/libc.so.6
#1 0x4020c2f4 in realpath@@GLIBC_2.3 () from /lib/libc.so.6
#2 0x40925f1d in virtual_file_ex (state=0xbfe02178,
path=0x847a34c "/home/jan/horde/occam/lib/Topic/Multiplechoice.php",
verify_path=0, use_realpath=1)
at /home/jan/cvs/php-src/TSRM/tsrm_virtual_cwd.c:310
#3 0x4092b718 in expand_filepath (
filepath=0x847a34c
"/home/jan/horde/occam/lib/Topic/Multiplechoice.php",
real_path=Variable "real_path" is not available.
) at /home/jan/cvs/php-src/main/fopen_wrappers.c:548
#4 0x40934996 in _php_stream_fopen (
filename=0x847a34c
"/home/jan/horde/occam/lib/Topic/Multiplechoice.php",
mode=0x4096772d "rb", opened_path=0xbfe04548, options=165)
at /home/jan/cvs/php-src/main/streams.c:1959
#5 0x40934bc6 in _php_stream_fopen_with_path (
filename=0x847a34c
"/home/jan/horde/occam/lib/Topic/Multiplechoice.php",
mode=0x4096772d "rb",
path=0x809c0f4 "/home/jan/horde/libs:/usr/local/lib/php",
opened_path=0xbfe04548, options=165)
at /home/jan/cvs/php-src/main/streams.c:1818
#6 0x40934f6e in php_plain_files_stream_opener (wrapper=0x40b01444,
path=Variable "path" is not available.
)
at /home/jan/cvs/php-src/main/streams.c:2449
#7 0x409355cb in _php_stream_open_wrapper_ex (path=Variable "path" is not
available.
)
at /home/jan/cvs/php-src/main/streams.c:2656
#8 0x40935799 in _php_stream_open_wrapper_as_file_handle (
path=0x847a34c "/home/jan/horde/occam/lib/Topic/Multiplechoice.php",
mode=0x4096772d "rb", options=141, fh=0xbfe04540)
at /home/jan/cvs/php-src/main/streams.c:2783
#9 0x4092732a in php_open_wrapper_for_zend (
filename=0x847a34c
"/home/jan/horde/occam/lib/Topic/Multiplechoice.php",
fh=0xbfe04540) at /home/jan/cvs/php-src/main/main.c:772
#10 0x409640b6 in execute (op_array=0x852bd0c)
at /home/jan/cvs/php-src/Zend/zend_execute.c:2141
#11 0x40961a18 in execute (op_array=0x852dc84)
at /home/jan/cvs/php-src/Zend/zend_execute.c:1679
#12 0x40961a18 in execute (op_array=0x852dc84)
at /home/jan/cvs/php-src/Zend/zend_execute.c:1679
#13 0x40961a18 in execute (op_array=0x852dc84)
at /home/jan/cvs/php-src/Zend/zend_execute.c:1679
#14 0x40961a18 in execute (op_array=0x852dc84)
[...]
#3586 0x40961a18 in execute (op_array=0x8470814)
at /home/jan/cvs/php-src/Zend/zend_execute.c:1679
#3587 0x4096425e in execute (op_array=0x816e8c4)
at /home/jan/cvs/php-src/Zend/zend_execute.c:2201
#3588 0x40952922 in zend_execute_scripts (type=8, retval=0x0,
file_count=3)
at /home/jan/cvs/php-src/Zend/zend.c:891
#3589 0x40926fcf in php_execute_script (primary_file=0xbfffd8b0)
at /home/jan/cvs/php-src/main/main.c:1731
#3590 0x40964dee in apache_php_module_main (r=0x8137da8,
display_source_mode=0)
at /home/jan/cvs/php-src/sapi/apache/sapi_apache.c:54
#3591 0x4096531e in send_php (r=Variable "r" is not available.
)
at /home/jan/cvs/php-src/sapi/apache/mod_php4.c:620
#3592 0x08057c47 in ap_invoke_handler ()
#3593 0x0806a921 in process_request_internal ()
#3594 0x0806ab20 in ap_process_request ()
#3595 0x08060e0b in child_main ()
#3596 0x080611a6 in make_child ()
#3597 0x080612da in startup_children ()
#3598 0x080629cc in standalone_main ()
#3599 0x08063ccb in main ()
--
Edit bug report at http://bugs.php.net/?id=29288&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=29288&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=29288&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=29288&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=29288&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=29288&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=29288&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=29288&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=29288&r=support
Expected behavior: http://bugs.php.net/fix.php?id=29288&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=29288&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=29288&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=29288&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29288&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=29288&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=29288&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=29288&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=29288&r=float