Skip to content

Commit 81d95c4

Browse files
committed
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.
1 parent 5307721 commit 81d95c4

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

ext/standard/tests/serialize/max_depth.phpt

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,6 @@ var_dump(unserialize(
3131
['max_depth' => 128]
3232
));
3333

34-
// Default depth is 4096
35-
echo "Default depth:\n";
36-
var_dump(unserialize(create_nested_data(4096, 'a:1:{i:0;', '}')) !== false);
37-
var_dump(unserialize(create_nested_data(4097, 'a:1:{i:0;', '}')));
38-
3934
// Depth can also be adjusted using ini setting
4035
echo "Ini setting:\n";
4136
ini_set("unserialize_max_depth", 128);
@@ -120,13 +115,6 @@ Warning: unserialize(): Maximum depth of 128 exceeded. The depth limit can be ch
120115

121116
Notice: unserialize(): Error at offset 2834 of 2971 bytes in %s on line %d
122117
bool(false)
123-
Default depth:
124-
bool(true)
125-
126-
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
127-
128-
Notice: unserialize(): Error at offset 36869 of 40974 bytes in %s on line %d
129-
bool(false)
130118
Ini setting:
131119
bool(true)
132120

0 commit comments

Comments
 (0)