bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Ivan Zakharyaschev <imz@altlinux.org>
To: bug-gnulib@gnu.org
Cc: Ivan Zakharyaschev <imz@altlinux.org>
Subject: [RFC PATCH] test-c-stack2.sh: skip if the platform sent SIGILL on an invalid address.
Date: Sat, 15 Dec 2018 15:50:47 +0300	[thread overview]
Message-ID: <20181215125047.2071-1-imz@altlinux.org> (raw)

I can think of two ways to think about the purpose of this test:

1. distinguish stack overflow from an access to an invalid address
("programm error")

2. distinguish stack overflow from other cases when SIGSEGV is sent

Under view 2, then the access to an invalid address is just an
implementation detail: a simple way to cause SIGSEGV.

I assume view 2 in this patch and simply consider the platform which
doesn't send a SIGSEGV on this condition (but rather sends SIGILL as
E2K (i.e., elbrus)) not suitable for this implementation of the
test. Therefore, the result is skip.

Under view 1, it could even be consiidered a success: the distinction
is made, but not thanks to our code, but thanks to the platform
sending a different signal.

Here is what it looks like on E2K (i.e., elbrus):

$ ./test-c-stack 1; echo $?
Illegal instruction
132
$ ./test-c-stack; echo $?
test-c-stack: stack overflow
1
$
---
 tests/test-c-stack2.sh | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tests/test-c-stack2.sh b/tests/test-c-stack2.sh
index 0cd49c969..a04d861cd 100755
--- a/tests/test-c-stack2.sh
+++ b/tests/test-c-stack2.sh
@@ -23,6 +23,11 @@ case $? in
         exit 77
       fi
       ;;
+  132) echo 'not applicable if non-SIGSEGV is sent in the case to be told from stack overflow' >&2
+	   # E2K (elbrus) systems send SIGILL on an access to an invalid address.
+	   # So, this test is skipped:
+	   exit 77
+	   ;;
   0) (exit 1); exit 1 ;;
 esac
 if grep 'program error' t-c-stack2.tmp >/dev/null ; then
-- 
2.17.1



             reply	other threads:[~2018-12-15 13:48 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-15 12:50 Ivan Zakharyaschev [this message]
2018-12-20  2:24 ` [RFC PATCH] test-c-stack2.sh: skip if the platform sent SIGILL on an invalid address Bruno Haible
2018-12-28 14:23   ` Ivan Zakharyaschev
2018-12-29 11:17     ` Bruno Haible
2018-12-29 11:31       ` Andrey Savchenko
2018-12-29 14:03         ` Bruno Haible
2018-12-29 14:31         ` Dmitry V. Levin
2018-12-29 14:54       ` Bruno Haible
2018-12-29 15:03       ` Ivan Zakharyaschev
2018-12-29 16:30         ` Dmitry V. Levin
2018-12-29 20:13         ` Ivan Zakharyaschev
2018-12-30  4:49           ` Bruno Haible
2018-12-29 13:54     ` Dmitry V. Levin
2018-12-29 15:15       ` Ivan Zakharyaschev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181215125047.2071-1-imz@altlinux.org \
    --to=imz@altlinux.org \
    --cc=bug-gnulib@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).