mirror of
https://github.com/php/php-src.git
synced 2026-10-28 17:56:50 +08:00
Since the GH-24050 fix, gc_collect_white() adds the table returned by get_gc to the garbage buffer. sxe_object_free_storage() released sxe->properties with zend_hash_release(), which does not remove the table from the GC buffer, so the GC later read and freed it again. Use zend_array_release(), which goes through zend_array_destroy(). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Close GH-24494
25 lines
427 B
PHP
25 lines
427 B
PHP
--TEST--
|
|
GH-24488 (GC double-frees the SimpleXMLElement properties table)
|
|
--EXTENSIONS--
|
|
simplexml
|
|
--FILE--
|
|
<?php
|
|
|
|
for ($i = 0; $i < 2; $i++) {
|
|
$xml = new SimpleXMLElement('<a><b/></a>');
|
|
get_object_vars($xml);
|
|
|
|
$holder = new stdClass;
|
|
$holder->xml = $xml;
|
|
$holder->self = $holder;
|
|
unset($xml, $holder);
|
|
|
|
gc_collect_cycles();
|
|
$junk[] = str_repeat('x', 100);
|
|
}
|
|
|
|
echo "Done\n";
|
|
?>
|
|
--EXPECT--
|
|
Done
|