php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #14862 xmldocfile segfaults sometimes
Submitted: 2002-01-04 18:09 UTC Modified: 2002-01-05 04:24 UTC
From: chregu@php.net Assigned:
Status: Closed Package: DOM XML related
PHP Version: 4.0CVS-2002-01-04 OS: linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: chregu@php.net
New email:
PHP Version: OS:

 

 [2002-01-04 18:09 UTC] chregu@php.net
xmldocfile produces from time to time segfaults at shutdown (not always, sometimes more, sometimes less...)

code:
$xmlDoc = xmldocfile("test.xml");

xml: any.

"workaround" (does the same jobs right, just in more lines :) )

$fd = fopen( $datasrc, "r" );
$xmlstring = fread( $fd, filesize( $datasrc ) );
fclose( $fd );
$xmlDoc = xmldoc($xmlstring);

backtrace:

0x40224b0b in zend_hash_index_find (ht=0x403747a4, h=1075888551, 
    pData=0xbfffef38) at zend_hash.c:935
935                     if ((p->h == h) && (p->nKeyLength == 0)) {
(gdb) bt
#0  0x40224b0b in zend_hash_index_find (ht=0x403747a4, h=1075888551, 
    pData=0xbfffef38) at zend_hash.c:935
#1  0x402257e8 in _zend_list_delete (id=1075888551) at zend_list.c:53
#2  0x4021bc43 in _zval_dtor (zvalue=0x812653c, 
    __zend_filename=0x403385bc "zend_execute_API.c", __zend_lineno=274)
    at zend_variables.c:64
#3  0x40211e0c in _zval_ptr_dtor (zval_ptr=0x8126990, 
    __zend_filename=0x40338a13 "zend_variables.c", __zend_lineno=189)
    at zend_execute_API.c:274
#4  0x4021c08d in _zval_ptr_dtor_wrapper (zval_ptr=0x8126990)
    at zend_variables.c:189
#5  0x40223a1a in zend_hash_destroy (ht=0x812657c) at zend_hash.c:541
#6  0x4021bc0f in _zval_dtor (zvalue=0x812dc04, 
    __zend_filename=0x403385bc "zend_execute_API.c", __zend_lineno=274)
    at zend_variables.c:57
#7  0x40211e0c in _zval_ptr_dtor (zval_ptr=0x8126ba8, 
    __zend_filename=0x40338a13 "zend_variables.c", __zend_lineno=189)
    at zend_execute_API.c:274
#8  0x4021c08d in _zval_ptr_dtor_wrapper (zval_ptr=0x8126ba8)
    at zend_variables.c:189
#9  0x40223a1a in zend_hash_destroy (ht=0x40374688) at zend_hash.c:541
#10 0x40211977 in shutdown_executor () at zend_execute_API.c:173
#11 0x4021d2f3 in zend_deactivate () at zend.c:596
#12 0x4022f95b in php_request_shutdown (dummy=0x0) at main.c:736
#13 0x4022b8e8 in apache_php_module_main (r=0x811b234, display_source_mode=0)
    at sapi_apache.c:96
#14 0x4022c7a8 in send_php (r=0x811b234, display_source_mode=0, 
    filename=0x811bd4c "/usr/local/apache/htdocs/buch/domxml/newfunctions.php")
    at mod_php4.c:575
#15 0x4022c82b in send_parsed_php (r=0x811b234) at mod_php4.c:590
#16 0x08073b29 in ap_invoke_handler ()
#17 0x0808893f in process_request_internal ()
#18 0x080889a6 in ap_process_request ()
#19 0x0807f886 in child_main ()
#20 0x0807fa41 in make_child ()
#21 0x0807fbbc in startup_children ()
#22 0x0808024d in standalone_main ()
#23 0x08080aac in main ()
#24 0x400be65f in __libc_start_main () from /lib/libc.so.6


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-01-04 18:55 UTC] mfischer@php.net
Seems to depend on the input data. No matter how much stress testing I do, I can't reproduce a crash.

Please provide some crashing input data too.
 [2002-01-04 19:01 UTC] chregu@php.net
it's sometimes not easy to cause a segfault, but if you once have one, then they come very often :) and with the following xml-data, it shouldn't take long...

<?xml version="1.0"?>
<buecher bla="bla">
<buch buch_id="1" isbn="3-8266-0612-4">
<titel>Apache Web-Server</titel>
<jahr>2000</jahr>
<kategorie>2</kategorie>
</buch>
</buecher>



 [2002-01-04 19:09 UTC] mfischer@php.net
Doesn't segfault either ... (used ab for testing, this should really be it).

What's your configure line, which apache version?
 [2002-01-05 04:24 UTC] chregu@php.net
Ok, i give up. Today, I can't reproduce it, either.
If it occurs again, i will reopen this bug.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 02 14:01:36 2025 UTC