summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXinchen Hui <laruence@php.net>2012-10-19 11:22:56 +0800
committerXinchen Hui <laruence@php.net>2012-10-19 11:22:56 +0800
commit90bd54c46e0195f65a1a49ac0c01f139915a2dd3 (patch)
treeca60a89004d867bd790b314a37770d0b471aa147
parent6444eef27b81f3fb50d39edc2db7e787d0c539e3 (diff)
downloadphp-git-90bd54c46e0195f65a1a49ac0c01f139915a2dd3.tar.gz
preg indenpent test script for #63055
-rw-r--r--Zend/tests/bug63055.phpt23
1 files changed, 23 insertions, 0 deletions
diff --git a/Zend/tests/bug63055.phpt b/Zend/tests/bug63055.phpt
new file mode 100644
index 0000000000..711385a3ce
--- /dev/null
+++ b/Zend/tests/bug63055.phpt
@@ -0,0 +1,23 @@
+--TEST--
+Bug #63055 (Segfault in zend_gc with SF2 testsuite)
+--FILE--
+<?php
+/* the default gc root size is 10,000 */
+for ($i=0; $i<9998; $i++) {
+ $array = array();
+ $array[0] = &$array;
+ unset($array);
+}
+
+$matches = array("foo" => "bar"); /* this bucket will trigger the segfault */
+$dummy = array("dummy"); /* used to trigger gc_collect_cycles */
+$dummy[1] = &$dummy;
+
+$matches[1] = &$matches;
+$matches[2] = $dummy;
+
+str_replace("foo", "bar", "foobar", $matches);
+echo "okey";
+?>
+--EXPECTF--
+okey