public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
* [Bug default/27331] New: abidiff --leaf-changes-only is blind to bitfield offset changes
@ 2021-02-03 10:26 gprocida+abigail at google dot com
  2021-02-03 13:14 ` [Bug default/27331] " dodji at redhat dot com
  0 siblings, 1 reply; 2+ messages in thread
From: gprocida+abigail at google dot com @ 2021-02-03 10:26 UTC (permalink / raw)
  To: libabigail

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

            Bug ID: 27331
           Summary: abidiff --leaf-changes-only is blind to bitfield
                    offset changes
           Product: libabigail
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: default
          Assignee: dodji at redhat dot com
          Reporter: gprocida+abigail at google dot com
                CC: libabigail at sourceware dot org
  Target Milestone: ---

I have verified this at 271e3afaf6f2b6f38b4f125f64f5b24a8f78459f which is
current master and at c45d70d08d7526050df354da853957bbe11e5253 which is from
just over a year ago.

$ head -1000 /tmp/bitfield.?.c
==> /tmp/bitfield.0.c <==
struct S {
  int var : 1;
};
int fun(struct S s) { return s.var; }

==> /tmp/bitfield.1.c <==
struct S {
  int : 1, var : 1;
};
int fun(struct S s) { return s.var; }
$ for i in 0 1; do gcc -Wall -Wextra -g -c bitfield.$i.c; done
$ ~/android/libabigail/build/tools/abidiff /tmp/bitfield.?.o
Functions changes summary: 0 Removed, 1 Changed, 0 Added function
Variables changes summary: 0 Removed, 0 Changed, 0 Added variable

1 function with some indirect sub-type change:

  [C] 'function int fun(S)' at bitfield.1.c:5:1 has some indirect sub-type
changes:
    parameter 1 of type 'struct S' has sub-type changes:
      type size hasn't changed
      1 data member change:
        'int S::var' offset changed from 0 to 1 (in bits) (by +1 bits)

$ ~/android/libabigail/build/tools/abidiff --leaf-changes-only
/tmp/bitfield.?.o
Leaf changes summary: 0 artifact changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 0 Added function
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug default/27331] abidiff --leaf-changes-only is blind to bitfield offset changes
  2021-02-03 10:26 [Bug default/27331] New: abidiff --leaf-changes-only is blind to bitfield offset changes gprocida+abigail at google dot com
@ 2021-02-03 13:14 ` dodji at redhat dot com
  0 siblings, 0 replies; 2+ messages in thread
From: dodji at redhat dot com @ 2021-02-03 13:14 UTC (permalink / raw)
  To: libabigail

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

dodji at redhat dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED

--- Comment #1 from dodji at redhat dot com ---
The problem here seems to be that the leaf mode is not showing the equivalent
of what the default mode is showing.

And the default mode is showing changes to the offset of the S::var data
member.

So I believe that the bug here is that the leaf reporting mode is not showing
changes the offset of a data member, in this particular case.

This particular issue should now be fixed by commit
https://sourceware.org/git/?p=libabigail.git;a=commit;h=013a19c5fe300265f3fadc27963f84bde2c3b6ef
in the mainline branch.

However, it appears that libabigail doesn't represent the size of bitfields. 
It thus doesn't detect the size of those bitfields, per say.  It will only
indirectly detect changes to those size when they affect other properties of
the type, like the offset of subsequent data members or the size of the
enclosing type.

In the grand scheme of things, it would be cool to detect bitfield changes even
if they don't affect subsequent data member offsets or the size of the
enclosing type.  To that effect, the enhancement request #27334 has been filed.

Thanks for taking the time to report this issue!

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-02-03 13:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-03 10:26 [Bug default/27331] New: abidiff --leaf-changes-only is blind to bitfield offset changes gprocida+abigail at google dot com
2021-02-03 13:14 ` [Bug default/27331] " dodji at redhat dot com

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).