From 057259bd81fbb60233df00d0a2846304088e1d47 Mon Sep 17 00:00:00 2001 From: Ivan Zakharyaschev Date: Fri, 28 Dec 2018 17:03:18 +0300 Subject: [PATCH] c-stack tests: Avoid test failure on Linux/E2K. Reading a value without having initialized it caused a SIGILL on Linux/E2K rather than SIGSEGV as desired. This made test-c-stack2.sh fail on E2K. As for test-c-stack2.sh, its intention is to test whether we can tell a stack overflow from other cases when SIGSEGV is sent, and the way we cause a SIGSEGV in this test is just an implementation detail. It turned out that these implementation details need to be slightly changed for Linux/E2K. --- tests/test-c-stack.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test-c-stack.c b/tests/test-c-stack.c index 1dae74e6c..14fec8e07 100644 --- a/tests/test-c-stack.c +++ b/tests/test-c-stack.c @@ -63,7 +63,9 @@ main (int argc, char **argv) if (1 < argc) { exit_failure = 77; - ++*argv[argc]; /* Intentionally dereference NULL. */ + *argv[argc] = 175; /* Intentionally dereference NULL. Writing an + arbitrary value, because reading without having + initialized it causes a SIGILL on Linux/E2K. */ } return recurse (0); } -- 2.19.2