|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76536 PHP crashes with core dump when throwing exception in error handler
Submitted: 2018-06-27 09:36 UTC Modified: -
From: diacomltd at mail dot ru Assigned:
Status: Closed Package: Reproducible crash
PHP Version: 7.2.7 OS: Linux (different vesions)
Private report: No CVE-ID: None
 [2018-06-27 09:36 UTC] diacomltd at mail dot ru
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();}


$r = new \ReflectionClass(SomeConstants::class);

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)


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2018-06-28 04:39 UTC]
Automatic comment on behalf of
Log: Fixed bug #76536 (PHP crashes with core dump when throwing exception in error handler). (Laruence)
 [2018-06-28 04:39 UTC]
-Status: Open +Status: Closed
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Feb 25 09:01:26 2024 UTC