From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 76352 invoked by alias); 29 Jan 2018 10:53:48 -0000 Mailing-List: contact elfutils-devel-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: elfutils-devel-owner@sourceware.org Received: (qmail 76341 invoked by uid 89); 29 Jan 2018 10:53:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.99.2 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY autolearn=ham version=3.3.2 spammy=valgrind X-Spam-Status: No, score=-25.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-HELO: gnu.wildebeest.org Received: from wildebeest.demon.nl (HELO gnu.wildebeest.org) (212.238.236.112) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 29 Jan 2018 10:53:43 +0000 Received: from tarox.wildebeest.org (tarox.wildebeest.org [172.31.17.39]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id BD7F9302BB06 for ; Mon, 29 Jan 2018 11:53:40 +0100 (CET) Received: by tarox.wildebeest.org (Postfix, from userid 1000) id 922D340216B7; Mon, 29 Jan 2018 11:53:40 +0100 (CET) Message-ID: <1517223220.32569.2.camel@klomp.org> Subject: Re: [PATCH] libdw: Resolve alt file on first use. From: Mark Wielaard To: elfutils-devel@sourceware.org Date: Mon, 29 Jan 2018 10:53:00 -0000 In-Reply-To: <1516894088.17912.97.camel@klomp.org> References: <1516620651-14393-1-git-send-email-mark@klomp.org> <1516894088.17912.97.camel@klomp.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Evolution 3.22.6 (3.22.6-10.el7) Mime-Version: 1.0 X-Spam-Flag: NO X-IsSubscribed: yes X-SW-Source: 2018-q1/txt/msg00016.txt.bz2 On Thu, 2018-01-25 at 16:28 +0100, Mark Wielaard wrote: > Testing under valgrind showed that this should be build_id_len <=3D 0. > When dwelf_dwarf_gnu_debugaltlink returns 0 it means there was no > .gnu_debugaltlink section at all. A negative return value means the > data found was corrupt. In both cases neither altname nor build_id > might be set up. So I added the following fixup: >=20 > diff --git a/libdw/dwarf_getalt.c b/libdw/dwarf_getalt.c > index 7b41a2b..3e5af15 100644 > --- a/libdw/dwarf_getalt.c > +++ b/libdw/dwarf_getalt.c > @@ -117,7 +117,7 @@ find_debug_altlink (Dwarf *dbg) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0&build > _id); > =C2=A0 > =C2=A0=C2=A0=C2=A0/* Couldn't even get the debugaltlink.=C2=A0=C2=A0It pr= obably doesn't > exist.=C2=A0=C2=A0*/ > -=C2=A0=C2=A0if (build_id_len < 0) > +=C2=A0=C2=A0if (build_id_len <=3D 0) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0return; > =C2=A0 > =C2=A0=C2=A0=C2=A0const uint8_t *id =3D (const uint8_t *) build_id; I pushed this patch to master with this small fixup. Cheers, Mark