From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26765 invoked by alias); 20 Jun 2011 11:12:37 -0000 Received: (qmail 26757 invoked by uid 22791); 20 Jun 2011 11:12:36 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO glazunov.sibelius.xs4all.nl) (83.163.83.176) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 20 Jun 2011 11:12:21 +0000 Received: from glazunov.sibelius.xs4all.nl (kettenis@localhost [127.0.0.1]) by glazunov.sibelius.xs4all.nl (8.14.3/8.14.3) with ESMTP id p5KBAxbZ018999; Mon, 20 Jun 2011 13:11:00 +0200 (CEST) Received: (from kettenis@localhost) by glazunov.sibelius.xs4all.nl (8.14.3/8.14.3/Submit) id p5KBAvb1025773; Mon, 20 Jun 2011 13:10:57 +0200 (CEST) Date: Mon, 20 Jun 2011 11:12:00 -0000 Message-Id: <201106201110.p5KBAvb1025773@glazunov.sibelius.xs4all.nl> From: Mark Kettenis To: yao@codesourcery.com CC: mark.kettenis@xs4all.nl, gdb-patches@sourceware.org In-reply-to: <4DFF0418.6060706@codesourcery.com> (message from Yao Qi on Mon, 20 Jun 2011 16:26:00 +0800) Subject: Re: [patch V2, testsuite] gdb.base/savedregs.exp: SIGSEGV -> SIGALRM References: <4DF09229.4070704@codesourcery.com> <201106091117.p59BHRWi025356@glazunov.sibelius.xs4all.nl> <4DF0C613.70101@codesourcery.com> <4DFEC8D8.3000608@codesourcery.com> <201106200701.p5K71m5h030689@glazunov.sibelius.xs4all.nl> <4DFF0418.6060706@codesourcery.com> Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-06/txt/msg00261.txt.bz2 > Date: Mon, 20 Jun 2011 16:26:00 +0800 > From: Yao Qi > 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.