public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
From: "maennich at android dot com" <sourceware-bugzilla@sourceware.org>
To: libabigail@sourceware.org
Subject: [Bug default/27715] Fails to detect GObjectClass ABI changes
Date: Wed, 14 Apr 2021 10:53:45 +0000	[thread overview]
Message-ID: <bug-27715-9487-B4Rj0MxMlY@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-27715-9487@http.sourceware.org/bugzilla/>

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

--- Comment #9 from Matthias Maennich <maennich at android dot com> ---
Anything passed to the API via opaque pointers is essentially hidden from ABI
analysis as no type information (other than void*) is attached to it. From an
ABI point of view the ABI of the symbol that passes void* is unchanged. Though
further down this of course can become incompatible.

There are cases that you intentionally want to pass void* to be ABI compatible
even though the type changes. E.g. if your library has such an interface:

void* get_handle(){
  // allocates the resources and returns just a handle to it.
  ...
  return (void*) some_object;
}

void do_something(void* handle) {
  // uses the handle as a reference
}

The ABI is stable even though the type could have changed. The client code
might not even know the concrete type and is also not supposed to cast to it.

So, as much as I would also like to sometimes inspect underlying types of
void*, flagging changes to those types is probably wrong. If you want this type
to be stable, you need to let it participate as a type in the interface.

One way of achieving this is to define a symbol just for the sake of ABI
analysis:

void (struct _GTypeModuleClass obj) { }

This will get picked up by libabigail and the type will participate in the
analysis then.

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

  parent reply	other threads:[~2021-04-14 10:53 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-09 17:05 [Bug default/27715] New: " marcandre.lureau at gmail dot com
2021-04-09 17:54 ` [Bug default/27715] " maennich at android dot com
2021-04-12  8:21 ` marcandre.lureau at gmail dot com
2021-04-12  9:49 ` maennich at android dot com
2021-04-12 13:54 ` marcandre.lureau at gmail dot com
2021-04-12 13:55 ` marcandre.lureau at gmail dot com
2021-04-12 13:55 ` marcandre.lureau at gmail dot com
2021-04-12 14:05 ` maennich at android dot com
2021-04-12 19:01 ` marcandre.lureau at gmail dot com
2021-04-14 10:53 ` maennich at android dot com [this message]
2021-04-20 11:55 ` marcandre.lureau at gmail dot com
2021-04-29 15:13 ` marcandre.lureau at gmail 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-27715-9487-B4Rj0MxMlY@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).