public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
From: "mark at klomp dot org" <sourceware-bugzilla@sourceware.org>
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:13:57 +0000	[thread overview]
Message-ID: <bug-29346-9487-lJQlrEssUr@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-29346-9487@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=29346

Mark Wielaard <mark at klomp dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mark at klomp dot org

--- Comment #1 from Mark Wielaard <mark at klomp dot org> ---

> Thread 1 "abipkgdiff" received signal SIGFPE, Arithmetic exception.
> 0x00007ffff7e37aa3 in abigail::dwarf_reader::get_soname_of_elf_file
> (path="/home/ben/.cache/libabigail/abipkgdiff-tmp-dir-ipFB18/package1/usr/lib64/aisleriot/guile/3.0/yield.go", soname="") at ../../../libabigail/src/abg-dwarf-reader.cc:16638
> 16638                           ? shdr->sh_size / shdr->sh_entsize : INT_MAX);

The issue is that the yield.go file (a guile generated ELF file) has sh_entsize
of zero for the .dynamic section. I think that is a bug in guile. And it is
slightly questionable that abipkgdiff tries to diff the abi of a generated
guile file. But something like the following should fix it (untested):

diff --git a/src/abg-dwarf-reader.cc b/src/abg-dwarf-reader.cc
index 32a2cead..f08f194b 100644
--- a/src/abg-dwarf-reader.cc
+++ b/src/abg-dwarf-reader.cc
@@ -16634,6 +16634,8 @@ 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->sh_entsize
+                            ?: gelf_fsize (elf, ELF_T_DYN, 1, EV_CURRENT));
           int maxcnt = (shdr != NULL
                         ? shdr->sh_size / shdr->sh_entsize : INT_MAX);
           ABG_ASSERT (shdr == NULL || shdr->sh_type == SHT_DYNAMIC);

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  reply	other threads:[~2022-07-09 20:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-09 19:02 [Bug default/29346] New: " woodard at redhat dot com
2022-07-09 20:13 ` mark at klomp dot org [this message]
2022-07-09 20:29 ` [Bug default/29346] " mark at klomp dot org
2022-07-20  9:35 ` mark at klomp dot org
2022-07-26 20:17 ` woodard at redhat dot com
2022-07-28 22:01 ` woodard at redhat dot com
2022-07-29 22:51 ` woodard at redhat dot com
2022-07-29 23:21 ` woodard at redhat dot com
2022-10-14 18:53 ` woodard at redhat dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-29346-9487-lJQlrEssUr@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=libabigail@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).