Bug #77693 [NEW]: Crash on multiple separate exception thrown inside custom error handler

From: Date: Tue, 05 Mar 2019 12:50:29 +0000
Subject: Bug #77693 [NEW]: Crash on multiple separate exception thrown inside custom error handler
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-219845@lists.php.net to get a copy of this message
From: jean dot beguin at free dot fr Operating system: Windows 7 & Ubuntu 18.04 PHP version: 7.3.2 Package: Reproducible crash Bug Type: Bug Bug description:Crash on multiple separate exception thrown inside custom error handler Description: ------------ When running the test script, the apache server processes crashes with exit status 3221225725. The timing is of no importance as this still crash after around the same number of cycles, even with a sleep inside the loop. This crash persists even with the use of gc_collect_cycles(). Tested on: Windows 7, Apache 2.4.38, PHP 7.3.2 via XAMPP Windows 7, Apache 2.4.29, PHP 7.2.2 via XAMPP Ubuntu Server 18.04, Apache/2.4.29 (Ubuntu), PHP 7.2.15-0ubuntu0.18.04.1 Test script: --------------- <?php error_reporting(E_ALL); function errorHandler(int $errorNumber, string $errorMessage) { throw new \Exception(); } $previousHandler = set_error_handler("errorHandler"); // 1000 is enough to crash on Windows 7 with XAMPP, but more is needed for Ubuntu $operations = 10000; for($i = 0; $i < $operations; $i++) { try{ //Used to generate a warning. $inexistant[0]; } catch (\Exception $e) {} } set_error_handler($previousHandler); Expected result: ---------------- The process should not crash, as exception are thrown, caught and discarded, and should be garbage collected. Actual result: -------------- Apache error.loh: [mpm_winnt:notice] [pid 6000:tid 244] AH00428: Parent: child process 3904 exited with status 3221225725 -- Restarting. -- Edit bug report at https://bugs.php.net/bug.php?id=77693&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=77693&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=77693&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=77693&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=77693&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=77693&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=77693&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=77693&r=needscript Try newer version: https://bugs.php.net/fix.php?id=77693&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=77693&r=support Expected behavior: https://bugs.php.net/fix.php?id=77693&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=77693&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=77693&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=77693&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=77693&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=77693&r=dst IIS Stability: https://bugs.php.net/fix.php?id=77693&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=77693&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=77693&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=77693&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=77693&r=mysqlcfg

« previous php.bugs (#219845) next »