ID: 38244 Updated by: [EMAIL PROTECTED] Reported By: agiorgio at optonline dot net -Status: Open +Status: Assigned Bug Type: Reproducible crash Operating System: Linux PHP Version: 5.1.4 -Assigned To: +Assigned To: pollita
Previous Comments: ------------------------------------------------------------------------ [2006-07-28 19:38:32] agiorgio at optonline dot net Description: ------------ When calling opendir, PHP segfaults. Reproduce code: --------------- <? class mystream { function stream_open($path, $mode, $options, &$opened_path) { return true; } function dir_opendir($url, $options) { return true; } } if(!stream_wrapper_register("test", "mystream")) { die("test wrapper registration failed"); } mkdir("test://a"); $dir = opendir("test://a"); // The SEGV happens here ?> Expected result: ---------------- PHP should not crash. Actual result: -------------- (gdb) run Starting program: /home/angio/php-5.1.4/sapi/cli/php ~/test.php Warning: mkdir(): mystream::mkdir is not implemented! in /home/angio/test.php on line 19 Program received signal SIGSEGV, Segmentation fault. 0x0824e632 in zend_object_store_get_object (zobject=0x3) at /home/angio/php-5.1.4/Zend/zend_objects_API.c:215 215 return EG(objects_store).object_buckets[handle].bucket.obj.object; (gdb) t [Current thread is 0 (process 28095)] (gdb) where #0 0x0824e632 in zend_object_store_get_object (zobject=0x3) at /home/angio/php-5.1.4/Zend/zend_objects_API.c:215 #1 0x08225030 in zend_call_function (fci=0xbfb6c270, fci_cache=0x0) at /home/angio/php-5.1.4/Zend/zend_execute_API.c:661 #2 0x0822524e in call_user_function_ex (function_table=0x3, object_pp=0x3, function_name=0x3, retval_ptr_ptr=0x3, param_count=3, params=0x3, no_separation=3, symbol_table=0x3) at /home/angio/php-5.1.4/Zend/zend_execute_API.c:579 #3 0x082095bf in php_userstreamop_closedir (stream=0x3, close_handle=1) at /home/angio/php-5.1.4/main/streams/userspace.c:1266 #4 0x082009d4 in _php_stream_free (stream=0x842a43c, close_options=11) at /home/angio/php-5.1.4/main/streams/streams.c:342 #5 0x0820129c in stream_resource_regular_dtor (rsrc=0x3) at /home/angio/php-5.1.4/main/streams/streams.c:1373 #6 0x0823e8bf in list_entry_destructor (ptr=0x842c634) at /home/angio/php-5.1.4/Zend/zend_list.c:184 #7 0x0823d2ba in zend_hash_apply_deleter (ht=0x8374bc0, p=0x842c954) at /home/angio/php-5.1.4/Zend/zend_hash.c:576 #8 0x0823d387 in zend_hash_graceful_reverse_destroy (ht=0x8374bc0) at /home/angio/php-5.1.4/Zend/zend_hash.c:642 #9 0x0823165e in zend_deactivate () at /home/angio/php-5.1.4/Zend/zend.c:860 #10 0x081ec005 in php_request_shutdown (dummy=0x0) at /home/angio/php-5.1.4/main/main.c:1287 ---Type <return> to continue, or q <return> to quit--- #11 0x082b34db in main (argc=2, argv=0xbfb6cfb4) at /home/angio/php-5.1.4/sapi/cli/php_cli.c:1245 (gdb) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=38244&edit=1