From patchwork Mon Jan 9 18:20:23 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 135083 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 144F4B6FC8 for ; Tue, 10 Jan 2012 05:23:52 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1326738233; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:From:To:Subject:Date:User-Agent:MIME-Version: Content-Type:Message-Id:Mailing-List:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=ZMA7azowiKoc6T6mBb9opiAhTFs=; b=LAn3BLORbql469u 9FwdSQowOamdIOP+QFis+HzDj7G/w9mic1XgJ86BGajzV8gFYapAwzVxo/MPTf4Q Ps7+vpexkwqYuGpgwTrgTGWkfiC3WW/895Pu2ywOm8Wraa3GFry41CHhi8u0U4K2 5OSEaFd88qSwNoDJ5UH2OtXKmBaY= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:From:To:Subject:Date:User-Agent:MIME-Version:Content-Type:Message-Id:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=xMRQGJdds2RNvE8dfHBUNZwlVa8e026qg4IJMvnec8pZUzBxUPMcPr+h5MJsUr Eao/AlH9RhBxIkYkBk937GzgT1b4sEM+pnl7dzve31gZFG8xVMeUh0heLbaiax4s bcODO0yMehMWHqhwc7fR8iHHtqDSq61/uo43D8MGyzg5Y=; Received: (qmail 3860 invoked by alias); 9 Jan 2012 18:23:46 -0000 Received: (qmail 3846 invoked by uid 22791); 9 Jan 2012 18:23:44 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (194.98.77.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 09 Jan 2012 18:23:11 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 7DFFCCB2EFD for ; Mon, 9 Jan 2012 19:23:10 +0100 (CET) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 67VBYkzDmtMF for ; Mon, 9 Jan 2012 19:23:10 +0100 (CET) Received: from [192.168.1.2] (bon31-6-88-161-99-133.fbx.proxad.net [88.161.99.133]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id 7BF78CB2EF6 for ; Mon, 9 Jan 2012 19:23:09 +0100 (CET) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: [SPARC] Small tweak to Solaris unwinder Date: Mon, 9 Jan 2012 19:20:23 +0100 User-Agent: KMail/1.9.9 MIME-Version: 1.0 Message-Id: <201201091920.23445.ebotcazou@adacore.com> Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org On the recent Solaris 10 version I have access to (s10_72), the kernel/libc sometimes calls the call_user_handler routines with a null returned address. This is responsible for the last ACATS failure (cb1010c). But, in most cases, the address is the expected one, so it isn't clear if this is a bug or not. Tested on Solaris 8, 9 and 10, applied on mainline, 4.6 and 4.5 branches. 2012-01-09 Eric Botcazou * config/sparc/sol2-unwind.h (sparc64_is_sighandler): Check that the purported sigacthandler address isn't null before dereferencing it. (sparc_is_sighandler): Likewise. Index: config/sparc/sol2-unwind.h =================================================================== --- config/sparc/sol2-unwind.h (revision 183005) +++ config/sparc/sol2-unwind.h (working copy) @@ -124,10 +124,9 @@ sparc64_is_sighandler (unsigned int *pc, /* This matches the call_user_handler pattern for Solaris 10. There are 2 cases so we look for the return address of the caller's caller frame in order to do more pattern matching. */ - unsigned int sah_pattern - = *(unsigned int *)(*(unsigned long *)(cfa + 176 + 15*8) - 4); + unsigned long sah_address = *(unsigned long *)(cfa + 176 + 15*8); - if (sah_pattern == 0x92100019) + if (sah_address && *(unsigned int *)(sah_address - 4) == 0x92100019) /* This is the same setup as for Solaris 9, see below. */ *nframes = 3; else @@ -302,10 +301,9 @@ sparc_is_sighandler (unsigned int *pc, v /* This matches the call_user_handler pattern for Solaris 10. There are 2 cases so we look for the return address of the caller's caller frame in order to do more pattern matching. */ - unsigned int sah_pattern - = *(unsigned int *)(*(unsigned int *)(cfa + 96 + 15*4) - 4); + unsigned int sah_address = *(unsigned int *)(cfa + 96 + 15*4); - if (sah_pattern == 0x92100019) + if (sah_address && *(unsigned int *)(sah_address - 4) == 0x92100019) /* This is the same setup as for Solaris 9, see below. */ *nframes = 3; else