Skip to content

Commit 8c0ba65

Browse files
committed
Fixed bug #69688 (segfault with eval and opcache fast shutdown)
1 parent ed4052f commit 8c0ba65

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,8 @@
143143
. Removed mcrypt_ecb(), mcrypt_cbc(), mcrypt_cfb(), mcrypt_ofb(). (Nikita)
144144

145145
- Opcache:
146+
. Fixed bug #69688 (segfault with eval and opcache fast shutdown).
147+
(Laruence)
146148
. Added experimental (disabled by default) file based opcode cache.
147149
(Dmitry, Laruence, Anatol)
148150
. Fixed bug with try blocks being removed when extended_info opcode

ext/opcache/ZendAccelerator.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2146,7 +2146,6 @@ static inline void zend_accel_fast_del_bucket(HashTable *ht, uint32_t idx, Bucke
21462146
uint32_t nIndex = p->h | ht->nTableMask;
21472147
uint32_t i = HT_HASH(ht, nIndex);
21482148

2149-
ht->nNumUsed--;
21502149
ht->nNumOfElements--;
21512150
if (idx != i) {
21522151
Bucket *prev = HT_HASH_TO_BUCKET(ht, i);
@@ -2267,6 +2266,9 @@ static void zend_accel_fast_shutdown(void)
22672266
zend_accel_fast_del_bucket(EG(zend_constants), HT_IDX_TO_HASH(_idx-1), _p);
22682267
}
22692268
} ZEND_HASH_FOREACH_END();
2269+
EG(function_table)->nNumUsed = EG(function_table)->nNumOfElements;
2270+
EG(class_table)->nNumUsed = EG(class_table)->nNumOfElements;
2271+
EG(zend_constants)->nNumUsed = EG(zend_constants)->nNumOfElements;
22702272

22712273
CG(unclean_shutdown) = 1;
22722274
}

0 commit comments

Comments
 (0)