Bug 28301 - libabigail asserts with older versions of gcc / glibc
Summary: libabigail asserts with older versions of gcc / glibc
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: 2021-09-02 12:52 UTC by Javier Jardón
Modified: 2023-04-26 14:13 UTC (History)
4 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed: 2021-10-04 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Javier Jardón 2021-09-02 12:52:14 UTC
libabigail version: https://sourceware.org/git/?p=libabigail.git;a=commit;h=ca08bae7422bb5e2a972a2ef88524c67a2811fbc

This version works fine in our current master branch, but It's failing in our previous stable version (release/20.08):

Package versions on those branches:
- master:
  - GCC: gcc-11.2.0
  - glibc: glibc-2.33-49-g22d37364aeaf5f8e4c5108677baaf084871c3006
- relase/20.08:
  - GCC: gcc-10.2.0
  - glibc: glibc-2.31-77-g0c92f409a7b078a50eb7e63ff57eb1e7ef57f90d

Downstream issue: https://gitlab.com/freedesktop-sdk/freedesktop-sdk/-/issues/1310
Comment 1 gprocida 2021-09-02 12:55:35 UTC
It would be most useful to attach or link directly some libraries that cause the problem.
Comment 2 Javier Jardón 2021-09-02 14:06:00 UTC
There is a log in the downstream issue with the libraries that are reporting problems, copying here:

┌────────────────────────┐
│ ABI Break: libanl.so.1 │
└────────────────────────┘
abidiff: ../../src/abg-dwarf-reader.cc:3728: abigail::ir::function_type_sptr abigail::dwarf_reader::read_context::lookup_fn_type_from_die_repr_per_tu(const Dwarf_Die*): Assertion `__abg_cond__' failed.
┌────────────────────────┐
│ ABI Break: libnsl.so.1 │
└────────────────────────┘
abidiff: ../../src/abg-dwarf-reader.cc:3728: abigail::ir::function_type_sptr abigail::dwarf_reader::read_context::lookup_fn_type_from_die_repr_per_tu(const Dwarf_Die*): Assertion `__abg_cond__' failed.
┌────────────────────────────┐
│ ABI Break: libpthread.so.0 │
└────────────────────────────┘
abidiff: ../../src/abg-dwarf-reader.cc:10859: bool abigail::dwarf_reader::get_scope_die(const abigail::dwarf_reader::read_context&, const Dwarf_Die*, size_t, Dwarf_Die&): Assertion `__abg_cond__' failed.
┌──────────────────────────┐
│ ABI Break: libcrypt.so.1 │
└──────────────────────────┘
abidiff: ../../src/abg-dwarf-reader.cc:3728: abigail::ir::function_type_sptr abigail::dwarf_reader::read_context::lookup_fn_type_from_die_repr_per_tu(const Dwarf_Die*): Assertion `__abg_cond__' failed.
┌─────────────────────────┐
│ ABI Break: libutil.so.1 │
└─────────────────────────┘
abidiff: ../../src/abg-dwarf-reader.cc:3728: abigail::ir::function_type_sptr abigail::dwarf_reader::read_context::lookup_fn_type_from_die_repr_per_tu(const Dwarf_Die*): Assertion `__abg_cond__' failed.
┌───────────────────────┐
│ ABI Break: libdl.so.2 │
└───────────────────────┘
abidiff: ../../src/abg-dwarf-reader.cc:15015: abigail::ir::type_or_decl_base_sptr abigail::dwarf_reader::build_ir_node_from_die(abigail::dwarf_reader::read_context&, Dwarf_Die*, abigail::ir::scope_decl*, bool, size_t, bool, bool): Assertion `__abg_cond__' failed.
┌───────────────────────────┐
│ ABI Break: libnss_db.so.2 │
└───────────────────────────┘
in build_ir_node_from_die at: ../../src/abg-dwarf-reader.cc:15182: execution should not have reached this point!
┌───────────────────────────┐
│ ABI Break: libJISX0213.so │
└───────────────────────────┘
abidiff: ../../src/abg-dwarf-reader.cc:9024: std::string abigail::dwarf_reader::die_qualified_type_name(const abigail::dwarf_reader::read_context&, const Dwarf_Die*, size_t): Assertion `__abg_cond__' failed.
┌──────────────────────────────┐
│ ABI Break: libnss_files.so.2 │
└──────────────────────────────┘
in build_ir_node_from_die at: ../../src/abg-dwarf-reader.cc:15182: execution should not have reached this point!
┌───────────────────────────────┐
│ ABI Break: libnss_hesiod.so.2 │
└───────────────────────────────┘
abidiff: ../../src/abg-dwarf-reader.cc:3728: abigail::ir::function_type_sptr abigail::dwarf_reader::read_context::lookup_fn_type_from_die_repr_per_tu(const Dwarf_Die*): Assertion `__abg_cond__' failed.
┌───────────────────────────────┐
│ ABI Break: libnss_compat.so.2 │
└───────────────────────────────┘
in build_ir_node_from_die at: ../../src/abg-dwarf-reader.cc:15182: execution should not have reached this point!
┌──────────────────────────────┐
│ ABI Break: libthread_db.so.1 │
└──────────────────────────────┘
abidiff: ../../src/abg-dwarf-reader.cc:9024: std::string abigail::dwarf_reader::die_qualified_type_name(const abigail::dwarf_reader::read_context&, const Dwarf_Die*, size_t): Assertion `__abg_cond__' failed.
┌──────────────────────┐
│ ABI Break: libc.so.6 │
└──────────────────────┘
in build_ir_node_from_die at: ../../src/abg-dwarf-reader.cc:15182: execution should not have reached this point!
┌───────────────────────┐
│ ABI Break: librt.so.1 │
└───────────────────────┘
abidiff: ../../src/abg-dwarf-reader.cc:3728: abigail::ir::function_type_sptr abigail::dwarf_reader::read_context::lookup_fn_type_from_die_repr_per_tu(const Dwarf_Die*): Assertion `__abg_cond__' failed.
┌───────────────────────────┐
│ ABI Break: libresolv.so.2 │
└───────────────────────────┘
abidiff: ../../src/abg-dwarf-reader.cc:3728: abigail::ir::function_type_sptr abigail::dwarf_reader::read_context::lookup_fn_type_from_die_repr_per_tu(const Dwarf_Die*): Assertion `__abg_cond__' failed.
Comment 3 Seppo Yli-Olli 2021-10-01 20:37:02 UTC
Okay. So I just reproduced same asserts with by staging our ABI image twice (identical files) in and running ABI checker between them. Since bunch of these files seem to be present in glibc, added https://nanonyme.kapsi.fi/public/glibc.tar.xz here. I'm not sure if I should be uploading this large packages into the bugzilla.
Comment 4 Dodji Seketeli 2021-10-04 07:55:10 UTC
(In reply to Seppo Yli-Olli from comment #3)
> Okay. So I just reproduced same asserts with by staging our ABI image twice
> (identical files) in and running ABI checker between them. Since bunch of
> these files seem to be present in glibc, added
> https://nanonyme.kapsi.fi/public/glibc.tar.xz here. I'm not sure if I should
> be uploading this large packages into the bugzilla.

Hello.

For me to reproduce the issue and be able to debug it, it's helpful to provide a command line to reproduce the issue, like 'abidiff binary1 binary2'.

I have downloaded the tarball at https://nanonyme.kapsi.fi/public/glibc.tar.xz.  Thank you for having provided it.  But then, how am I supposed to reproduce the problem exactly?

Also, have you tried to reproduce the issue using libabigail from the master repository?

The libabigail version from master could handle the binaries from the tarball that your version of libabigail was failing from, if I believe one of the comments of the bug.  Here is what I did with the current libabigail from master to test for that:

$ abidw --abidiff glibc/usr/lib/x86_64-linux-gnu/libanl.so.1
$ abidw --abidiff glibc/usr/lib/x86_64-linux-gnu/libnsl.so.1
$ abidw --abidiff glibc/usr/lib/x86_64-linux-gnu/libpthread.so.0
$ abidw --abidiff glibc/usr/lib/x86_64-linux-gnu/libpthread.so.0
$ abidw --abidiff glibc/usr/lib/x86_64-linux-gnu/libcrypt.so.1
$ abidw --abidiff glibc/usr/lib/x86_64-linux-gnu/libutil.so.1
$ abidw --abidiff glibc/usr/lib/x86_64-linux-gnu/libdl.so.2
$ abidw --abidiff glibc/usr/lib/x86_64-linux-gnu/libnss_db.so.2
$ abidw --abidiff glibc/usr/lib/x86_64-linux-gnu/gconv/libJISX0213.so
$ abidw --abidiff glibc/usr/lib/x86_64-linux-gnu/libnss_files.so.2
$ abidw --abidiff glibc/usr/lib/x86_64-linux-gnu/libnss_hesiod.so.2
$ abidw --abidiff glibc/usr/lib/x86_64-linux-gnu/libnss_compat.so.2
$ abidw --abidiff glibc/usr/lib/x86_64-linux-gnu/libthread_db.so.1
$ abidw --abidiff glibc/usr/lib/x86_64-linux-gnu/libc.so.6
$ abidw --abidiff glibc/usr/lib/x86_64-linux-gnu/librt.so.1
$ abidw --abidiff glibc/usr/lib/x86_64-linux-gnu/libresolv.so.2
$

I think that I really need to release what we have in master now so that you can update to that one instead as there are many many fixes stacked there.
Comment 5 Seppo Yli-Olli 2021-10-04 08:08:54 UTC
We already switched to master a while back to facilitate this being fixed faster. We have docker image at registry.gitlab.com/freedesktop-sdk/infrastructure/freedesktop-sdk-docker-images/bst16 that reproduces the issue.
Comment 6 Seppo Yli-Olli 2021-10-04 11:20:16 UTC
No, you understood comments wrong.
1. Our master and 21.08 branches use newer GCC and glibc
2. We build docker image with libabigail master based on our branch 21.08
3. Our 20.08 use older GCC and glibc
4. Libagail works correctly in our newer branches, asserts with older
5. Older libabigail seemed to similarly assert on 20.08 when we tried to downgrade
Comment 7 Dodji Seketeli 2021-10-07 07:51:18 UTC
okay, can I have a reproducer that is not a docker image, please?
Just the binaries to run abidiff on, please please.  I can't integrate a docker image in libabigail testsuite, for instance.  This would have been much faster if you could just give me the two binaries that abidiff is failing on.
Comment 8 Seppo Yli-Olli 2021-10-07 08:44:24 UTC
Yes, I cannot do that. But I did give you libabigail in docker image that reproduces the problem for us with the binaries in the tarball.
Comment 9 Seppo Yli-Olli 2022-03-28 18:59:56 UTC
It's still this same case I was talking on IRC about except as said, it turns out this it's a lot more subtle and can be triggered with smaller differences of glibc. Same asserts going on. It appears libabigail itself (at least in our case) is affected by the glibc it's built against which makes it impossible to for abidw'ing another glibc. Something perhaps worth mentioning is we're using the separate debugedit project, not RPM debugedit.
Comment 10 Ben Brown 2023-04-24 14:49:17 UTC
Here's a link to various tarballs with libraries built with two different versions of glibc that cause abidiff to break (the versions of glibc are from the same stable branch, 4 commits apart): https://gitlab.com/freedesktop-sdk/freedesktop-sdk/-/jobs/4162744139/artifacts/browse/libabigail-tars/
Comment 11 Dodji Seketeli 2023-04-26 14:13:44 UTC
Thank you for providing me with the tarballs so that I can reproduce the issue.

With the current state of the master branch, it seems abidiff is now properly comparing the binaries provided in the six tarballs at https://gitlab.com/freedesktop-sdk/freedesktop-sdk/-/jobs/4162744139/artifacts/browse/libabigail-tars/.

The hash of the tree that I used for testing is this one:

6ba26ed6 Bug 30309 - Support absolute path to alt debug info file in DWARF

The fix will be present in the 2.3 libabigail release.

Thanks again for taking the time to report this problem and sorry