com php-src: move accel_shared_globals assignment into locked block: ext/opcache/ZendAccelerator.c
| From: | Anatol Belski | Date: | Thu, 24 Sep 2015 14:33:57 +0000 |
| Subject: | com php-src: move accel_shared_globals assignment into locked block: ext/opcache/ZendAccelerator.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-89161@lists.php.net to get a copy of this message | ||
Commit: 3ef3d80f2594c7bfb8c1d718a4a17f34f0e67e4f
Author: Anatol Belski <ab@php.net> Thu, 24 Sep 2015 12:46:54 +0200
Parents: a7552ca31097b0be405dc324be11c77109e09a4e
Branches: PHP-7.0 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=3ef3d80f2594c7bfb8c1d718a4a17f34f0e67e4f
Log:
move accel_shared_globals assignment into locked block
this might fix crashes under high concurrency
Changed paths:
M ext/opcache/ZendAccelerator.c
Diff:
diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c
index 2bbfb44..c09b08d 100644
--- a/ext/opcache/ZendAccelerator.c
+++ b/ext/opcache/ZendAccelerator.c
@@ -2630,8 +2630,8 @@ static int accel_startup(zend_extension *extension)
zend_accel_error(ACCEL_LOG_FATAL, "Failure to initialize shared memory structures -
probably not enough shared memory.");
return SUCCESS;
case SUCCESSFULLY_REATTACHED:
- accel_shared_globals = (zend_accel_shared_globals *) ZSMMG(app_shared_globals);
zend_shared_alloc_lock();
+ accel_shared_globals = (zend_accel_shared_globals *) ZSMMG(app_shared_globals);
orig_new_interned_string = zend_new_interned_string;
orig_interned_strings_snapshot = zend_interned_strings_snapshot;
orig_interned_strings_restore = zend_interned_strings_restore;