From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17945 invoked by alias); 12 Feb 2014 19:22:26 -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 17934 invoked by uid 89); 12 Feb 2014 19:22:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 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; Wed, 12 Feb 2014 19:22:25 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s1CJMM8i025056 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 12 Feb 2014 14:22:22 -0500 Received: from barimba (ovpn-113-148.phx2.redhat.com [10.3.113.148]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s1CJMLO8001925 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Wed, 12 Feb 2014 14:22:21 -0500 From: Tom Tromey To: Eli Zaretskii Cc: gdb-patches@sourceware.org Subject: Re: GDB 7.7 crashes on LTO-built executable References: <83lhxgs05d.fsf@gnu.org> <83ioskrznz.fsf@gnu.org> Date: Wed, 12 Feb 2014 19:22:00 -0000 In-Reply-To: <83ioskrznz.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 12 Feb 2014 19:47:28 +0200") Message-ID: <87ob2ct9ua.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2014-02/txt/msg00429.txt.bz2 >> Is there a better way than saying "unknown" when s->debugformat is >> NULL? Eli> A better way to fix the crash, I mean. I looked a tiny bit. I don't know what code path hits this, but basically something is not calling record_debugformat when it ought to. So one way to fix the bug would be to track down what this is. I would probably start by finding where the symtab in question was allocated. The current design seems fragile in that it requires sprinkling these calls to record_debugformat all around. I did find this comment in buildsym.c: /* Save the debug format string (if any) in the symtab. */ symtab->debugformat = subfile->debugformat; And it does seem that nothing tries to ensure that a subfile's debugformat is set. So perhaps fixing it at the printf site is fine; or alternatively changing the field's initialization in start_subfile. Though it seems better to try to fix the value properly; since "unknown" can't ever really be correct -- it it's unknown one wonders how gdb could have read it :) Tom