Skip to content

Commit 8b1d352

Browse files
committed
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1: Prevent potential deadlock if accelerated globals cannot be allocated
2 parents 5f716bf + b0bc057 commit 8b1d352

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ PHP NEWS
5252
- Opcache:
5353
. Fixed bug GH-10914 (OPCache with Enum and Callback functions results in
5454
segmentation fault). (nielsdos)
55+
. Prevent potential deadlock if accelerated globals cannot be allocated.
56+
(nielsdos)
5557

5658
- PCNTL:
5759
. Fixed bug GH-11498 (SIGCHLD is not always returned from proc_open).

ext/opcache/ZendAccelerator.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2867,10 +2867,10 @@ static int zend_accel_init_shm(void)
28672867

28682868
accel_shared_globals = zend_shared_alloc(accel_shared_globals_size);
28692869
if (!accel_shared_globals) {
2870+
zend_shared_alloc_unlock();
28702871
zend_accel_error_noreturn(ACCEL_LOG_FATAL,
28712872
"Insufficient shared memory for interned strings buffer! (tried to allocate %zu bytes)",
28722873
accel_shared_globals_size);
2873-
zend_shared_alloc_unlock();
28742874
return FAILURE;
28752875
}
28762876
memset(accel_shared_globals, 0, sizeof(zend_accel_shared_globals));

0 commit comments

Comments
 (0)