From patchwork Sat Jul 9 20:29:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: mark at klomp dot org X-Patchwork-Id: 55904 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5983538582A7 for ; Sat, 9 Jul 2022 20:29:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5983538582A7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1657398598; bh=h7PLzEcCEk15mbqLI7xu10JtKlpK65biq4K4AlGTFCs=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Help:List-Subscribe:From:Reply-To:From; b=BSZLakBc6GXCc1jRpK9h/o7AFWlE94QayLjvqJXbFyQyARV1vMm5TSQS+lqj1eFYV YqRg0scFUc+ZtSmIFzhlT6hAtFkyPLXoFP5pOCpzj0vFiqX4cTuYsG1l3/Rd49Hgxn 2CqsOQUsNMaK1cjf/rl4KaskNYZNQ7sExjtLcQ8M= X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org Received: by sourceware.org (Postfix, from userid 48) id 136A938582A7; Sat, 9 Jul 2022 20:29:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 136A938582A7 To: libabigail@sourceware.org Subject: [Bug default/29346] SIGFPE when doing abipkgdiff --self-check of aisleriot-debuginfo-3.22.21-1.fc36.aarch64.rpm Date: Sat, 09 Jul 2022 20:29:55 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: libabigail X-Bugzilla-Component: default X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: minor X-Bugzilla-Who: mark at klomp dot org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: dodji at redhat dot com X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-Patchwork-Original-From: mark at klomp dot org via Libabigail From: mark at klomp dot org Reply-To: mark at klomp dot org Errors-To: libabigail-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libabigail" https://sourceware.org/bugzilla/show_bug.cgi?id=29346 --- Comment #2 from Mark Wielaard --- I probably should have tried to compile it at least. This actually compiles (but I haven't replicated the original issue): if (data == NULL) diff --git a/src/abg-dwarf-reader.cc b/src/abg-dwarf-reader.cc index 32a2cead..f2f06037 100644 --- a/src/abg-dwarf-reader.cc +++ b/src/abg-dwarf-reader.cc @@ -16634,8 +16634,11 @@ get_soname_of_elf_file(const string& path, string &soname) Elf_Scn* scn = gelf_offscn (elf, phdr->p_offset); GElf_Shdr shdr_mem; GElf_Shdr* shdr = gelf_getshdr (scn, &shdr_mem); + size_t entsize = (shdr != NULL && shdr->sh_entsize != 0 + ? shdr->sh_entsize + : gelf_fsize (elf, ELF_T_DYN, 1, EV_CURRENT)); int maxcnt = (shdr != NULL - ? shdr->sh_size / shdr->sh_entsize : INT_MAX); + ? shdr->sh_size / entsize : INT_MAX); ABG_ASSERT (shdr == NULL || shdr->sh_type == SHT_DYNAMIC); Elf_Data* data = elf_getdata (scn, NULL);