Bug #76536 [Opn->Csd]: PHP crashes with core dump when throwing exception in error handler

From: Date: Thu, 28 Jun 2018 04:39:09 +0000
Subject: Bug #76536 [Opn->Csd]: PHP crashes with core dump when throwing exception in error handler
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-215997@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=76536&edit=1 ID: 76536 Updated by: laruence@php.net Reported by: diacomltd at mail dot ru Summary: PHP crashes with core dump when throwing exception in error handler -Status: Open +Status: Closed Type: Bug Package: Reproducible crash Operating System: Linux (different vesions) PHP Version: 7.2.7 Block user comment: N Private report: N New Comment: Automatic comment on behalf of laruence@gmail.com Revision: http://git.php.net/?p=php-src.git;a=commit;h=1f6b842af430b8cbba0fb1c38a2796ab399171c3 Log: Fixed bug #76536 (PHP crashes with core dump when throwing exception in error handler). (Laruence) Previous Comments: ------------------------------------------------------------------------ [2018-06-27 09:36:59] diacomltd at mail dot ru Description: ------------ PHP crashes with core dump when throwing exception in error handler. The bug reproduces with PHP starting from version 7.1, but not before. Checked under different Linux versions Came into it when using PHP introspection functions on class with incorrect constants declaration. Don't know if the bug relates to this specific mistake or not. Test script: --------------- class SomeConstants {const SOME_CONSTANT = SOME_NONSENSE;} function handleError() {throw new ErrorException();} set_error_handler('handleError'); set_exception_handler('handleError'); $r = new \ReflectionClass(SomeConstants::class); $r->getConstants(); Expected result: ---------------- Fatal error: Uncaught exception 'ErrorException' in /code/1.php:10 Stack trace: #0 [internal function]: handleError(Object(ErrorException)) #1 {main} thrown in /code/1.php on line 10 Actual result: -------------- Segmentation fault (core dumped) ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=76536&edit=1

« previous php.bugs (#215997) next »