All of lore.kernel.org
 help / color / mirror / Atom feed
From: Taylor Simpson <tsimpson@quicinc.com>
To: qemu-devel@nongnu.org
Cc: ale@rev.ng, peter.maydell@linaro.org, bcain@quicinc.com,
	richard.henderson@linaro.org, tsimpson@quicinc.com,
	philmd@redhat.com
Subject: [PULL 3/3] linux-test (tests/tcg/multiarch/linux-test.c) add check
Date: Wed, 21 Jul 2021 16:19:35 -0500	[thread overview]
Message-ID: <1626902375-7002-4-git-send-email-tsimpson@quicinc.com> (raw)
In-Reply-To: <1626902375-7002-1-git-send-email-tsimpson@quicinc.com>

Add a check that the SIGSEGV handler is called

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Taylor Simpson <tsimpson@quicinc.com>
Message-Id: <1626384156-6248-3-git-send-email-tsimpson@quicinc.com>
---
 tests/tcg/multiarch/linux-test.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/tests/tcg/multiarch/linux-test.c b/tests/tcg/multiarch/linux-test.c
index c8c6aed..e2d88f8 100644
--- a/tests/tcg/multiarch/linux-test.c
+++ b/tests/tcg/multiarch/linux-test.c
@@ -439,10 +439,14 @@ static void sig_alarm(int sig)
     alarm_count++;
 }
 
+/* Count the number of times handler is called */
+static int sig_segv_called;
+
 static void sig_segv(int sig, siginfo_t *info, void *puc)
 {
     if (sig != SIGSEGV)
         error("signal");
+    sig_segv_called++;
     longjmp(jmp_env, 1);
 }
 
@@ -492,6 +496,10 @@ static void test_signal(void)
         *(volatile uint8_t *)0 = 0;
     }
 
+    if (sig_segv_called == 0) {
+        error("SIGSEGV handler not called");
+    }
+
     act.sa_handler = SIG_DFL;
     sigemptyset(&act.sa_mask);
     act.sa_flags = 0;
-- 
2.7.4


  parent reply	other threads:[~2021-07-21 21:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-21 21:19 [PULL 0/3] SIGSEGV fixes Taylor Simpson
2021-07-21 21:19 ` [PULL 1/3] Hexagon (target/hexagon) remove put_user_*/get_user_* Taylor Simpson
2021-07-21 21:19 ` [PULL 2/3] target/hexagon: Drop include of qemu.h Taylor Simpson
2021-07-21 21:19 ` Taylor Simpson [this message]
2021-07-22 17:31 ` [PULL 0/3] SIGSEGV fixes Peter Maydell
2021-07-23 18:48   ` Taylor Simpson
2021-07-23 19:10     ` Richard Henderson
2021-07-23 19:56       ` Philippe Mathieu-Daudé

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

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

  git send-email \
    --in-reply-to=1626902375-7002-4-git-send-email-tsimpson@quicinc.com \
    --to=tsimpson@quicinc.com \
    --cc=ale@rev.ng \
    --cc=bcain@quicinc.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.