Skip to content

Commit da40e6e

Browse files
committed
Fix #81206: Multiple PHP processes crash with JIT enabled
The fix for bug 80175 (PR php#6268) broke most SAPIs wrt. JIT, most notably cgi-fcgi, because for these SAPIs `SUCCESSFULLY_REATTACHED` actually has to set the `reattached` flag.
1 parent 65bd8d2 commit da40e6e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ext/opcache/ZendAccelerator.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3008,8 +3008,10 @@ static zend_result accel_post_startup(void)
30083008
zend_accel_error(ACCEL_LOG_FATAL, "Failure to initialize shared memory structures - probably not enough shared memory.");
30093009
return SUCCESS;
30103010
case SUCCESSFULLY_REATTACHED:
3011-
#if defined(HAVE_JIT) && !defined(ZEND_WIN32)
3012-
reattached = 1;
3011+
#ifdef HAVE_JIT
3012+
if (sapi_module.name && strcmp(sapi_module.name, "apache2handler") == 0) {
3013+
reattached = 1;
3014+
}
30133015
#endif
30143016
zend_shared_alloc_lock();
30153017
accel_shared_globals = (zend_accel_shared_globals *) ZSMMG(app_shared_globals);

0 commit comments

Comments
 (0)