com php-src: Don't test default serialize max_depth: ext/ standard/tests/serialize/max_depth.phpt
| From: | Nikita Popov | Date: | Mon, 07 Oct 2019 10:43:12 +0000 |
| Subject: | com php-src: Don't test default serialize max_depth: ext/ standard/tests/serialize/max_depth.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-108760@lists.php.net to get a copy of this message | ||
Commit: 81d95c4c3ca4828943bd8169a9b7760b4e54ec98
Author: Nikita Popov <nikita.ppv@gmail.com> Mon, 7 Oct 2019 12:40:21 +0200
Parents: 53077217e2801f65dd3cb598f12aee2fa792742a
Branches: PHP-7.4
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=81d95c4c3ca4828943bd8169a9b7760b4e54ec98
Log:
Don't test default serialize max_depth
The default depth is large enough to cause stack overflows in
msan builds, though apparently only on old clang versions. Avoiding
a stack overflow there requires making the depth *much* smaller,
less than 1000. As I don't think that's reasonable for all the other
setups where 4k works fine, I'm just dropping this part of the test.
Changed paths:
M ext/standard/tests/serialize/max_depth.phpt
Diff:
diff --git a/ext/standard/tests/serialize/max_depth.phpt
b/ext/standard/tests/serialize/max_depth.phpt
index 4f605d284e2..f20d9a7ccdb 100644
--- a/ext/standard/tests/serialize/max_depth.phpt
+++ b/ext/standard/tests/serialize/max_depth.phpt
@@ -31,11 +31,6 @@ var_dump(unserialize(
['max_depth' => 128]
));
-// Default depth is 4096
-echo "Default depth:\n";
-var_dump(unserialize(create_nested_data(4096, 'a:1:{i:0;', '}')) !== false);
-var_dump(unserialize(create_nested_data(4097, 'a:1:{i:0;', '}')));
-
// Depth can also be adjusted using ini setting
echo "Ini setting:\n";
ini_set("unserialize_max_depth", 128);
@@ -120,13 +115,6 @@ Warning: unserialize(): Maximum depth of 128 exceeded. The depth limit can be
ch
Notice: unserialize(): Error at offset 2834 of 2971 bytes in %s on line %d
bool(false)
-Default depth:
-bool(true)
-
-Warning: unserialize(): Maximum depth of 4096 exceeded. The depth limit can be changed using the
max_depth unserialize() option or the unserialize_max_depth ini setting in %s on line %d
-
-Notice: unserialize(): Error at offset 36869 of 40974 bytes in %s on line %d
-bool(false)
Ini setting:
bool(true)