PHP 4.0 Bug #8524: Segmentation fault
| From: | msopacua at idg dot nl | Date: | Tue, 02 Jan 2001 20:03:48 +0000 |
| Subject: | PHP 4.0 Bug #8524: Segmentation fault | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-42661@lists.php.net to get a copy of this message | ||
From: msopacua@idg.nl
Operating system: *BSD*
PHP version: 4.0.4
PHP Bug Type: XML related
Bug description: Segmentation fault
First of all:
Best wishes to you all!
Now for the annoying stuff:
This bug seems similar to 8492.
Offending code, remove the /* */ and it core-dumps:
$xml_file='bla.xml';
if (!(list($xml_parser, $fp) = new_xml_parser($xml_file))) {
die("could not open XML input");
}
print "<pre>";
while ($data = fread($fp, 4096)) {
/* if (!xml_parse($xml_parser, $data, feof($fp))) {
die(sprintf("<span style='color: red; font-weight: bold'>XML error: %s at line
%d</span>\n",
xml_error_string(xml_get_error_code($xml_parser)),
xml_get_current_line_number($xml_parser)));
}*/
echo $data;
}
print "</pre>";
xml_parser_free($xml_parser);
Output BSDi gdb backtrace:
Program terminated with signal 11, Segmentation fault.
#0 0x48253c7b in zend_hash_exists (ht=0x816273c, arKey=0x8047d0c
"\030}\004\b¬ò\004\b\f\020\013\b$}\004\b1ó\004\b\fà\n\b0}\004\böÌ\005\b\fà\n\bP}\004\b³ö\005\b",
nKeyLength=134542129) at zend_hash.c:907
907 p = ht->arBuckets[nIndex];
(gdb) bt
#0 0x48253c7b in zend_hash_exists (ht=0x816273c, arKey=0x8047d0c
"\030}\004\b¬ò\004\b\f\020\013\b$}\004\b1ó\004\b\fà\n\b0}\004\böÌ\005\b\fà\n\bP}\004\b³ö\005\b",
nKeyLength=134542129) at zend_hash.c:907
#1 0x804f2bd in ap_clear_pool ()
#2 0x804f331 in ap_destroy_pool ()
#3 0x804f2ac in ap_clear_pool ()
#4 0x804f331 in ap_destroy_pool ()
#5 0x805ccf6 in clean_parent_exit ()
#6 0x805f6b3 in standalone_main ()
#7 0x805fb89 in main ()
#8 0x804ebb7 in __start ()
The PHP code did not modify since php 4.03pl1, but only started being troublesome, in version 4.04.
Other changes with the upgrade:
-- chrooted environment
-- apache 1.3.12 -> 1.3.14
I will go back to php4.03pl1 and report if that makes a difference.
Melvyn.
--
Edit Bug report at: http://bugs.php.net/?id=8524&edit=1