com php-src: Add a XFAIL test, which I'd like to think more about a better fix: ext/standard/tests/serialize/unserialize_mem_leak.ph pt
| From: | Xinchen Hui | Date: | Mon, 02 Mar 2015 14:50:51 +0000 |
| Subject: | com php-src: Add a XFAIL test, which I'd like to think more about a better fix: ext/standard/tests/serialize/unserialize_mem_leak.ph pt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-85145@lists.php.net to get a copy of this message | ||
Commit: a78998c48b062f119d9a0f1c941b85dc8733b429
Author: Xinchen Hui <laruence@php.net> Mon, 2 Mar 2015 22:50:51 +0800
Parents: 9a20323e1946dff57eae8cd054e0893aefe83092
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a78998c48b062f119d9a0f1c941b85dc8733b429
Log:
Add a XFAIL test, which I'd like to think more about a better fix
Changed paths:
A ext/standard/tests/serialize/unserialize_mem_leak.phpt
Diff:
diff --git a/ext/standard/tests/serialize/unserialize_mem_leak.phpt
b/ext/standard/tests/serialize/unserialize_mem_leak.phpt
new file mode 100644
index 0000000..d27ca2b
--- /dev/null
+++ b/ext/standard/tests/serialize/unserialize_mem_leak.phpt
@@ -0,0 +1,18 @@
+--TEST--
+Memleaks if unserialize return a self-referenced array/object
+--XFAIL--
+To fix this, we need change zval_ptr_dtor_nogc to zval_ptr_dtor in free_args, but it will introduce
slowdown. mark this XFAIL now. we may find better fix later.
+--INI--
+report_memleaks=1
+--FILE--
+<?php
+function foo() {
+ gc_collect_cycles();
+}
+
+$str = 'a:1:{i:0;r:1;}';
+foo(unserialize($str));
+echo "okey";
+?>
+--EXPECT--
+okey