From: swalk at prp dot physik dot tu-darmstadt dot de
Operating system: Linux
PHP version: 5CVS-2004-07-23 (dev)
PHP Bug Type: Reproducible crash
Bug description: PHP segfaults during shutdown because of custom stream wrapper
Description:
------------
If i have any custom wrapper registered, and try to include or
php_check_syntax() a file with a parse error in it, php segfaults during
shutdown.
Reproduce code:
---------------
$ php -r 'class a {} stream_register_wrapper("a","a");
php_check_syntax("http://localhost/test.txt");'
Segmentation fault
test.txt contains just:
<?php foo
Expected result:
----------------
No output and no segfault :)
Actual result:
--------------
(gdb) bt
#0 0x00000019 in ?? ()
#1 0x08165371 in _php_stream_free (stream=0x82b7bc4, close_options=11)
at /home/et/cvs.php.net/php-src/main/streams/streams.c:351
#2 0x081666b3 in stream_resource_regular_dtor (rsrc=0x82b78d4)
at /home/et/cvs.php.net/php-src/main/streams/streams.c:1343
#3 0x081916ae in list_entry_destructor (ptr=0x82b78d4)
at /home/et/cvs.php.net/php-src/Zend/zend_list.c:173
#4 0x08190279 in zend_hash_apply_deleter (ht=0x8211534, p=0x82b77bc)
at /home/et/cvs.php.net/php-src/Zend/zend_hash.c:574
#5 0x08190309 in zend_hash_graceful_reverse_destroy (ht=0x8211534)
at /home/et/cvs.php.net/php-src/Zend/zend_hash.c:640
#6 0x08180fb7 in shutdown_executor ()
at /home/et/cvs.php.net/php-src/Zend/zend_execute_API.c:282
#7 0x0818a25b in zend_deactivate () at
/home/et/cvs.php.net/php-src/Zend/zend.c:819
#8 0x08158981 in php_request_shutdown (dummy=0x0)
at /home/et/cvs.php.net/php-src/main/main.c:1212
#9 0x081b725f in main (argc=5, argv=0xbffff2e4)
at /home/et/cvs.php.net/php-src/sapi/cli/php_cli.c:1046
--
Edit bug report at http://bugs.php.net/?id=29358&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=29358&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=29358&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=29358&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=29358&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=29358&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=29358&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=29358&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=29358&r=support
Expected behavior: http://bugs.php.net/fix.php?id=29358&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=29358&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=29358&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=29358&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29358&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=29358&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=29358&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=29358&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=29358&r=float