Skip to content

Commit cf77762

Browse files
committed
Skip tests under MSAN
Stack overflows can be detected as long as C stack frames between two execute_ex() calls use less than zend.reserved_stack_size bytes of stack. The default value of zend.reserved_stack_size accounts for the largest stack users, but MSAN instrumentation increases usage considerably: php_pcre2_match uses more than 200KiB of stack in some MSAN build, compared to 20KiB without MSAN according to -fstack-usage.
1 parent a23e837 commit cf77762

File tree

4 files changed

+16
-0
lines changed

4 files changed

+16
-0
lines changed

Zend/tests/stack_limit/stack_limit_001.phpt

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
--TEST--
22
Stack limit 001 - Stack limit checks with max_allowed_stack_size detection
3+
--SKIPIF--
4+
<?php
5+
if (getenv('SKIP_MSAN')) die("skip msan requires a considerably higher zend.reserved_stack_size due to instrumentation");
6+
?>
37
--EXTENSIONS--
48
zend_test
59
--INI--

Zend/tests/stack_limit/stack_limit_002.phpt

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
--TEST--
22
Stack limit 002 - Stack limit checks with max_allowed_stack_size detection (fibers)
3+
--SKIPIF--
4+
<?php
5+
if (getenv('SKIP_MSAN')) die("skip msan requires a considerably higher zend.reserved_stack_size due to instrumentation");
6+
?>
37
--EXTENSIONS--
48
zend_test
59
--INI--

Zend/tests/stack_limit/stack_limit_006.phpt

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
--TEST--
22
Stack limit 006 - env size affects __libc_stack_end
3+
--SKIPIF--
4+
<?php
5+
if (getenv('SKIP_MSAN')) die("skip msan requires a considerably higher zend.reserved_stack_size due to instrumentation");
6+
?>
37
--EXTENSIONS--
48
zend_test
59
--INI--

Zend/tests/stack_limit/stack_limit_009.phpt

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
--TEST--
22
Stack limit 009 - Check that we can actually use all the stack
3+
--SKIPIF--
4+
<?php
5+
if (getenv('SKIP_MSAN')) die("skip msan requires a considerably higher zend.reserved_stack_size due to instrumentation");
6+
?>
37
--EXTENSIONS--
48
zend_test
59
--FILE--

0 commit comments

Comments
 (0)