Bug #76536 [NEW]: PHP crashes with core dump when throwing exception in error handler

From: Date: Wed, 27 Jun 2018 09:37:02 +0000
Subject: Bug #76536 [NEW]: PHP crashes with core dump when throwing exception in error handler
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-215987@lists.php.net to get a copy of this message
From: diacomltd at mail dot ru Operating system: Linux (different vesions) PHP version: 7.2.7 Package: Reproducible crash Bug Type: Bug Bug description:PHP crashes with core dump when throwing exception in error handler 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 bug report at https://bugs.php.net/bug.php?id=76536&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=76536&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=76536&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=76536&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=76536&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=76536&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=76536&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=76536&r=needscript Try newer version: https://bugs.php.net/fix.php?id=76536&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=76536&r=support Expected behavior: https://bugs.php.net/fix.php?id=76536&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=76536&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=76536&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=76536&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=76536&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=76536&r=dst IIS Stability: https://bugs.php.net/fix.php?id=76536&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=76536&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=76536&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=76536&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=76536&r=mysqlcfg

« previous php.bugs (#215987) next »