ID: 42305 Updated by: [EMAIL PROTECTED] Reported By: danil dot megrabjan at gmail dot com -Status: Open +Status: Assigned -Bug Type: Reproducible crash +Bug Type: DOM XML related Operating System: SLES10 PHP Version: 5.2CVS-2007-08-16 -Assigned To: +Assigned To: rrichards New Comment:
Rob, can you check this out please? (It might be something more general than just DOM issue but we need to begin somewhere :) And Danil, can you try provide the shortest possible example script that causes this crash? Previous Comments: ------------------------------------------------------------------------ [2007-08-20 12:36:06] danil dot megrabjan at gmail dot com from phpinfo(); Debug Build yes I have catch reason of segmentation fault. I have some big code. Very big... And i have a some objects extends of DOMDocument in that. f.e class A extends DOMDocument { private $_obj; // other object ... } $a = new A(); ... very many logic`s ... $a = null; This code was finished with segmentation fault. But if... class A extends DOMDocument { private $_obj; // other object ... public function __destruct() { $this->_obj = null; } } It`s everything ok. or Without modification`s in class A declaration, we don`t do it "$a = null;" it`s all correct too. ------------------------------------------------------------------------ [2007-08-16 13:25:35] danil dot megrabjan at gmail dot com I`m install new php and i have the same problem :( Usage: /usr/bin/php-config [OPTION] Options: --prefix [/usr] --includes [-I/php -I/php/main -I/php/TSRM -I/php/Zend -I/php/ext -I/php/ext/date/lib] --ldflags [] --libs [-lcrypt -lcrypt -lmm -lresolv -lm -ldl -lnsl -lxml2 -lz -lm -lxml2 -lz -lm -lcrypt -lxml2 -lz -lm -lcrypt ] --extension-dir [/usr/lib/php/extensions/debug-non-zts-20060613] --include-dir [/php] --php-binary [=/usr/bin/php5] --php-sapis [cli apache2handler] --configure-options [--prefix=/usr --datadir=/usr/share/php5 --mandir==/usr/share/man --bindir==/usr/bin --with-libdir=lib --includedir= --sysconfdir=/etc/php5/apache2 --with-config-file-path=/etc/php5/apache2 --with-config-file-scan-dir=/etc/php5/conf.d --enable-libxml --enable-session --with-mm --with-pcre-regex --enable-xml --enable-simplexml --enable-spl --enable-filter --enable-debug --enable-memory-limit --program-suffix=5 --with-apxs2=/usr/sbin/apxs2 --bindir==/usr/bin --with-pear=/usr/share/php5/PEAR --enable-bcmath=shared --enable-calendar=shared --enable-ctype=shared --enable-dbase=shared --enable-dom=shared --enable-exif=shared --enable-ftp=shared --enable-mbstring=shared --enable-mbregex --enable-pcntl=shared --enable-posix=shared --enable-shmop=shared --enable-soap=shared --enable-sockets=shared --enable-sysvmsg=shared --enable-sysvsem=shared --enable-sysvshm=shared --enable-tokenizer=shared --enable-wddx=shared --with-zlib=shared --with-bz2=shared --with-curl=shared --with-gd=shared --enable-gd-native-ttf --with-xpm-dir=/usr/X11R6 --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr --with-zlib-dir=/usr --with-gettext=shared --with-gmp=shared --enable-hash=shared --with-iconv=shared --with-imap=shared --with-kerberos --with-imap-ssl --enable-json=shared --with-ldap=shared --with-ldap-sasl=/usr --with-mcrypt=shared --with-mhash=shared --with-mysql=shared,/usr --with-mysql-sock=/var/lib/mysql/mysql.sock --with-mysqli=shared --with-ncurses=shared --with-unixODBC=shared,/usr --with-openssl=shared --with-xmlrpc=shared --enable-xmlreader=shared --enable-xmlwriter=shared --with-xsl=shared --enable-dba=shared --with-db4=/usr --without-gdbm --with-cdb --with-inifile --with-flatfile --with-pdo_sqlite=shared,/usr --with-sqlite=shared,/usr --enable-sqlite-utf8 --enable-pdo=shared --with-pdo-mysql=shared,/usr --with-pdo-odbc=shared,unixODBC,/usr --enable-zip=shared --enable-cli] --version [5.2.4RC2-dev] --vernum [50204] (gdb) run -X Starting program: /usr/sbin/httpd2 -X [Thread debugging using libthread_db enabled] [New Thread -1213954384 (LWP 8317)] [New Thread -1291711584 (LWP 8320)] [New Thread -1291977824 (LWP 8321)] [New Thread -1292244064 (LWP 8322)] Program received signal SIGSEGV, Segmentation fault. [Switching to Thread -1213954384 (LWP 8317)] 0xb78a6708 in zend_copy_constants () from /usr/lib/apache2/libphp5.so (gdb) bt #0 0xb78a6708 in zend_copy_constants () from /usr/lib/apache2/libphp5.so #1 0xb78c3c52 in zend_hash_reverse_apply () from /usr/lib/apache2/libphp5.so #2 0xb78a6bb3 in clean_non_persistent_constants () from /usr/lib/apache2/libphp5.so #3 0xb78a7e4b in shutdown_executor () from /usr/lib/apache2/libphp5.so #4 0xb78b6fa7 in zend_deactivate () from /usr/lib/apache2/libphp5.so #5 0xb7865169 in php_request_shutdown () from /usr/lib/apache2/libphp5.so #6 0xb7930645 in zend_get_zval_ptr_ptr () from /usr/lib/apache2/libphp5.so #7 0xb7930f33 in zend_get_zval_ptr_ptr () from /usr/lib/apache2/libphp5.so #8 0x8002f94d in ap_run_handler (r=0x802587a0) at config.c:157 #9 0x80033227 in ap_invoke_handler (r=0x802587a0) at config.c:372 #10 0x8003f084 in ap_internal_redirect (new_uri=0x80258780 "/infin.php?query=start/1/666666", r=0x802539b0) at http_request.c:477 #11 0xb7446c10 in ?? () from /usr/lib/apache2-prefork/mod_rewrite.so #12 0x80258780 in ?? () #13 0x802539b0 in ?? () #14 0xb744b67f in ?? () from /usr/lib/apache2-prefork/mod_rewrite.so #15 0x802586b8 in ?? () #16 0x00000000 in ?? () (gdb) ------------------------------------------------------------------------ [2007-08-15 11:30:26] danil dot megrabjan at gmail dot com I`m comment all zend extension in php.ini. And i have new in backtrace... Program received signal SIGSEGV, Segmentation fault. [Switching to Thread -1213826272 (LWP 10758)] 0xb7c59f6e in free () from /lib/libc.so.6 (gdb) bt #0 0xb7c59f6e in free () from /lib/libc.so.6 #1 0xb762320b in xmlFreeNodeList () from /usr/lib/libxml2.so.2 #2 0xb7623126 in xmlFreeNodeList () from /usr/lib/libxml2.so.2 #3 0xb7623126 in xmlFreeNodeList () from /usr/lib/libxml2.so.2 #4 0xb7622f4e in xmlFreeDoc () from /usr/lib/libxml2.so.2 #5 0xb779aa6a in php_libxml_decrement_doc_ref (object=0xb446cb00) at /usr/src/debug/php-5.2.3/ext/libxml/libxml.c:966 #6 0xb779acbd in php_libxml_node_decrement_resource (object=0xb446cb00) at /usr/src/debug/php-5.2.3/ext/libxml/libxml.c:1039 #7 0xb7321264 in dom_objects_free_storage (object=0xb446cb00) at /usr/src/debug/php-5.2.3/ext/dom/php_dom.c:974 #8 0xb78f10da in zend_objects_store_del_ref_by_handle (handle=21) at /usr/src/debug/php-5.2.3/Zend/zend_objects_API.c:206 #9 0xb78f1128 in zend_objects_store_del_ref (zobject=0xb44213c8) at /usr/src/debug/php-5.2.3/Zend/zend_objects_API.c:168 #10 0xb78d07b9 in _zval_dtor_func (zvalue=0xb44213c8) at /usr/src/debug/php-5.2.3/Zend/zend_variables.c:52 #11 0xb78c3458 in _zval_ptr_dtor (zval_ptr=0xb4421134) at /usr/src/debug/php-5.2.3/Zend/zend_variables.h:35 #12 0xb78dbe64 in zend_hash_destroy (ht=0xb4420ff8) at /usr/src/debug/php-5.2.3/Zend/zend_hash.c:717 #13 0xb78eda13 in zend_object_std_dtor (object=0xb4420ed4) at /usr/src/debug/php-5.2.3/Zend/zend_objects.c:45 #14 0xb78eda52 in zend_objects_free_object_storage (object=0xb4420ed4) at /usr/src/debug/php-5.2.3/Zend/zend_objects.c:122 #15 0xb78f10da in zend_objects_store_del_ref_by_handle (handle=19) at /usr/src/debug/php-5.2.3/Zend/zend_objects_API.c:206 #16 0xb78f1128 in zend_objects_store_del_ref (zobject=0xb4420910) at /usr/src/debug/php-5.2.3/Zend/zend_objects_API.c:168 #17 0xb78d07b9 in _zval_dtor_func (zvalue=0xb4420910) at /usr/src/debug/php-5.2.3/Zend/zend_variables.c:52 #18 0xb78c3458 in _zval_ptr_dtor (zval_ptr=0xb444e5d8) at /usr/src/debug/php-5.2.3/Zend/zend_variables.h:35 #19 0xb78dbe64 in zend_hash_destroy (ht=0xb444e2fc) at /usr/src/debug/php-5.2.3/Zend/zend_hash.c:717 #20 0xb78c7866 in destroy_zend_class (pce=0x8039960c) at /usr/src/debug/php-5.2.3/Zend/zend_opcode.c:182 #21 0xb78dbae5 in zend_hash_apply_deleter (ht=0x800b5f98, p=0x80399600) at /usr/src/debug/php-5.2.3/Zend/zend_hash.c:805 #22 0xb78dbbee in zend_hash_reverse_apply (ht=0x800b5f98, apply_func=0xb78c29a0 <clean_non_persistent_class>) at /usr/src/debug/php-5.2.3/Zend/zend_hash.c:954 #23 0xb78c3b19 in shutdown_executor () at /usr/src/debug/php-5.2.3/Zend/zend_execute_API.c:291 #24 0xb78d0ecf in zend_deactivate () at /usr/src/debug/php-5.2.3/Zend/zend.c:941 #25 0xb788779d in php_request_shutdown (dummy=0x0) at /usr/src/debug/php-5.2.3/main/main.c:1323 #26 0xb795741c in php_handler (r=0x80354260) at /usr/src/debug/php-5.2.3/sapi/apache2handler/sapi_apache2.c:467 #27 0x8002f94d in ap_run_handler (r=0x80354260) at config.c:157 #28 0x80033227 in ap_invoke_handler (r=0x80354260) at config.c:372 #29 0x8003f084 in ap_internal_redirect (new_uri=0x80354240 "/infin.php?query=start/1/666666", r=0x8034b470) at http_request.c:477 #30 0xb7500c10 in ?? () from /usr/lib/apache2-prefork/mod_rewrite.so #31 0x80354240 in ?? () #32 0x8034b470 in ?? () #33 0xb750567f in ?? () from /usr/lib/apache2-prefork/mod_rewrite.so #34 0x80354178 in ?? () #35 0x00000000 in ?? () ------------------------------------------------------------------------ [2007-08-15 08:47:28] danil dot megrabjan at gmail dot com Description: ------------ After proccessing php-script i have my total result in browser, but in apache logs i see that "[Wed Aug 15 11:16:11 2007] [notice] child pid 8922 exit signal Segmentation fault (11)" I use gdb so that i have any details about this problem. I think, that main problem consist in php garbage collector whe it try to free... Reproduce code: --------------- Very many code... i dont`n now how i may send this big code. Just as i don't know how i can this code made is shorten in 20 lines. Actual result: -------------- Program received signal SIGSEGV, Segmentation fault. [Switching to Thread -1213375712 (LWP 9388)] 0xb7cc7f49 in free () from /lib/libc.so.6 (gdb) bt #0 0xb7cc7f49 in free () from /lib/libc.so.6 #1 0xb79302c1 in free_zend_constant (c=0x804a9bd7) at /usr/src/debug/php-5.2.3/Zend/zend_constants.c:35 #2 0xb7949ae5 in zend_hash_apply_deleter (ht=0x4ab08800, p=0x804a9ba0) at /usr/src/debug/php-5.2.3/Zend/zend_hash.c:805 #3 0xb7949bee in zend_hash_reverse_apply (ht=0x800b7068, apply_func=0xb792f240 <clean_non_persistent_constant>) at /usr/src/debug/php-5.2.3/Zend/zend_hash.c:954 #4 0xb7930138 in clean_non_persistent_constants () at /usr/src/debug/php-5.2.3/Zend/zend_constants.c:231 #5 0xb7931ab4 in shutdown_executor () at /usr/src/debug/php-5.2.3/Zend/zend_execute_API.c:303 #6 0xb793eecf in zend_deactivate () at /usr/src/debug/php-5.2.3/Zend/zend.c:941 #7 0xb78f579d in php_request_shutdown (dummy=0x0) at /usr/src/debug/php-5.2.3/main/main.c:1323 #8 0xb79c541c in php_handler (r=0x8048fd38) at /usr/src/debug/php-5.2.3/sapi/apache2handler/sapi_apache2.c:467 #9 0x8002f94d in ap_run_handler (r=0x8048fd38) at config.c:157 #10 0x80033227 in ap_invoke_handler (r=0x8048fd38) at config.c:372 #11 0x8003f084 in ap_internal_redirect (new_uri=0x8048fd18 "/infin.php?query=start/1/666666", r=0x80486f48) at http_request.c:477 #12 0xb756ec10 in ?? () from /usr/lib/apache2-prefork/mod_rewrite.so #13 0x8048fd18 in ?? () #14 0x80486f48 in ?? () #15 0xb757367f in ?? () from /usr/lib/apache2-prefork/mod_rewrite.so #16 0x8048fc50 in ?? () #17 0x00000000 in ?? () ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=42305&edit=1