#32494 [NEW]: crash when using expat in a class

From: Date: Wed, 30 Mar 2005 00:05:34 +0000
Subject: #32494 [NEW]: crash when using expat in a class
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-76007@lists.php.net to get a copy of this message
From: evert at rooftopsolutions dot nl Operating system: Linux glibc 2.3.4 PHP version: 4.3.10 PHP Bug Type: Reproducible crash Bug description: crash when using expat in a class Description: ------------ My PHP crashes when using expat functions in a class. My scripts opens the 'test' file, but it doesn't matter if it exists or not. Right now I'm unable to check this with the latest cvs, but I did test this on multiple servers running 4.3.10 Reproduce code: --------------- <? class sParser { function onStartElement($parser,$name,$attribs) { return false; } function onEndElement($parser,$name) { return false; } function onCDATA($parser,$data) { return false; } function onProcessInstruction($parser,$target,$data) { return false; } function onXMLError($line,$errorcode,$errorstring) { return false; } function xmlparse($data) { $this->parser = xml_parser_create('UTF-8'); xml_parser_set_option($this->parser,XML_OPTION_CASE_FOLDING,false); xml_set_element_handler($this->parser,array($this, 'onStartElement'),array($this,'onEndElement')); xml_set_character_data_handler($this->parser,array($this,'onCDATA')); xml_set_processing_instruction_handler($this->parser,array($this,'onProcessInstruction')); if (!xml_parse($this->parser,$data)) { $this->onXMLError(xml_get_current_line_number($this->parser), xml_get_error_code($this->parser), xml_error_string(xml_get_error_code($ this->parser))); return false; } else return $this->parsedData; } function execute($data) { return $this->xmlparse($data); } } $disp = new sParser(); $disp->execute(file_get_contents('test')); ?> Expected result: ---------------- No errors Actual result: -------------- PHP Crash my apache logs says: [Tue Mar 29 07:07:25 2005] [notice] child pid 9106 exit signal Aborted (6) *** glibc detected *** double free or corruption (!prev): 0x08205058 *** -- Edit bug report at http://bugs.php.net/?id=32494&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=32494&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=32494&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=32494&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=32494&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=32494&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=32494&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=32494&r=needscript Try newer version: http://bugs.php.net/fix.php?id=32494&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=32494&r=support Expected behavior: http://bugs.php.net/fix.php?id=32494&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=32494&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=32494&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=32494&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=32494&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=32494&r=dst IIS Stability: http://bugs.php.net/fix.php?id=32494&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=32494&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=32494&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=32494&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=32494&r=mysqlcfg

« previous php.bugs (#76007) next »