public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
From: "woodard at redhat dot com" <sourceware-bugzilla@sourceware.org>
To: libabigail@sourceware.org
Subject: [Bug default/30034] [libabigail] Handle library splitting
Date: Mon, 05 Jun 2023 16:53:16 +0000	[thread overview]
Message-ID: <bug-30034-9487-PVSXGz5rMN@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-30034-9487@http.sourceware.org/bugzilla/>

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

--- Comment #7 from Ben Woodard <woodard at redhat dot com> ---
(In reply to dodji from comment #6)
> "david.marchand at redhat dot com" <sourceware-bugzilla@sourceware.org>
> writes:
> 
> [...]
> 
> > Asking for a abidiff on this librte_eal.so library file would make libabigail
> > parse libm.so.6, libnuma.so.1 etc....
> 
> Where would libabigail find those (dependant) libraries?

Each ELF file optionally has a list of DT_NEEDED. So what we are asking for is
for libabigail to read the DT_NEEDED entries and use logic like ld.so to find
those libraries and then load them into the corpus group along with their
library dependencies. This is of course a recursive operation.

In a prototype that I was doing for 27514, rather than trying to imperfectly
implement ld.so's dependency resolution behavior, I reused the environment
variables used by the /usr/bin/ldd script to make ld.so generate the list of
dependencies for me. Then I just parsed the output. (I do believe that ld.so
should have a C tools interface which would do the same thing but this
currently doesn't exist in the current glibc)

If you would like, I can dig the old prototype code for this out of my git
tree.

> 
> > There may be a concern with recursivity, because parsing the dependencies of
> > dependencies could become troublesome and consume a lot of cpu/memory.
> 
> We could limit (by default) the dependant libraries to those that are
> dependencies of the libraries provided on the command line.  E.g, the
> dependencies of libm.so.6 would be ignored. 

No!!!!!
Let's do the complete closure of needed libraries. 
This creates so many problems for us that we basically haven't been able to use
libabigail for its intended purpose. I believe the abicompat example provides
the clearest example of how counter intuitive the current behavior is.

app requires lib1 and lib2

We want to know if a new version of lib1 is compatible with app. Let's call
this lib1'

to do this the expected behavior is:

abicompat app lib1 lib1'

The problem is app only makes use of a few functions in lib1. However, lib2
makes extensive use of lib1's interfaces. 

If the changes in lib1 do not affect the functions called by app then
"abicompat app lib1 lib1' " will give a false sense of compatibility.
Arguably the fix for this problem is to do the recursive expansion of the
needed library space outside of libabigail. In this case it would be:
"abicompat lib2 lib1 lib1' " 

The problem is that some of our apps have as many as 1200 libraries. Consider:
https://computing.llnl.gov/sites/default/files/2021-03/LBANN%20dependencies%20-%20small%20for%20Word.png
which is one of our apps. This ends up being an almost factorial expansion.
With the repeated parsing of each ELF file's DWARF or even abixml, turning this
into a script takes vastly more time than if the complete closure of the used
interfaces were computed inside of libabigail.

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

  parent reply	other threads:[~2023-06-05 16:53 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-23 13:45 [Bug default/30034] New: " david.marchand at redhat dot com
2023-06-02 17:53 ` [Bug default/30034] " dodji at redhat dot com
2023-06-05  8:04 ` david.marchand at redhat dot com
2023-06-05 11:01 ` dodji at redhat dot com
2023-06-05 15:08 ` david.marchand at redhat dot com
2023-06-05 15:24 ` woodard at redhat dot com
2023-06-05 15:36 ` dodji at redhat dot com
2023-06-05 16:53 ` woodard at redhat dot com [this message]
2023-06-06  7:28 ` david.marchand at redhat dot com
2023-06-06 21:07 ` woodard at redhat dot com
2023-06-09 12:29 ` dodji at redhat dot com
2023-06-14 12:22 ` david.marchand at redhat dot com
2023-06-23  8:30 ` david.marchand at redhat dot com
2023-06-23  8:32 ` david.marchand at redhat dot com
2023-06-23 10:17 ` david.marchand at redhat dot com
2023-06-24 14:19 ` dodji at redhat dot com
2023-06-24 14:32 ` dodji at redhat dot com
2023-06-25  8:17 ` david.marchand at redhat dot com
2023-06-25  8:37 ` david.marchand at redhat dot com
2023-06-26 10:07 ` dodji at redhat dot com
2023-06-26 10:11 ` dodji at redhat dot com
2023-06-26 12:13 ` david.marchand at redhat dot com
2023-06-26 12:41 ` david.marchand at redhat dot com
2023-06-26 13:57 ` dodji at redhat dot com
2023-07-06 13:38 ` david.marchand at redhat dot com
2023-07-07  8:38   ` Dodji Seketeli
2023-07-07  8:39 ` dodji at seketeli dot org
2023-07-07 11:48 ` dodji at redhat dot com
2023-07-07 13:55 ` fweimer at redhat dot com
2023-07-07 18:18 ` dodji 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-30034-9487-PVSXGz5rMN@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).