Bug 18828 - abidw assertion failure at abg-dwarf-reader.cc:2401
Summary: abidw assertion failure at abg-dwarf-reader.cc:2401
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-08-14 17:03 UTC by andrew.c.morrow
Modified: 2015-08-15 13:07 UTC (History)
1 user (show)

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


Attachments
Reproducing shared library (226.46 KB, application/x-sharedlib)
2015-08-14 17:03 UTC, andrew.c.morrow
Details

Note You need to log in before you can comment on or make changes to this bug.
Description andrew.c.morrow 2015-08-14 17:03:38 UTC
Created attachment 8523 [details]
Reproducing shared library

Currently using abidw built from source at SHA 160961f3cb5f717ed8260ff210fc5efd19e1204e
on Ubuntu 15.04 using the system GCC (4.9.2).

I'm encountering an assertion failure as follows when run against a shared library built as part of the MongoDB build:

abidw: abg-dwarf-reader.cc:2401: void abigail::dwarf_reader::read_context::resolve_declaration_only_classes(): Assertion `(*j)->get_is_declaration_only() && (*j)->get_size_in_bits() == 0 && ((*j)->get_definition_of_declaration() == 0)' failed.

I've reproduced this crash with the library generated by both clang and GCC. You can reproduce as follows (you will need python, SCons, openssl, etc., to build):

> git clone https://github.com/mongodb/mongo.git
> cd mongo
> git checkout 86eddcdacd400f634f9859ae7d70113d91a29d0e
> scons CC=/usr/bin/gcc CXX=/usr/bin/g++ --dbg=on --opt=off --ssl --link-model=dynamic -j24 build/debug/mongo/db/auth/libsasl_options.so ABIDW=<path-to-abidw>

I've attached a copy of the failing library.

To use this mechanism to search for other libraries which may cause problems, replace the explicit path build/debug/mongo/db/auth/libsasl_options.so with the target 'all'.
Comment 1 Dodji Seketeli 2015-08-14 20:44:44 UTC
Confirmed.  Working on a fix.
Comment 2 Dodji Seketeli 2015-08-14 22:32:17 UTC
This issue should now be fixed in the master branch by the commit https://sourceware.org/git/gitweb.cgi?p=libabigail.git;a=commit;h=f38c19f8daece69475c090f0d4f5cde9949470ad.

Thanks!
Comment 3 andrew.c.morrow 2015-08-15 13:07:25 UTC
Just pulled your changes and I can now run abidw on that library. The abidw enabled MongoDB build now gets much further. I have though found another assertion failure at abg-dwarf-reader.cc:6537:

abidw: abg-dwarf-reader.cc:6537: abigail::ir::class_decl_sptr abigail::dwarf_reader::build_class_type_and_add_to_ir(abigail::dwarf_reader::read_context&, Dwarf_Die*, bool, abigail::ir::scope_decl*, bool, abigail::ir::class_decl_sptr, bool, size_t): Assertion `ctxt.is_decl_only_class_scheduled_for_resolution(b)' failed.

I'll get another ticket pulled together for that with the reproducing library, but likely not until Monday.