[GIT-PULLS] [php-src] PR #22637: Zend/zend_alloc: `abort()` instead of `exit()` on hard OOM

[email protected] (realFlowControl)
Newsgroups php.git-pulls
Message-ID <dEweJ3HgTk954ouPXmpZ1XLcJdmET1mRMcbMKGA4Umw@main.internal.php.net>
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`).
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.