From c59300ac86dd02bcdacd6c1460a5b43e91a5bf49 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Tue, 9 Sep 2014 00:12:36 +0400 Subject: [PATCH] Fixed GC problem (arrays may be recorded as possible root of garbage cycle. we have to clear this info before deleting array) --- ext/opcache/zend_persist.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ext/opcache/zend_persist.c b/ext/opcache/zend_persist.c index b49f28f4e3..b34e90578d 100644 --- a/ext/opcache/zend_persist.c +++ b/ext/opcache/zend_persist.c @@ -198,6 +198,9 @@ static void zend_persist_zval(zval *z TSRMLS_DC) Z_ARR_P(z) = zend_accel_memdup(Z_ARR_P(z), sizeof(zend_array)); zend_hash_persist_immutable(Z_ARRVAL_P(z) TSRMLS_CC); } else { + if (!zend_shared_alloc_get_xlat_entry(Z_ARR_P(z))) { + GC_REMOVE_FROM_BUFFER(Z_ARR_P(z)); + } zend_accel_store(Z_ARR_P(z), sizeof(zend_array)); zend_hash_persist(Z_ARRVAL_P(z), zend_persist_zval TSRMLS_CC); /* make immutable array */ @@ -251,6 +254,9 @@ static void zend_persist_zval_const(zval *z TSRMLS_DC) Z_ARR_P(z) = zend_accel_memdup(Z_ARR_P(z), sizeof(zend_array)); zend_hash_persist_immutable(Z_ARRVAL_P(z) TSRMLS_CC); } else { + if (!zend_shared_alloc_get_xlat_entry(Z_ARR_P(z))) { + GC_REMOVE_FROM_BUFFER(Z_ARR_P(z)); + } zend_accel_store(Z_ARR_P(z), sizeof(zend_array)); zend_hash_persist(Z_ARRVAL_P(z), zend_persist_zval TSRMLS_CC); /* make immutable array */ -- 2.50.1