You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i.e. there is only an integer index here, so it's a packed hash table. But the code at that line 763 assumes it gets a non-packed hash table. Replacing ZEND_HASH_MAP_FOREACH_KEY_VAL by ZEND_HASH_FOREACH_KEY_VAL fixes the issue in this case I think. The error and the ZEND_HASH_MAP_FOREACH_KEY_VAL macro were introduced by 90b7bde, so I guess the assumption that there's a non-packed hash table does not hold at all the places where this replacement happened.
Applying the following diff fixes this particular case, but there are probably more places where the following change needs to happen.
Activity
ndossche commentedon Jan 1, 2023
I analyzed this issue for a bit. I can confirm this happens on 8.2 and higher.
The issue occurs because the summary element does not have attributes in your example, so the array of properties is just
i.e. there is only an integer index here, so it's a packed hash table. But the code at that line 763 assumes it gets a non-packed hash table. Replacing
ZEND_HASH_MAP_FOREACH_KEY_VALbyZEND_HASH_FOREACH_KEY_VALfixes the issue in this case I think. The error and theZEND_HASH_MAP_FOREACH_KEY_VALmacro were introduced by 90b7bde, so I guess the assumption that there's a non-packed hash table does not hold at all the places where this replacement happened.Applying the following diff fixes this particular case, but there are probably more places where the following change needs to happen.
Deltik commentedon Jan 2, 2023
I updated my repro snippet with a much simpler one.
e107inc#4938: Workaround for PHP 8.2.0 segmentation fault / assertion…
Fix phpGH-10200: zif_get_object_vars: Assertion `!(((__ht)->u.flags &…
Add a regression test for phpGH-10200
Fix GH-10200: zif_get_object_vars: Assertion `!(((__ht)->u.flags & (1…
Move test for phpGH-10200 to the simplexml extension test directory
Move test for GH-10200 to the simplexml extension test directory
Merge branch 'PHP-8.2'
Fix phpGH-10983: State-dependant segfault in ReflectionObject::getPro…
Fix GH-10983: State-dependant segfault in ReflectionObject::getProper…
Fix phpGH-10200: zif_get_object_vars: Assertion `!(((__ht)->u.flags &…
#4938: Workaround for PHP 8.2.0 segmentation fault / assertion error