qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: Taylor Simpson <tsimpson@quicinc.com>, qemu-devel@nongnu.org
Cc: ale@rev.ng, bcain@quicinc.com, philmd@redhat.com, alex.bennee@linaro.org
Subject: Re: [PATCH 2/2] linux-test (tests/tcg/multiarch/linux-test.c) add check
Date: Wed, 14 Jul 2021 05:35:03 -0700	[thread overview]
Message-ID: <414412ac-cae3-c82b-2c48-3e0a50ef8bb5@linaro.org> (raw)
In-Reply-To: <1626205589-19208-3-git-send-email-tsimpson@quicinc.com>

On 7/13/21 12:46 PM, Taylor Simpson wrote:
> Add a check that the SIGSEGV handler is called
> 
> Signed-off-by: Taylor Simpson <tsimpson@quicinc.com>
> ---
>   tests/tcg/multiarch/linux-test.c | 7 +++++++
>   1 file changed, 7 insertions(+)
> 
> diff --git a/tests/tcg/multiarch/linux-test.c b/tests/tcg/multiarch/linux-test.c
> index c8c6aed..cb845c9 100644
> --- a/tests/tcg/multiarch/linux-test.c
> +++ b/tests/tcg/multiarch/linux-test.c
> @@ -439,10 +439,13 @@ static void sig_alarm(int sig)
>       alarm_count++;
>   }
>   
> +static int sig_segv_called;
> +
>   static void sig_segv(int sig, siginfo_t *info, void *puc)
>   {
>       if (sig != SIGSEGV)
>           error("signal");
> +    sig_segv_called = 1;

Either bool or a count.

Otherwise,
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~

>       longjmp(jmp_env, 1);
>   }
>   
> @@ -492,6 +495,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;
> 



      reply	other threads:[~2021-07-14 12:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-13 19:46 [PATCH 0/2] SIGSEGV fixes Taylor Simpson
2021-07-13 19:46 ` [PATCH 1/2] Hexagon (target/hexagon) do probe_write in HELPER(commit_store) Taylor Simpson
2021-07-14 12:33   ` Richard Henderson
2021-07-13 19:46 ` [PATCH 2/2] linux-test (tests/tcg/multiarch/linux-test.c) add check Taylor Simpson
2021-07-14 12:35   ` Richard Henderson [this message]

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=414412ac-cae3-c82b-2c48-3e0a50ef8bb5@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=ale@rev.ng \
    --cc=alex.bennee@linaro.org \
    --cc=bcain@quicinc.com \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=tsimpson@quicinc.com \
    /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 NNTP newsgroup(s).