We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 56d1ffc commit 188ed37Copy full SHA for 188ed37
1 file changed
ext/standard/tests/streams/gh22200.phpt
@@ -0,0 +1,22 @@
1
+--TEST--
2
+GH-22200 (Memory leaks in the stream errors code on reentrant error handler)
3
+--FILE--
4
+<?php
5
+
6
+// When the warning emitted for the failing outer stream operation is reported,
7
+// php_stream_error_operation_end() has already popped the operation off the
8
+// stack. The user error handler then runs another stream operation, which
9
+// reuses the same operation pool slot and orphans the in-flight error entry,
10
+// leaking it.
11
+set_error_handler(function ($errno, $errstr) {
12
+ @file_get_contents(__DIR__ . '/gh22200-does-not-exist-inner');
13
+ return true;
14
+});
15
16
+file_get_contents(__DIR__ . '/gh22200-does-not-exist-outer');
17
18
+echo "done\n";
19
20
+?>
21
+--EXPECT--
22
+done
0 commit comments