From owner-freebsd-ppc@FreeBSD.ORG Tue May 27 22:20:01 2014 Return-Path: Delivered-To: freebsd-ppc@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A5A136C3 for ; Tue, 27 May 2014 22:20:01 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 775712C01 for ; Tue, 27 May 2014 22:20:01 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.8/8.14.8) with ESMTP id s4RMK1nq054372 for ; Tue, 27 May 2014 22:20:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.8/8.14.8/Submit) id s4RMK1VT054371; Tue, 27 May 2014 22:20:01 GMT (envelope-from gnats) Date: Tue, 27 May 2014 22:20:01 GMT Message-Id: <201405272220.s4RMK1VT054371@freefall.freebsd.org> To: freebsd-ppc@FreeBSD.org Cc: From: Nathan Whitehorn Subject: Re: powerpc/183040: Nested signal handling is broken Reply-To: Nathan Whitehorn X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2014 22:20:01 -0000 The following reply was made to PR powerpc/183040; it has been noted by GNATS. From: Nathan Whitehorn To: Julio Merino , FreeBSD-gnats-submit@freebsd.org Cc: Subject: Re: powerpc/183040: Nested signal handling is broken Date: Tue, 27 May 2014 15:12:43 -0700 On 10/16/13 16:49, Julio Merino wrote: >> Number: 183040 >> Category: powerpc >> Synopsis: Nested signal handling is broken >> Confidential: no >> Severity: serious >> Priority: medium >> Responsible: freebsd-ppc >> State: open >> Quarter: >> Keywords: >> Date-Required: >> Class: sw-bug >> Submitter-Id: current-users >> Arrival-Date: Thu Oct 17 00:00:00 UTC 2013 >> Closed-Date: >> Last-Modified: >> Originator: Julio Merino >> Release: FreeBSD 11.0-CURRENT powerpc >> Organization: >> Environment: > System: FreeBSD mastodon.meroh.net 11.0-CURRENT FreeBSD 11.0-CURRENT #9 r256450M: Mon Oct 14 16:35:08 EDT 2013 jmmv@mastodon.meroh.net:/usr/obj/usr/src/sys/GENERIC64 powerpc > > Also affects FreeBSD 10.0 alphas. > > >> Description: > When programming a given signal twice in a nested manner, the > unprogramming of the top-most signal handler does not properly > restore the previous (non-default handler). In other words: > > program signal X > program signal X > deliver signal X to self -- custom handler runs > unprogram signal X > deliver signal X to self -- default handler runs or not delivered > unprogram signal X > > Interestingly, things seem to work well for X = SIGTERM but not > for X = SIGHUP nor X = SIGINT. I have not tested other signals. > > I have encountered this bug while running the kyua test suite > on a powerpc64 machine (specifics detailed above) and noticing > a couple of tests fail, which work well in other operating > systems and in amd64. The test case below is derived form the > code in kyua. > > Here is the output of the test program on an amd64 machine, > which to my knowledge is working properly: > Your test program behaves as described with cc -O0 on ppc64. At any other optimization level, or if I build a 32-bit version, it works correctly. I'm a little bit at a loss beyond that. -Nathan