com php-src: preg indenpent test script for #63055: Zend/tests/bug63055.phpt
| From: | Xinchen Hui | Date: | Fri, 19 Oct 2012 03:22:56 +0000 |
| Subject: | com php-src: preg indenpent test script for #63055: Zend/tests/bug63055.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-70437@lists.php.net to get a copy of this message | ||
Commit: 90bd54c46e0195f65a1a49ac0c01f139915a2dd3
Author: Xinchen Hui <laruence@php.net> Fri, 19 Oct 2012 11:22:56 +0800
Parents: 6444eef27b81f3fb50d39edc2db7e787d0c539e3
Branches: PHP-5.3
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=90bd54c46e0195f65a1a49ac0c01f139915a2dd3
Log:
preg indenpent test script for #63055
Bugs:
https://bugs.php.net/63055
Changed paths:
A Zend/tests/bug63055.phpt
Diff:
diff --git a/Zend/tests/bug63055.phpt b/Zend/tests/bug63055.phpt
new file mode 100644
index 0000000..711385a
--- /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