From: Mark Kettenis <mark.kettenis@xs4all.nl>
To: yao@codesourcery.com
Cc: mark.kettenis@xs4all.nl, gdb-patches@sourceware.org
Subject: Re: [patch V2, testsuite] gdb.base/savedregs.exp: SIGSEGV -> SIGALRM
Date: Mon, 20 Jun 2011 11:12:00 -0000 [thread overview]
Message-ID: <201106201110.p5KBAvb1025773@glazunov.sibelius.xs4all.nl> (raw)
In-Reply-To: <4DFF0418.6060706@codesourcery.com> (message from Yao Qi on Mon, 20 Jun 2011 16:26:00 +0800)
> Date: Mon, 20 Jun 2011 16:26:00 +0800
> From: Yao Qi <yao@codesourcery.com>
> Organization: CodeSourcery
> CC: gdb-patches@sourceware.org
> X-XS4ALL-DNSBL-Checked: mxdrop157.xs4all.nl checked 38.113.113.100 against DNS blacklists
> X-CNFS-Analysis: v=1.1 cv=0zc6fmG9YcuPB4Yp6G+9JUp7sX0X0uIJmZE+jPYAbEE= c=1
> sm=0 a=BqqcDBkZDkoA:10 a=JR3SvU1DSgIA:10 a=zbTXIsBlecMA:10
> a=BLceEmwcHowA:10 a=IkcTkHD0fZMA:10 a=gA6+7WRReeCfZX6hXOPmZA==:17
> a=WZgqnTsFiMBE2RNew4wA:9 a=MWeep4gfJk6IGiYzYrIA:7 a=QEXdDO2ut3YA:10
> a=gA6+7WRReeCfZX6hXOPmZA==:117
> X-Virus-Scanned: by XS4ALL Virus Scanner
> X-XS4ALL-Spam-Score: -0.0 () SPF_PASS
> X-XS4ALL-Spam: NO
> Envelope-To: mark.kettenis@xs4all.nl
>
> On 06/20/2011 03:01 PM, Mark Kettenis wrote:
> > That's an even bigger change. And I don't think that SIGALRM is even
> > guaranteed to happen before the program terminates. And if there
> > MMU-less systems that effectively don't support SIGSEGV, there
> > certainly are timer-less systems that don't support SIGALRM.
> >
>
> What system doesn't support SIGALRM? I noticed that SIGALRM is widely
> used in gdb testsuite, so I assume that it is safer to use SIGALRM than
> SIGILL here.
>
> > Really, just skip this test on MMU-less systems. If you're worried
> > about test coverage on your MMU-less ARM systems, add an additional
> > test in gdb.arch/ that uses an undefined instruction to generate
> > SIGILL.
>
> I am afraid it is not a good idea. There are many MMU-less processor,
> and shall we duplicate this test case all over under gdb.arch/ for each
> MMU-less processor?
>
> As I pointed out before, this test case has nothing to do with the
> difference of MMU system and MMU-less system. Originally, SIGSEGV was
> used here to trigger an invocation to signal handler. The key point of
> this case is "to trigger an invocation to a handler, and check the frame
> in signal handler", so handler of what signal doesn't matter here.
> Then, we should choose a signal which exists on all systems that gdb
> supports. Firstly, SIGSEGV is chosen, but it doesn't work on MMU-less
> system, then SIGILL and SIGALRM is proposed in my two patches
> respectively, which you don't like.
The fundamental problem with SIGALRM is that it is non-deterministic.
The point where the progrem gets interrupted by the signal can be
different for each run of the test. That point determines which
unwinder gets used, which may affect the test result. Using SIGALRM
really is a bad idea for this test. It might be a bad idea for those
other tests as well.
My concern with using SIGILL (apart from generating an instruction
that forces SIGALL on all architectures we support) is that you're
going to end up testing a different unwinder as well. Typically in
the SIGSEGV case you'll end up at the faulting instruction, which is
defenitely in the function body, where we should be using the DWARF
CFI unwinder. But for SIGILL you could end up at the instruction
after the trapping instruction, which is likely to be in the function
epilogue which may be handled by an epilogue unwinder.
> Maybe, another option is to define invalid instruction for each targets
> in test case.
Perhaps a reasonable compromise is to do something like:
static void
thrower (void)
{
*(char *)0 = 0;
#ifdef __arm__
asm(".word 0xffff");
#endif
}
and then handle both SIGSEGV and SIGILL.
next prev parent reply other threads:[~2011-06-20 11:12 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-09 9:28 [patch, testsuite] gdb.base/savedregs.exp: SIGSEGV -> SIGILL Yao Qi
2011-06-09 10:08 ` Andreas Schwab
2011-06-09 10:53 ` Yao Qi
2011-06-09 11:19 ` Mark Kettenis
2011-06-09 11:41 ` Pedro Alves
2011-06-09 13:25 ` Yao Qi
2011-06-09 13:10 ` Yao Qi
2011-06-09 14:25 ` Pedro Alves
2011-06-20 4:13 ` [patch V2, testsuite] gdb.base/savedregs.exp: SIGSEGV -> SIGALRM Yao Qi
2011-06-20 7:03 ` Mark Kettenis
2011-06-20 8:26 ` Yao Qi
2011-06-20 11:12 ` Mark Kettenis [this message]
2011-06-20 15:07 ` Yao Qi
2011-06-20 15:14 ` Paul Koning
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=201106201110.p5KBAvb1025773@glazunov.sibelius.xs4all.nl \
--to=mark.kettenis@xs4all.nl \
--cc=gdb-patches@sourceware.org \
--cc=yao@codesourcery.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