Skip to content

Commit 1f0f633

Browse files
committed
Fixed application of memory limit in tests/lang/bug45392. Marked as XFAIL.
This old bugfix is not working as intended. The memory limit in main's `PG(memory_limit)` differs from the one in zend_alloc. In zend_alloc the `AG(mm_heap)->limit` is defined as `max(passed_value, ZEND_MM_CHUNK_SIZE)`. The check made in an unclean shutdown will never be true unless the memory limit is lower than ZEND_MM_CHUNK_SIZE, which happened to be the case in the test. https://bugs.php.net/bug.php?id=45392 fcc0fdd
1 parent 59522ba commit 1f0f633

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/lang/bug45392.phpt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
Bug #45392 (ob_start()/ob_end_clean() and memory_limit)
33
--INI--
44
display_errors=stderr
5+
--XFAIL--
6+
The issue has not yet been resolved.
57
--SKIPIF--
68
<?php
79
if (getenv("USE_ZEND_ALLOC") === "0") {
@@ -10,7 +12,7 @@ if (getenv("USE_ZEND_ALLOC") === "0") {
1012
--FILE--
1113
<?php
1214
echo __LINE__ . "\n";
13-
ini_set('memory_limit', 100);
15+
ini_set('memory_limit', "2M");
1416
ob_start();
1517
$i = 0;
1618
while($i++ < 5000) {

0 commit comments

Comments
 (0)