[php-src] PR #22637: Zend/zend_alloc: `abort()` instead of `exit()` on hard OOM
| From: | realFlowControl | Date: | Wed, 08 Jul 2026 10:30:40 +0000 |
| Subject: | [php-src] PR #22637: Zend/zend_alloc: `abort()` instead of `exit()` on hard OOM | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-36905@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/22637
Author: realFlowControl
zend_out_of_memory() (raw malloc/realloc failure, not
memory_limit) now calls abort() instead of exit(1).
exit() gives no signal a crash handler can catch and produces no core dump.
abort() raises SIGABRT, which a signal handler can intercept and create a
crash report. Even without anything special, you may configure your OS to create a core file when a
SIGABRT arrives.
This matches the existing abort() pattern already used by zend_mm_panic()
for heap corruption. https://github.com/php/php-src/blob/edcd94d5816ac072f34cd3a93f59905575bbfe39/Zend/zend_alloc.c#L381-L392
Note: observed exit status changes from 1 to signal-terminated (134).