From: Operating system: PHP version: 5.3SVN-2011-03-30 (SVN) Package: Scripting Engine problem Bug Type: Bug Bug description:classes from dl()'ed extensions are not destroyed
Description: ------------ If an extension loaded with dl() declares any clasess, these classes are not destroyed along with the module and it's other resources. That causes crashes when using delayed early binding, though that's not a requirement, see reproduce case below. Test script: --------------- Reproduce case is quite intricate: start ONE child process of any PHP SAPI (except CLI/CGI/embed, of course) execute this code: <?php dl(<extension declaring any internal classes with create_object() handler>) $o = new <That class>; ?> then comment out the dl() and execute it again. The class is still present, but it's handler pointers are invalid, therefore PHP will crash with a similar backtrace: Program received signal SIGSEGV, Segmentation fault. 0xb6e17da0 in ?? () (gdb) bt #0 0xb6e17da0 in ?? () #1 0x081cc629 in _object_and_properties_init (arg=0x83deae8, class_type=0x8455380, properties=0x0) at /local/dev/php/PHP_5_3/Zend/zend_API.c:1088 #2 0x081cc730 in _object_init_ex (arg=0x83deae8, class_type=0x8455380) at /local/dev/php/PHP_5_3/Zend/zend_API.c:1096 #3 0x081ee86d in ZEND_NEW_SPEC_HANDLER (execute_data=0x8411d80) at /local/dev/php/PHP_5_3/Zend/zend_vm_execute.h:476 #4 0x081eb4f9 in execute (op_array=0x83dd3f4) at /local/dev/php/PHP_5_3/Zend/zend_vm_execute.h:107 #5 0x081cab82 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /local/dev/php/PHP_5_3/Zend/zend.c:1194 #6 0x08179b90 in php_execute_script (primary_file=0xbfda0cb0) at /local/dev/php/PHP_5_3/main/main.c:2268 #7 0x0825a53d in main (argc=1, argv=0xbfda0e04) at /local/dev/php/PHP_5_3/sapi/fpm/fpm/fpm_main.c:1882 (gdb) f 1 #1 0x081cc629 in _object_and_properties_init (arg=0x83deae8, class_type=0x8455380, properties=0x0) at /local/dev/php/PHP_5_3/Zend/zend_API.c:1088 1088 Z_OBJVAL_P(arg) = class_type->create_object(class_type TSRMLS_CC); (gdb) p class_type->create_object $1 = (zend_object_value (*)(zend_class_entry *)) 0xb6e17da0 (gdb) p *class_type->create_object Cannot access memory at address 0xb6e17da0 -- Edit bug report at http://bugs.php.net/bug.php?id=54423&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=54423&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=54423&r=trysnapshot53 Try a snapshot (trunk): http://bugs.php.net/fix.php?id=54423&r=trysnapshottrunk Fixed in SVN: http://bugs.php.net/fix.php?id=54423&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=54423&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=54423&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=54423&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=54423&r=needscript Try newer version: http://bugs.php.net/fix.php?id=54423&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=54423&r=support Expected behavior: http://bugs.php.net/fix.php?id=54423&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=54423&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=54423&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=54423&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=54423&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=54423&r=dst IIS Stability: http://bugs.php.net/fix.php?id=54423&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=54423&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=54423&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=54423&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=54423&r=mysqlcfg