Segfault in PHP_5_0 and HEAD

php.internals

Sebastian Bergmann

21 years ago
The following code from PHPUnit2 causes a segfault with PHP_5_0 and HEAD. public function run(PHPUnit2_Framework_Test $test) { $this->currentTest = $test; $this->startTest($test); set_error_handler(array($this, 'errorHandler')); try { $test->runBare(); } catch (PHPUnit2_Framework_AssertionFailedError $e) { $this->addFailure($test, $e); } catch (Exception $e) { $this->addError($test, $e); } restore_error_handler(); $this->endTest($test); $this->currentTest = NULL; } public function errorHandler($code, $message) { $this->errors[] = new PHPUnit2_Framework_TestFailure( $this->currentTest, new Exception($message, $code) ); } The segfault is triggered by the one line in the body of the errorHandler() method. As with most segfaults I discover while working on PHPUnit2 I could not reproduce it with a small standalone script.
-- Sebastian Bergmann http://www.sebastian-bergmann.de/ GnuPG Key: 0xB85B5D69 / 27A7 2B14 09E4 98CD 6277 0E5B 6867 C514 B85B 5D69