Skip to content

Commit cf3c803

Browse files
realFlowControlarnaud-lb
authored andcommitted
abort() in OOM case
Closes GH-22637
1 parent 4288479 commit cf3c803

3 files changed

Lines changed: 6 additions & 1 deletion

File tree

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ PHP NEWS
1111
iterator). (iliaal)
1212
. Lock unmodified readonly properties for modification after clone-with.
1313
(NickSdot)
14+
. abort() instead of exit() on hard OOM. (realFlowControl)
1415

1516
- Calendar:
1617
. Fixed bug GH-22602 (gregoriantojd() and juliantojd() integer overflow with

UPGRADING

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,10 @@ PHP 8.6 UPGRADE NOTES
533533
13. Other Changes
534534
========================================
535535

536+
- Core:
537+
. In case of a hard OOM PHP now calls abort() instead of exit(1), changing
538+
the exit code to 134 and possibly creating a core dump.
539+
536540
========================================
537541
14. Performance Improvements
538542
========================================

Zend/zend_alloc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2974,7 +2974,7 @@ ZEND_API void refresh_memory_manager(void)
29742974
static ZEND_COLD ZEND_NORETURN void zend_out_of_memory(void)
29752975
{
29762976
fprintf(stderr, "Out of memory\n");
2977-
exit(1);
2977+
abort();
29782978
}
29792979

29802980
#if ZEND_MM_CUSTOM

0 commit comments

Comments
 (0)