Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ PHP NEWS
conversion in JIT). (Jorg Sowa)
. Fixed bug GH-25037 (Function JIT ENTRY live var assertion).
(Ilia Alshanetsky)
. Fixed bug GH-12010 (opcache crashes on high volume IIS servers (Windows)).
(Kamil Tekiela)

- SOAP:
. Fixed bug GH-25267 (NULL dereference in to_xml_any() with integer key).
Expand Down
13 changes: 13 additions & 0 deletions ext/opcache/ZendAccelerator.c
Original file line number Diff line number Diff line change
Expand Up @@ -3264,6 +3264,9 @@ static zend_result accel_post_startup(void)
file_cache_only = ZCG(accel_directives).file_cache_only;
if (!file_cache_only) {
size_t shm_size = ZCG(accel_directives).memory_consumption;
#ifdef ZEND_WIN32
bool created = false;
#endif
#ifdef HAVE_JIT
size_t jit_size = 0;
bool reattached = false;
Expand All @@ -3287,6 +3290,9 @@ static zend_result accel_post_startup(void)
switch (zend_shared_alloc_startup(shm_size, 0)) {
#endif
case ALLOC_SUCCESS:
#ifdef ZEND_WIN32
created = true;
#endif
if (zend_accel_init_shm() == FAILURE) {
accel_startup_ok = false;
return FAILURE;
Expand Down Expand Up @@ -3346,6 +3352,13 @@ static zend_result accel_post_startup(void)
zend_shared_alloc_save_state();
zend_shared_alloc_unlock();

#ifdef ZEND_WIN32
if (created) {
/* create_segments() kept the mutex locked until the segment is initialized. */
zend_shared_alloc_unlock_win32();
}
#endif

SHM_PROTECT();
} else if (!ZCG(accel_directives).file_cache) {
accel_startup_ok = false;
Expand Down
4 changes: 2 additions & 2 deletions ext/opcache/shared_alloc_win32.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,8 @@ static int create_segments(size_t requested_size, zend_shared_segment ***shared_
shared_segment->pos = ACCEL_BASE_POINTER_SIZE;
shared_segment->size = requested_size - ACCEL_BASE_POINTER_SIZE;

zend_shared_alloc_unlock_win32();

/* Keep the mutex locked. Other processes must not reattach before the
* segment is initialized. accel_post_startup() unlocks it after that. */
return ALLOC_SUCCESS;
}

Expand Down
Loading