Skip to content

Commit 1d2c2f7

Browse files
committed
ci: fix MSAN/PowerPC nightly CI
1 parent e0a2924 commit 1d2c2f7

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

‎ext/standard/tests/streams/stream_errors_operation_depth_limit.phpt‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,28 @@
22
Stream errors: operations refused by the depth limit keep the stack consistent
33
--INI--
44
zend.max_allowed_stack_size=-1
5+
--SKIPIF--
6+
<?php
7+
if (!function_exists('posix_setrlimit') || !defined('POSIX_RLIMIT_STACK')) {
8+
die('skip MSan/PowerPC needs a larger C stack');
9+
}
10+
[, $hard] = posix_getrlimit(POSIX_RLIMIT_STACK);
11+
if (($hard !== 'unlimited' && $hard < 32 * 1024 * 1024)
12+
|| !posix_setrlimit(POSIX_RLIMIT_STACK, 32 * 1024 * 1024, $hard === 'unlimited' ? -1 : $hard)) {
13+
die('skip MSan needs a larger C stack');
14+
}
15+
?>
516
--FILE--
617
<?php
18+
// MSan/PowerPC needs more stack to reach the stream error operation limit.
19+
if (function_exists('posix_setrlimit') && defined('POSIX_RLIMIT_STACK')) {
20+
[$soft, $hard] = posix_getrlimit(POSIX_RLIMIT_STACK);
21+
if ($soft !== 'unlimited' && $soft < 32 * 1024 * 1024
22+
&& ($hard === 'unlimited' || $hard >= 32 * 1024 * 1024)) {
23+
posix_setrlimit(POSIX_RLIMIT_STACK, 32 * 1024 * 1024, $hard === 'unlimited' ? -1 : $hard);
24+
}
25+
}
26+
727
class RecursiveStream
828
{
929
public $context;

0 commit comments

Comments
 (0)