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/27208] New: abicompat doesn't check back calls.
Date: Tue, 19 Jan 2021 21:54:31 +0000	[thread overview]
Message-ID: <bug-27208-9487@http.sourceware.org/bugzilla/> (raw)

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

            Bug ID: 27208
           Summary: abicompat doesn't check back calls.
           Product: libabigail
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: default
          Assignee: dodji at redhat dot com
          Reporter: woodard at redhat dot com
                CC: libabigail at sourceware dot org
  Target Milestone: ---

Created attachment 13135
  --> https://sourceware.org/bugzilla/attachment.cgi?id=13135&action=edit
reproducer code.

abicompat doesn't check calls from a library into functions provided by an
application. It only checks that calls from the app into a library provide the
same ABI. This is not sufficient to assert abi compatibility.

Say for example you have:

#include <stdio.h>

char *backcall( char *arg){
  return arg+1;
}

char *libcall( char *arg);

int main(int argc, char **argv){
  printf("%s\n", libcall(argv[0]));
  return 0;
}

and in a library you have:

// this would normally be in a header provided by the app
// it is just here to make the reproducer simple.
char *backcall( char *arg); 

char *libcall( char *arg){
  return backcall(arg);
}

However an older or a newer version of the app provided a different interface
and so the library is:

// notice this is different
int backcall( char *arg);

char *libcall( char *arg){
  return arg+backcall(arg);
}

So abicompat should point out that the second version of the library is not
compatible with the app but it doesn't.

$ abicompat app1 libt1.so libt2.so 
$ echo $?
0

The problem is that abicompat doesn't perform 2 way comparison with the
library. it doesn't mark the call from the library to the application as needed
then compare that to what the application provides.

This programming style is not uncommon. It happens anytime there is a defined
plugin interface

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

             reply	other threads:[~2021-01-19 21:54 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-19 21:54 woodard at redhat dot com [this message]
2021-01-19 21:56 ` [Bug default/27208] " woodard at redhat dot com
2021-01-19 22:12 ` woodard at redhat dot com
2021-03-04 18:12 ` woodard at redhat dot com
2021-05-17 18:14 ` woodard at redhat dot com
2021-05-17 18:45 ` [Bug default/27208] Eabicompat doesn't consider functions (or variables) whose symbol type is NOTYPE woodard at redhat dot com
2021-06-08  0:21 ` [Bug default/27208] abicompat " woodard at redhat dot com
2022-03-29 20:41 ` [Bug default/27208] abicompat doesn't consider references from the libraries to the main executable woodard at redhat dot com
2022-03-31  9:06 ` woodard at redhat dot com
2022-03-31 10:08 ` woodard at redhat dot com
2022-03-31 10:21 ` 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-27208-9487@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).