From owner-freebsd-bugs@freebsd.org Tue Feb 2 09:29:32 2016 Return-Path: Delivered-To: freebsd-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1AF8AA97EC0 for ; Tue, 2 Feb 2016 09:29:32 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (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 E7FDA1112 for ; Tue, 2 Feb 2016 09:29:31 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id u129TVTj026757 for ; Tue, 2 Feb 2016 09:29:31 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 206810] 11.0-CURRENT/clang380-import for powerpc (32-bit): signal handlers given insufficient stack alignment Date: Tue, 02 Feb 2016 09:29:32 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 11.0-CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: markmi@dsl-only.net X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Feb 2016 09:29:32 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D206810 --- Comment #1 from Mark Millard --- I tried the following change on/for the powerpc (32-bit) PowerMac that I use Index: /usr/src/sys/powerpc/powerpc/sigcode32.S =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- /usr/src/sys/powerpc/powerpc/sigcode32.S (revision 294962) +++ /usr/src/sys/powerpc/powerpc/sigcode32.S (working copy) @@ -45,9 +45,9 @@ */ .globl CNAME(sigcode32),CNAME(szsigcode32) CNAME(sigcode32): - addi 1,1,-20 /* reserved space for callee */ + addi 1,1,-32 /* reserved space for callee */ blrl - addi 3,1,20+SF_UC /* restore sp, and get &frame->sf_u= c */ + addi 3,1,32+SF_UC /* restore sp, and get &frame->sf_u= c */ li 0,SYS_sigreturn sc /* sigreturn(scp) */ li 0,SYS_exit and the results were: A) "info frame" in gdb shows signal handlers are now started with 16-byte aligned stack frames. and B) The clang 3.8.0 compiled __vfprintf segmentation faults in libc/stdio library code during signal handlers no longer happen because the alignment matches the code requirements. (Before 2014 it was -16 and 16 instead of -20 and 20, but 16 was too small = of a space. The change to -20 and 20 fixed that but no longer produced aligned s= tack frames: It should have gone from -16 and 16 to -32 and 32 to maintain 16 by= te stack alignment while allocating more space.) --=20 You are receiving this mail because: You are the assignee for the bug.=