I get the following segfault when using the XML parser (ext/xml) using
the latest PHP5 from CVS:

Program received signal SIGSEGV, Segmentation fault.
0x0812e914 in _efree (ptr=0x5a5a5a5a, __zend_filename=0x8178fa0
"/usr/local/src/php-cvs/php5/ext/xml/xml.c", __zend_lineno=183,
__zend_orig_filename=0x0,
    __zend_orig_lineno=0) at
/usr/local/src/php-cvs/php5/Zend/zend_alloc.c:253
253             CALCULATE_REAL_SIZE_AND_CACHE_INDEX(p->size);
(gdb) backtrace
#0  0x0812e914 in _efree (ptr=0x5a5a5a5a, __zend_filename=0x8178fa0
"/usr/local/src/php-cvs/php5/ext/xml/xml.c", __zend_lineno=183,
__zend_orig_filename=0x0,
    __zend_orig_lineno=0) at
/usr/local/src/php-cvs/php5/Zend/zend_alloc.c:253
#1  0x080fcc10 in php_xml_free_wrapper (ptr=0x5a5a5a5a) at
/usr/local/src/php-cvs/php5/ext/xml/xml.c:183
#2  0x400b7303 in xmlCharEncCloseFunc () from /usr/lib/libxml2.so.2
#3  0x400d9b75 in xmlFreeParserInputBuffer () from /usr/lib/libxml2.so.2
#4  0x400bad9d in xmlFreeInputStream () from /usr/lib/libxml2.so.2
#5  0x400bb6fd in xmlFreeParserCtxt () from /usr/lib/libxml2.so.2
#6  0x08101036 in XML_ParserFree (parser=0x820da14) at
/usr/local/src/php-cvs/php5/ext/xml/compat.c:574
#7  0x080fd10e in xml_parser_dtor (rsrc=0x8403554) at
/usr/local/src/php-cvs/php5/ext/xml/xml.c:325
#8  0x0814a84f in list_entry_destructor (ptr=0x8403554) at
/usr/local/src/php-cvs/php5/Zend/zend_list.c:178
#9  0x08148d07 in zend_hash_apply_deleter (ht=0x81ad3a0, p=0x84034fc) at
/usr/local/src/php-cvs/php5/Zend/zend_hash.c:565
#10 0x08148f2c in zend_hash_graceful_reverse_destroy (ht=0x81ad3a0) at
/usr/local/src/php-cvs/php5/Zend/zend_hash.c:631
#11 0x0814a98f in zend_destroy_rsrc_list (ht=0x81ad3a0) at
/usr/local/src/php-cvs/php5/Zend/zend_list.c:234
#12 0x081385ef in shutdown_executor () at
/usr/local/src/php-cvs/php5/Zend/zend_execute_API.c:265
#13 0x08142a43 in zend_deactivate () at
/usr/local/src/php-cvs/php5/Zend/zend.c:781
#14 0x0810ae53 in php_request_shutdown (dummy=0x0) at
/usr/local/src/php-cvs/php5/main/main.c:1174
#15 0x081616ac in main (argc=3, argv=0xbffffac4) at
/usr/local/src/php-cvs/php5/sapi/cli/php_cli.c:1013
(gdb) print p->size
Cannot access memory at address 0x5a5a5a36

My libxml2 is version 2.5.6-2 (Debian precompiled package).

I have included a little script that will trigger the error.  It only
seems to occur when the start and end tag handlers are in a class -- so
perhaps OO support in PHP should be dropped altogether.  :-)

Anyone has any ideas?
--
Best regards,

Per Lundberg / Capio ApS
Phone: +46-18-4186040
Fax: +46-18-4186049
Web: http://www.nobolt.com

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to