Skip to content

Commit 157ccaf

Browse files
committed
Fixed bug #64827 Segfault in zval_mark_grey (zend_gc.c)
I can not get a reproduce script since the context is very strict. Of course I will try to make one, but for now, I just commit this first.
1 parent efd3c72 commit 157ccaf

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ PHP NEWS
99
(David Soria Parra, Laruence)
1010

1111
- OPcache
12+
. Fixed bug #64827 (Segfault in zval_mark_grey (zend_gc.c)). (Laruence)
1213
. OPcache must be compatible with LiteSpeed SAPI (Dmitry)
1314

1415
- CLI server:

ext/opcache/ZendAccelerator.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2163,7 +2163,10 @@ static void accel_fast_zval_ptr_dtor(zval **zval_ptr)
21632163
case IS_CONSTANT_ARRAY: {
21642164
TSRMLS_FETCH();
21652165

2166+
GC_REMOVE_ZVAL_FROM_BUFFER(zvalue);
21662167
if (zvalue->value.ht && (zvalue->value.ht != &EG(symbol_table))) {
2168+
/* break possible cycles */
2169+
Z_TYPE_P(zvalue) = IS_NULL;
21672170
zvalue->value.ht->pDestructor = (dtor_func_t)accel_fast_zval_ptr_dtor;
21682171
accel_fast_hash_destroy(zvalue->value.ht);
21692172
}
@@ -2173,6 +2176,7 @@ static void accel_fast_zval_ptr_dtor(zval **zval_ptr)
21732176
{
21742177
TSRMLS_FETCH();
21752178

2179+
GC_REMOVE_ZVAL_FROM_BUFFER(zvalue);
21762180
Z_OBJ_HT_P(zvalue)->del_ref(zvalue TSRMLS_CC);
21772181
}
21782182
break;

0 commit comments

Comments
 (0)