Bug 19026 - ODR optimization considers types with same name and different size to be equivalent
Summary: ODR optimization considers types with same name and different size to be equi...
Status: RESOLVED FIXED
Alias: None
Product: libabigail
Classification: Unclassified
Component: default (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Dodji Seketeli
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-29 21:06 UTC by Ben Woodard
Modified: 2015-11-09 17:46 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
reproducing ELF file. (5.92 MB, application/x-gzip)
2015-09-29 21:06 UTC, Ben Woodard
Details
a different build (5.82 MB, application/x-gzip)
2015-09-29 21:19 UTC, Ben Woodard
Details
A new reproducer. (510.85 KB, application/x-bzip2)
2015-10-15 17:08 UTC, Ben Woodard
Details
An even newer reproducer (522.70 KB, application/x-sharedlib)
2015-11-04 16:58 UTC, Ben Woodard
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ben Woodard 2015-09-29 21:06:39 UTC
Created attachment 8648 [details]
reproducing ELF file.

hype356@ben:~/bin/abidw --abidiff /collab/usr/global/tools/order/spack/opt/chaos_5_x86_64_ib/gcc@4.4.7/dyninst@8.1.2-b04 ^M0c20e/lib/libparseAPI.so
Functions changes summary: 0 Removed, 19 Changed, 0 Added functions
Variables changes summary: 0 Removed, 0 Changed, 0 Added variable

19 functions with some indirect sub-type change:

  [C]'method virtual Dyninst::ASTVisitor::ASTPtr Dyninst::ASTVisitor::visit(Dyninst::DataflowAPI::ConstantAST*)' has some indirect sub-type changes:
    return type changed:
      typedef name changed from Dyninst::ASTVisitor::ASTPtr to Dyninst::DataflowAPI::BooleanVisitor::ASTPtr

<snip>

  [C]'method virtual const std::string Dyninst::DataflowAPI::RoseAST::format()' has some indirect sub-type changes:
    return type changed:
      in unqualified underlying type 'typedef std::string':
        underlying type 'struct std::basic_string<char, std::char_traits<char>, std::allocator<char> >' changed:
          1 data member change:
abidw: ../../src/abg-comparison.cc:10185: abigail::comparison::base_diff_sptr abigail::comparison::compute_diff(abigail::ir::class_decl::base_spec_sptr, abigail::ir::class_decl::base_spec_sptr, abigail::comparison::diff_context_sptr): Assertion `first->get_environment() == second->get_environment()' failed.
Aborted (core dumped)

This looks like a different assert than the other one. Also some ABI information must not be being properly stored due to the fact that there are a lot of ABI symmetry problems.
Comment 1 Ben Woodard 2015-09-29 21:17:00 UTC
Another build of the file seems to have some entirely different ABI symmetry problems and doesn't cause abidw to assert:

hype356@ben:~/bin/abidw --abidiff /collab/usr/global/tools/order/spack/opt/chaos_5_x86_64_ib/gcc@4.4.7/dyninst@8.2.1-a77e6bbb/lib/libparseAPI.so
Functions changes summary: 0 Removed, 3 Changed, 0 Added functions
Variables changes summary: 0 Removed, 0 Changed, 0 Added variable

3 functions with some indirect sub-type change:

  [C]'method std::_Rb_tree_iterator<std::pair<const boost::shared_ptr<Dyninst::Assignment>, boost::shared_ptr<Dyninst::AST> > > std::_Rb_tree<boost::shared_ptr<Dyninst::Assignment>, std::pair<const boost::shared_ptr<Dyninst::Assignment>, boost::shared_ptr<Dyninst::AST> >, std::_Select1st<std::pair<const boost::shared_ptr<Dyninst::Assignment>, boost::shared_ptr<Dyninst::AST> > >, std::less<boost::shared_ptr<Dyninst::Assignment> >, std::allocator<std::pair<const boost::shared_ptr<Dyninst::Assignment>, boost::shared_ptr<Dyninst::AST> > > >::_M_insert_(const std::_Rb_tree_node_base*, const std::_Rb_tree_node_base*, const std::pair<const boost::shared_ptr<Dyninst::Assignment>, boost::shared_ptr<Dyninst::AST> >&)' has some indirect sub-type changes:
    parameter 3 of type 'const std::pair<const boost::shared_ptr<Dyninst::Assignment>, boost::shared_ptr<Dyninst::AST> >&' has sub-type changes:
      in referenced type 'const std::pair<const boost::shared_ptr<Dyninst::Assignment>, boost::shared_ptr<Dyninst::AST> >':
        in unqualified underlying type 'struct std::pair<const boost::shared_ptr<Dyninst::Assignment>, boost::shared_ptr<Dyninst::AST> >':
          1 data member change:
           type of 'const boost::shared_ptr<Dyninst::Assignment> std::pair<const boost::shared_ptr<Dyninst::Assignment>, boost::shared_ptr<Dyninst::AST> >::first' changed:
             in unqualified underlying type 'class boost::shared_ptr<Dyninst::Assignment>':
               1 data member change:
                type of 'Dyninst::Assignment* boost::shared_ptr<Dyninst::Assignment>::px' changed:
                  in pointed to type 'class Dyninst::Assignment':
                    1 data member change:
                     type of 'Dyninst::InstructionAPI::InstructionDecoder::Ptr Dyninst::Assignment::insn_' changed:
                       typedef name changed from Dyninst::InstructionAPI::InstructionDecoder::Ptr to Dyninst::Assignment::Ptr





  [C]'method std::pair<std::_Rb_tree_iterator<std::pair<const boost::shared_ptr<Dyninst::Assignment>, boost::shared_ptr<Dyninst::AST> > >, bool> std::_Rb_tree<boost::shared_ptr<Dyninst::Assignment>, std::pair<const boost::shared_ptr<Dyninst::Assignment>, boost::shared_ptr<Dyninst::AST> >, std::_Select1st<std::pair<const boost::shared_ptr<Dyninst::Assignment>, boost::shared_ptr<Dyninst::AST> > >, std::less<boost::shared_ptr<Dyninst::Assignment> >, std::allocator<std::pair<const boost::shared_ptr<Dyninst::Assignment>, boost::shared_ptr<Dyninst::AST> > > >::_M_insert_unique(const std::pair<const boost::shared_ptr<Dyninst::Assignment>, boost::shared_ptr<Dyninst::AST> >&)' has some indirect sub-type changes:
    parameter 1 of type 'const std::pair<const boost::shared_ptr<Dyninst::Assignment>, boost::shared_ptr<Dyninst::AST> >&' has sub-type changes:
      in referenced type 'const std::pair<const boost::shared_ptr<Dyninst::Assignment>, boost::shared_ptr<Dyninst::AST> >':
        unqualified underlying type 'struct std::pair<const boost::shared_ptr<Dyninst::Assignment>, boost::shared_ptr<Dyninst::AST> >' changed, as reported earlier

  [C]'method std::_Rb_tree_iterator<std::pair<const boost::shared_ptr<Dyninst::Assignment>, boost::shared_ptr<Dyninst::AST> > > std::_Rb_tree<boost::shared_ptr<Dyninst::Assignment>, std::pair<const boost::shared_ptr<Dyninst::Assignment>, boost::shared_ptr<Dyninst::AST> >, std::_Select1st<std::pair<const boost::shared_ptr<Dyninst::Assignment>, boost::shared_ptr<Dyninst::AST> > >, std::less<boost::shared_ptr<Dyninst::Assignment> >, std::allocator<std::pair<const boost::shared_ptr<Dyninst::Assignment>, boost::shared_ptr<Dyninst::AST> > > >::_M_insert_unique_(std::_Rb_tree_const_iterator<std::pair<const boost::shared_ptr<Dyninst::Assignment>, boost::shared_ptr<Dyninst::AST> > >, const std::pair<const boost::shared_ptr<Dyninst::Assignment>, boost::shared_ptr<Dyninst::AST> >&)' has some indirect sub-type changes:
    parameter 2 of type 'const std::pair<const boost::shared_ptr<Dyninst::Assignment>, boost::shared_ptr<Dyninst::AST> >&' has sub-type changes:
      in referenced type 'const std::pair<const boost::shared_ptr<Dyninst::Assignment>, boost::shared_ptr<Dyninst::AST> >':
        unqualified underlying type 'struct std::pair<const boost::shared_ptr<Dyninst::Assignment>, boost::shared_ptr<Dyninst::AST> >' changed, as reported earlier
Comment 2 Ben Woodard 2015-09-29 21:19:38 UTC
Created attachment 8649 [details]
a different build

This is a different build of the same library but it manifests different errors.
Comment 3 Dodji Seketeli 2015-10-15 12:35:19 UTC
This issue seems to be fixed by the fix for PR libabigail/19024

Thank you for reporting this problem!
Comment 4 Ben Woodard 2015-10-15 17:07:07 UTC
I am still getting a few of these assertions:

hype356@ben:~/bin/abidw --abidiff /collab/usr/global/tools/order/spack/opt/chaos_5_x86_64_ib/gcc@4.4.7/vtk@6.1.0-2f431570/lib/libvtkIOSQL-6.1.so.1
abidw: ../../src/abg-comparison.cc:10141: abigail::comparison::base_diff_sptr abigail::comparison::compute_diff(abigail::ir::class_decl::base_spec_sptr, abigail::ir::class_decl::base_spec_sptr, abigail::comparison::diff_context_sptr): Assertion `first->get_environment() == second->get_environment()' failed.
Aborted (core dumped)
Comment 5 Ben Woodard 2015-10-15 17:08:11 UTC
Created attachment 8720 [details]
A new reproducer.
Comment 6 Ben Woodard 2015-10-15 17:16:00 UTC
(In reply to Ben Woodard from comment #4)
> I am still getting a few of these assertions:

I forgot to say that this was with the master branch and the last commit up through: 09de4435ce4c3d9df2aeda6c0fa615faa2a63bb5
Comment 7 Dodji Seketeli 2015-10-17 16:09:51 UTC
Yes, I am seeing this.  I think I introduced a thinko in the fix I proposed for this issue.

I am thus proposing another fix, in the master branch at commit https://sourceware.org/git/gitweb.cgi?p=libabigail.git;a=commit;h=75515395e1609000df42cf7ebfedb943ed42b547

I am tentatively closing this bug again.

Thank you very much for following up on this, it's very appreciated.

And sorry for me screwing up.
Comment 8 Ben Woodard 2015-11-04 16:54:07 UTC
And I'm reopening it again because I'm still seeing it as of yesterday with the master.
Comment 9 Ben Woodard 2015-11-04 16:58:22 UTC
Created attachment 8766 [details]
An even newer reproducer
Comment 10 Dodji Seketeli 2015-11-09 17:46:23 UTC
Yes, I see the issue, thanks.

Just for information, the problem in the binary attached to https://sourceware.org/bugzilla/attachment.cgi?id=8766 is different from the one you initially opened this bug with.

Here the issue is due to libabigail failing to propagate the "environment" property of a class type to its base class specifiers.

This should now be fixed by commit https://sourceware.org/git/gitweb.cgi?p=libabigail.git;a=commit;h=4a8ea96dab0195b8069e0940e86bc858a20f1f29 in the master branch.

Thanks.