public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
* [Bug default/26998] New: abidiff --leaf-changes-only misreports array member changes
@ 2020-12-02 17:10 gprocida+abigail at google dot com
  2020-12-03 10:43 ` [Bug default/26998] " gprocida+abigail at google dot com
  2020-12-03 12:45 ` gprocida+abigail at google dot com
  0 siblings, 2 replies; 3+ messages in thread
From: gprocida+abigail at google dot com @ 2020-12-02 17:10 UTC (permalink / raw)
  To: libabigail

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

            Bug ID: 26998
           Summary: abidiff --leaf-changes-only misreports array member
                    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: ---

We've seen various cases where abidiff --leaf-changes-only reporting falls off
the bottom of the represent helper resulting in the message "<member> has
*some* difference - please report as a bug".

The problem manifests itself in two different ways. Sometime this message just
appears (and I speculate anonymous type renumbering has something to do with
it). At other times, it's clear that there is a type change but abidiff has
already reported it.

I took a hour or so to dig deeper into one of the latter instances.

Note that extracting ABIs with abidw and then comparing them yields the same
results.

$ head -100 *.c
==> test.0.c <==
struct buzz {
  int a;
};

struct flexible {
  long count;
  struct buzz lightyear[0];
};

void impacted(const struct flexible * flex) { (void) flex; }

==> test.1.c <==
struct buzz {
  long a;
};

struct flexible {
  long count;
  struct buzz lightyear[0];
};

void impacted(const struct flexible * flex) { (void) flex; }
$ for x in test.{0,1}.c; do gcc -Wall -Wextra -g -c $x; done
$ abidiff --impacted-interfaces --leaf-changes-only test.{0,1}.o
Leaf changes summary: 2 artifacts changed
Changed leaf types summary: 2 leaf types 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

'struct buzz at test.0.c:1:1' changed:
  type size changed from 32 to 64 (in bits)
  there are data member changes:
    type 'int' of 'buzz::a' changed:
      type name changed from 'int' to 'long int'
      type size changed from 32 to 64 (in bits)
  one impacted interface:
    function void impacted(const flexible*)

'struct flexible at test.0.c:5:1' changed:
  type size hasn't changed
  there are data member changes:
    'buzz flexible::lightyear[]' has *some* difference - please report as a bug
  one impacted interface:
    function void impacted(const flexible*)

Changing both array sizes from 0 to 1 results in actual (size) difference being
reported for struct flexible. However, this type should probably not be being
reported at all as it's not a leaf type (i.e., a changed type that is the root
cause of other changes).

I'll see if I can generate another test case where there's just a harmless
anonymous type rename and trigger the message that way as well.

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

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

* [Bug default/26998] abidiff --leaf-changes-only misreports array member changes
  2020-12-02 17:10 [Bug default/26998] New: abidiff --leaf-changes-only misreports array member changes gprocida+abigail at google dot com
@ 2020-12-03 10:43 ` gprocida+abigail at google dot com
  2020-12-03 12:45 ` gprocida+abigail at google dot com
  1 sibling, 0 replies; 3+ messages in thread
From: gprocida+abigail at google dot com @ 2020-12-03 10:43 UTC (permalink / raw)
  To: libabigail

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

--- Comment #1 from Giuliano Procida <gprocida+abigail at google dot com> ---
Here's another even smaller test case that has similar issues.

$ head -100 small.?.c
==> small.0.c <==
struct buzz {
  int a;
};

struct flexible {
  struct buzz lightyear[0];
};

struct flexible impacted;

==> small.1.c <==
struct buzz {
  long a;
};

struct flexible {
  struct buzz lightyear[0];
};

struct flexible impacted;
$ for x in small.{0,1}.c; do gcc -Wall -Wextra -g -c $x; done
$ for x in small.{0,1}; do abidw $x.o > $x.abi; done
$ abidiff --leaf-changes-only small.?.o
Leaf changes summary: 3 artifacts changed
Changed leaf types summary: 2 leaf types changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 0 Added function
Removed/Changed/Added variables summary: 0 Removed, 1 Changed, 0 Added variable

1 Changed variable:

  [C] 'flexible impacted' was changed at small.1.c:9:1:
    type of variable changed:
      type size hasn't changed
      there are data member changes:
        'buzz flexible::lightyear[]' has *some* difference - please report as a
bug

'struct buzz at small.0.c:1:1' changed:
  type size changed from 32 to 64 (in bits)
  there are data member changes:
    type 'int' of 'buzz::a' changed:
      type name changed from 'int' to 'long int'
      type size changed from 32 to 64 (in bits)

'struct flexible at small.0.c:5:1' changed:
  details were reported earlier
$ diff <(abidiff --leaf-changes-only small.?.o) <(abidiff --leaf-changes-only
small.?.abi)

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

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

* [Bug default/26998] abidiff --leaf-changes-only misreports array member changes
  2020-12-02 17:10 [Bug default/26998] New: abidiff --leaf-changes-only misreports array member changes gprocida+abigail at google dot com
  2020-12-03 10:43 ` [Bug default/26998] " gprocida+abigail at google dot com
@ 2020-12-03 12:45 ` gprocida+abigail at google dot com
  1 sibling, 0 replies; 3+ messages in thread
From: gprocida+abigail at google dot com @ 2020-12-03 12:45 UTC (permalink / raw)
  To: libabigail

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

--- Comment #2 from Giuliano Procida <gprocida+abigail at google dot com> ---
I have a potential fix for this.

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

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

end of thread, other threads:[~2020-12-03 12:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-02 17:10 [Bug default/26998] New: abidiff --leaf-changes-only misreports array member changes gprocida+abigail at google dot com
2020-12-03 10:43 ` [Bug default/26998] " gprocida+abigail at google dot com
2020-12-03 12:45 ` gprocida+abigail at google 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).