From patchwork Sat Sep 29 17:50:58 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Lance Taylor X-Patchwork-Id: 188039 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 EE2B02C00F4 for ; Sun, 30 Sep 2012 03:51:18 +1000 (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=1349545879; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:From:To:Subject:Date:Message-ID:User-Agent:MIME-Version: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=z3+T4sB UPiY3hii/+K6RITVKutM=; b=QZJcvnrftF2rB4M6RrG/w875xx84i/sROBDrbHm LSDmUiyWGzjA1RIk85pC87hQMmOvS6db8h4dyX+NDXU0S8xX1KdbA5I+R1o+Dd+f bcxcPRyrwx1bZ9J6Q/GWFHFAAKFrrJp5iGbmGCLi2XJDQiYCBBCk/2liYjNjr4BD Fy2I= 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:X-Google-DKIM-Signature:Received:Received:From:To:Subject:Date:Message-ID:User-Agent:MIME-Version:Content-Type:X-Gm-Message-State:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=GAl3Oa8NdgjAPBEFa9h7uF6a3kv/XHE2+hmklz/sQafEfiCJtK3pq3ei8Jzvgn 1iQiSOUeGxoOAz/gUyEIg9+6gtE8X9vRgqWPU2gXVq3WUpmuicEFAfJNc8CkcaUY E1t5anPxhesH2vdXJGcjO63Ko29LUPo07rUxo99omKQ5c=; Received: (qmail 5918 invoked by alias); 29 Sep 2012 17:51:07 -0000 Received: (qmail 5908 invoked by uid 22791); 29 Sep 2012 17:51:05 -0000 X-SWARE-Spam-Status: No, hits=-5.5 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, KHOP_RCVD_TRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, RP_MATCHES_RCVD, T_TVD_MIME_NO_HEADERS X-Spam-Check-By: sourceware.org Received: from mail-pa0-f47.google.com (HELO mail-pa0-f47.google.com) (209.85.220.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 29 Sep 2012 17:51:01 +0000 Received: by padfa11 with SMTP id fa11so3224381pad.20 for ; Sat, 29 Sep 2012 10:51:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:subject:date:message-id:user-agent:mime-version :content-type:x-gm-message-state; bh=wY/aFU/P9sLfeh4UfjcvxRqtNNcS/HRZeyjWom7TwNY=; b=WPBX9RIixJzE+dL7JXZCRM3qg3HvOX7j4y7OtyJTh4YBO2IMvhmaYMSd2wJxU4geET 6JD/5N/GNUght00a2sqBWOdy1uXAArO1vb+dh4b4p9fkff1+uUuZutfHRuILCBrYNBVH CYOYB45Qm+FC7O6xahR9aW29ZDmglh2TKDjniAd/4n3nFwcif9X8xf7wEMSzdrAXisIT 3dxPCj6UcVWkK/5mXJOAgT9cu3xh1lKunxh6ftAEcVCU33I6101CfgQaHxnmUarxwFNV cGdCbi9EtYyc6AHlCL86vhEt48D+AKkjcCAvsp9SPehA8VICa0kn0i1W0JnS34zSz9PE ndOA== Received: by 10.68.228.98 with SMTP id sh2mr29369850pbc.95.1348941060623; Sat, 29 Sep 2012 10:51:00 -0700 (PDT) Received: from coign.google.com ([172.26.52.42]) by mx.google.com with ESMTPS id j10sm7483683pax.4.2012.09.29.10.50.59 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 29 Sep 2012 10:51:00 -0700 (PDT) From: Ian Lance Taylor To: gcc-patches@gcc.gnu.org Subject: libbacktrace patch committed: Avoid multiple error messages Date: Sat, 29 Sep 2012 10:50:58 -0700 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 X-Gm-Message-State: ALoCoQnZufohPXQT2Dv13ctLVoPwwNWnKmpAZ99JvbLcLvwxzEZP6GsUiiXavoggcVxGxToVf/848gINIQkBU4MI222p8N83vIit2XKSIUdCduKO5QhjppvpgpAyUALo1AEfxm0kUB9rimv7ct/sZkO7AM/GmTEbleb0iUhdtf9B0QrdLN8HrF6mYfvxYGE1nIXTZSsQfddRpy0Wj00Ad5kvlhcRCRLgSQ== X-IsSubscribed: yes 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 PR 54749 points out that if libbacktrace fails to read the debug info from the executable (in the case of that PR, due to memory exhaustion) the compiler will print multiple error messages. The library already has a mechanism to avoid this, and this patch uses that mechanism. Bootstrapped and ran libbacktrace testsuite on x86_64-unknown-linux-gnu. Committed to mainline. Ian 2012-09-29 Ian Lance Taylor PR other/54749 * fileline.c (fileline_initialize): Pass errnum as -1 when reporting that we could not read executable information after a previous failure. Index: fileline.c =================================================================== --- fileline.c (revision 191853) +++ fileline.c (working copy) @@ -63,7 +63,7 @@ fileline_initialize (struct backtrace_st if (failed) { - error_callback (data, "failed to read executable information", 0); + error_callback (data, "failed to read executable information", -1); return 0; }