History log of /PHP-8.4/ext/intl/tests/gh11874.phpt (Results 1 – 1 of 1)
Revision Date Author Comments
# a970eefb 03-Jan-2025 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix GH-11874: intl causing segfault in docker images

The segfault happens because zoi->wrapping_obj points to an object that has been freed.
This wrapping_obj is set in IntlIterator_from

Fix GH-11874: intl causing segfault in docker images

The segfault happens because zoi->wrapping_obj points to an object that has been freed.
This wrapping_obj is set in IntlIterator_from_StringEnumeration().
Notice how the refcount is not increased in this function.
By switching to ZVAL_OBJ_COPY, the segfault disappears.

We also need to move the responsibility of destroying the iterator to
the iterator itself and keep the object data destruction in the object
destruction. The existing code used a weird recursive destruction
between the iterator and object that was too hard to understand to be
honest. This patch simplifies everything and in the process gets rid of
the leak.

Iterators that are embedded are now responsible for their own
memory cleanup.

Closes GH-17343.

show more ...