Skip to content

Commit

Permalink
Fixed bug #76205 (PHP-FPM sporadic crash when running Infinitewp)
Browse files Browse the repository at this point in the history
  • Loading branch information
dstogov committed May 3, 2018
1 parent 7ba70a5 commit 5b3e1de
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 22 deletions.
1 change: 1 addition & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ PHP NEWS
(mgorny)

- Opcache:
. Fixed bug #76205 (PHP-FPM sporadic crash when running Infinitewp). (Dmitry)
. Fixed bug #76275 (Assertion failure in file cache when unserializing empty
try_catch_array). (Nikita)
. Fixed bug #76281 (Opcache causes incorrect "undefined variable" errors).
Expand Down
48 changes: 26 additions & 22 deletions ext/opcache/zend_file_cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -526,14 +526,13 @@ static void zend_file_cache_serialize_prop_info(zval *zv,
prop = Z_PTR_P(zv);
UNSERIALIZE_PTR(prop);

if (prop->ce && !IS_SERIALIZED(prop->ce)) {
ZEND_ASSERT(prop->ce != NULL && prop->name != NULL);
if (!IS_SERIALIZED(prop->ce)) {
SERIALIZE_PTR(prop->ce);
}
if (prop->name && !IS_SERIALIZED(prop->name)) {
SERIALIZE_STR(prop->name);
}
if (prop->doc_comment && !IS_SERIALIZED(prop->doc_comment)) {
SERIALIZE_STR(prop->doc_comment);
if (prop->doc_comment) {
SERIALIZE_STR(prop->doc_comment);
}
}
}
}
Expand All @@ -550,12 +549,15 @@ static void zend_file_cache_serialize_class_constant(zval *z
c = Z_PTR_P(zv);
UNSERIALIZE_PTR(c);

zend_file_cache_serialize_zval(&c->value, script, info, buf);
if (c->ce && !IS_SERIALIZED(c->ce)) {
ZEND_ASSERT(c->ce != NULL);
if (!IS_SERIALIZED(c->ce)) {
SERIALIZE_PTR(c->ce);
}
if (c->doc_comment && !IS_SERIALIZED(c->doc_comment)) {
SERIALIZE_STR(c->doc_comment);

zend_file_cache_serialize_zval(&c->value, script, info, buf);

if (c->doc_comment) {
SERIALIZE_STR(c->doc_comment);
}
}
}
}
Expand Down Expand Up @@ -1144,14 +1146,13 @@ static void zend_file_cache_unserialize_prop_info(zval *zv,
UNSERIALIZE_PTR(Z_PTR_P(zv));
prop = Z_PTR_P(zv);

if (prop->ce && !IS_UNSERIALIZED(prop->ce)) {
ZEND_ASSERT(prop->ce != NULL && prop->name != NULL);
if (!IS_UNSERIALIZED(prop->ce)) {
UNSERIALIZE_PTR(prop->ce);
}
if (prop->name && !IS_UNSERIALIZED(prop->name)) {
UNSERIALIZE_STR(prop->name);
}
if (prop->doc_comment && !IS_UNSERIALIZED(prop->doc_comment)) {
UNSERIALIZE_STR(prop->doc_comment);
if (prop->doc_comment) {
UNSERIALIZE_STR(prop->doc_comment);
}
}
}
}
Expand All @@ -1166,12 +1167,15 @@ static void zend_file_cache_unserialize_class_constant(zval *
UNSERIALIZE_PTR(Z_PTR_P(zv));
c = Z_PTR_P(zv);

zend_file_cache_unserialize_zval(&c->value, script, buf);
if (c->ce && !IS_UNSERIALIZED(c->ce)) {
ZEND_ASSERT(c->ce != NULL);
if (!IS_UNSERIALIZED(c->ce)) {
UNSERIALIZE_PTR(c->ce);
}
if (c->doc_comment && !IS_UNSERIALIZED(c->doc_comment)) {
UNSERIALIZE_STR(c->doc_comment);

zend_file_cache_unserialize_zval(&c->value, script, buf);

if (c->doc_comment) {
UNSERIALIZE_STR(c->doc_comment);
}
}
}
}
Expand Down

0 comments on commit 5b3e1de

Please sign in to comment.