public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
* [Bug default/19638] New: Different output for abidiff a.xml b.xml and abidiff a.xml b.so
@ 2016-01-01  0:00 michi.henning at canonical dot com
  2016-01-01  0:00 ` [Bug default/19638] " dodji at redhat dot com
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: michi.henning at canonical dot com @ 2016-01-01  0:00 UTC (permalink / raw)
  To: libabigail

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

            Bug ID: 19638
           Summary: Different output for abidiff a.xml b.xml and abidiff
                    a.xml b.so
           Product: libabigail
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: default
          Assignee: dodji at redhat dot com
          Reporter: michi.henning at canonical dot com
                CC: libabigail at sourceware dot org
  Target Milestone: ---

I have a base ABI dump in libunity-scopes_1.0.3.abi.xml and a newly-built
library in libunity-scopes.so.1.0.3.

Now I create an ABI dump for the 1.0.3 version like so:

$ abidw --out-file libunity-scopes_1.0.3.abi.xml libunity-scopes.so.1.0.3

And here is a comparison of the base dump against the .so:

$ abidiff --no-unreferenced-symbols --suppressions suppressions
libunity-scopes_1.0.0.abi.xml libunity-scopes_1.0.3.abi.xml 
Functions changes summary: 0 Removed, 0 Changed, 0 Added function (160 filtered
out)
Variables changes summary: 0 Removed, 0 Changed, 0 Added variable

This is what I expect because the two versions are indeed compatible.

Now compare the ABIs again, this time using the base ABI dump and the .so file.
(I have truncated the output to save space.)

$ abidiff --no-unreferenced-symbols --suppressions suppressions
libunity-scopes_1.0.0.abi.xml libunity-scopes.so.1.0.3 
Functions changes summary: 0 Removed, 5 Changed, 1 Added functions (178
filtered out)
Variables changes summary: 0 Removed, 0 Changed, 0 Added variable

1 Added function:

  'method bool
unity::scopes::internal::MiddlewareFactory::MiddlewareData::operator<(const
unity::scopes::internal::MiddlewareFactory::MiddlewareData&)'   
{_ZNK5unity6scopes8internal17MiddlewareFactory14MiddlewareDataltERKS3_}

5 functions with some indirect sub-type change:

  [C]'method unity::scopes::ConfigException::ConfigException(int, const
unity::scopes::ConfigException&)' at ScopeExceptions.cpp:102:1 has some
indirect sub-type changes:
    linkage names of method
unity::scopes::ConfigException::ConfigException(int, const
unity::scopes::ConfigException&)
    changed from
'_ZN5unity6scopes15ConfigExceptionC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE,
_ZN5unity6scopes15ConfigExceptionC2ERKS1_' to
'_ZN5unity6scopes15ConfigExceptionC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE'
    parameter 2 of type 'const unity::scopes::ConfigException&' changed:
      in referenced type 'const unity::scopes::ConfigException':
        'const unity::scopes::ConfigException' changed to 'const
std::__cxx11::string'

This is rather surprising. Not that, instead of 160 suppressed added functions,
this now reports 178 suppressed added functions. It also shows an additional
function in a namespace that isn't suppressed. Why the difference between the
dump file and the .so?

But the serious problem is that, in the second run, I also 5 incompatibilities
that are not reported by the first one.

I would expect it to make no difference when I run

abidiff lib0.xml lib3.xml

as opposed to

abidiff lib0.xml lib3.so

The output should always be identical, I would have thought?

Note that the issue seems to be related to alias entries in the base dump. For
example:

<elf-symbol
name='_ZN5unity6scopes15ConfigExceptionC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE'
type='func-type' binding='global-binding'
alias='_ZN5unity6scopes15ConfigExceptionC2ERKS1_' is-defined='yes'/>

If I delete this line from the base dump, I get 4 ABI conflicts instead of 5,
and 2 added functions instead of 1.

This also relates to the compile flags, it seems. The base dump was produced
from a .so compiled with -g -O2. The current lib was compiled with -g (without
-O2).

If I repeat the exercise with the current lib also compiled with -g -O2, the
output is clean again.

Is there anything abigail can do to deal with this? The problem for us is that,
when testing locally, people typically don't compile with optimization whereas
the builds that are run in our continuous integration machinery do use -O2.

It's really awkward if we get false positives locally, depending on what flags
are used.

When I compile with --coverage, I also get hundreds of added functions.

Any suggestions for how to deal with this? Basically, the goal here is to be
able to build locally and just go "make test" and have the ABI compliance check
pass.

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

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

end of thread, other threads:[~2016-02-17 18:23 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-01  0:00 [Bug default/19638] New: Different output for abidiff a.xml b.xml and abidiff a.xml b.so michi.henning at canonical dot com
2016-01-01  0:00 ` [Bug default/19638] " dodji at redhat dot com
2016-01-01  0:00 ` [Bug default/19638] DWARF reader fails to link clone function to its root declaration dodji at seketeli dot org
2016-01-01  0:00 ` [Bug default/19638] Different output for abidiff a.xml b.xml and abidiff a.xml b.so michi.henning at canonical dot com
2016-01-01  0:00 ` michi.henning at canonical dot com
2016-01-01  0:00 ` dodji at redhat dot com
2016-01-01  0:00 ` [Bug default/19638] DWARF reader fails to link cloned function to its root declaration dodji at seketeli dot org
2016-01-01  0:00 ` [Bug default/19638] Different output for abidiff a.xml b.xml and abidiff a.xml b.so michi.henning at canonical dot com
2016-01-01  0:00 ` [Bug default/19638] DWARF reader fails to link clone function to its root declaration dodji at redhat dot com
2016-01-01  0:00 ` [Bug default/19638] Different output for abidiff a.xml b.xml and abidiff a.xml b.so michi.henning at canonical 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).