From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 56350 invoked by alias); 12 Aug 2016 09:08:00 -0000 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 Received: (qmail 56336 invoked by uid 89); 12 Aug 2016 09:07:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=BAYES_00,KAM_LOTSOFHASH,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=dejagnu, states X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 12 Aug 2016 09:07:58 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D4B58C04D292; Fri, 12 Aug 2016 09:07:56 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u7C97t6Z005190; Fri, 12 Aug 2016 05:07:55 -0400 Subject: Re: [PATCH v2] Fix PR gdb/18653: gdb disturbs inferior's inherited signal dispositions To: Yao Qi References: <1470332251-10857-1-git-send-email-palves@redhat.com> <2148041.k6fglmTO5R@ralph.baldwin.cx> <86d1ddee-9841-d332-27d5-15c8c185063e@redhat.com> <86inv6cs8o.fsf@gmail.com> Cc: John Baldwin , gdb-patches@sourceware.org From: Pedro Alves Message-ID: Date: Fri, 12 Aug 2016 09:08:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <86inv6cs8o.fsf@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2016-08/txt/msg00142.txt.bz2 On 08/12/2016 09:21 AM, Yao Qi wrote: > Pedro Alves writes: > >> + else >> + { >> + int m; >> + >> + fprintf (out, "sigaction={sa_handler=", i); > > The redundant "i" causes a compilation warning, > > gdb/testsuite/gdb.base/signals-state-child.c:77:4: warning: too many arguments for format [-Wformat-extra-args] > fprintf (out, "sigaction={sa_handler=", i); > ^ > > The patch blow fixes this. With this patch applied, the test case can > be compiled successfully. Thanks. It's simply that v1 used it like this: + if (oldact.sa_handler == SIG_DFL) + fprintf (out, "%d: SIG_DFL\n", i); + else if (oldact.sa_handler == SIG_IGN) + fprintf (out, "%d: SIG_IGN\n", i); and in v2 the signal number printing go split to a separate fprintf: + fprintf (out, "signal %d: ", i); ... I missed the 'i' that was left behind. Please push. > However test fails, > > shell diff -s /scratch/yao/gdb/build-git/x86_64/gdb/testsuite/outputs/gdb.base/signals-state-child/standalone.txt /scratch/yao/gdb/build-git/x86_64/gdb/testsuite/outputs/gdb.base/signals-state-child/gdb.txt^M > 13c13^M > < signal 13: sigaction={sa_handler=SIG_DFL, sa_mask=0000000000000000000000000000000000000000000000000000000000000000, sa_flags=0}, masked=0^M > ---^M >> signal 13: sigaction={sa_handler=SIG_IGN, sa_mask=0000000000000000000000000000000000000000000000000000000000000000, sa_flags=0}, masked=0^M > 25c25^M > < signal 25: sigaction={sa_handler=SIG_DFL, sa_mask=0000000000000000000000000000000000000000000000000000000000000000, sa_flags=0}, masked=0^M > ---^M >> signal 25: sigaction={sa_handler=SIG_IGN, sa_mask=0000000000000000000000000000000000000000000000000000000000000000, sa_flags=0}, masked=0^M > (gdb) FAIL: gdb.base/signals-state-child.exp: signals states are identical > First thing to check is whether running the standalone vs through-gdb check outside dejagnu also shows differences. I realize now that NSIG is not the right upper bound, since it doesn't cover the realtime signals. Maybe it should be _NSIG if available. But that shouldn't explain this particular problem, since NSIG is 32. Thanks, Pedro Alves