Bug 31045 - assert violation while setting translation unit for unique types
Summary: assert violation while setting translation unit for unique types
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: 2023-11-08 12:03 UTC by Paolo Pisati
Modified: 2023-11-09 12:30 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed: 2023-11-08 00:00:00


Attachments
zfs files that trigger the assert() (150.13 KB, application/x-compressed-tar)
2023-11-08 12:03 UTC, Paolo Pisati
Details
zfs files that trigger the assert() (150.13 KB, application/octet-stream)
2023-11-08 12:04 UTC, Paolo Pisati
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Paolo Pisati 2023-11-08 12:03:43 UTC
Created attachment 15214 [details]
zfs files that trigger the assert()

While building the zfs-dkms package, in the checkabi target, abidiff core dumps:

https://launchpadlibrarian.net/696568269/buildlog_ubuntu-noble-amd64.zfs-linux_2.2.0-0ubuntu2_BUILDING.txt.gz

abigail-2.3 was fine, and it started crashing after we moved to abigail-2.4.
I was able to reproduce the issue locally with abigail src from git:

$ abidiff --no-unreferenced-symbols --headers-dir1 include --suppressions ./lib/libnvpair/libnvpair.suppr ./lib/libnvpair/libnvpair.abi .libs/libnvpair.so
abidiff: ../../src/abg-ir.cc:8004: virtual abigail::ir::decl_base_sptr abigail::ir::scope_decl::add_member_decl(const abigail::ir::decl_base_sptr&): Assertion `__abg_cond__' failed.
Aborted (core dumped)

and i bisected it down to this commit:

commit d00a2cc2da9b33be5a6e5376cbee4591c042d3a3 (break5)
Author: Dodji Seketeli <dodji@redhat.com>
Date:   Thu May 25 14:15:56 2023 +0200

    Bug 30466 - harfbuzz fails self-check on f38

Does it ring any bell?
I'm not familiar with abigail internals, but i'll be happy to test any patch you throw at me.

I'm attaching a tarball with the offending files.
Comment 1 Paolo Pisati 2023-11-08 12:04:25 UTC
Created attachment 15215 [details]
zfs files that trigger the assert()
Comment 2 Dodji Seketeli 2023-11-08 14:52:16 UTC
I could reproduce the problem, thank you for reporting it.

The patch https://sourceware.org/git/?p=libabigail.git;a=commit;h=40d0dcf192389fe9648128c32fe085913cc68eef should address the issue.

It's in the branch users/dodji/PR31045 that can be browsed at https://sourceware.org/git/?p=libabigail.git;a=shortlog;h=refs/heads/users/dodji/PR31045.

If after testing it, you confirm that it fixes the issue for you, then I'll merge the patch in the master branch of the git repository.

Thank you for reporting the issue and sorry for the inconvenience.
Comment 3 Paolo Pisati 2023-11-09 08:53:43 UTC
fresh checkout of your PR31045, doesn't build:

$ autoreconf -i
...
$ mkdir build
$ cd build
$ ../configure
...
$ make
make --no-print-directory all-recursive
Making all in include
make[2]: Nothing to be done for 'all'.
Making all in src
  CXX      abg-traverse.lo
  CXX      abg-ir.lo
../../src/abg-ir.cc: In function ‘void abigail::ir::maybe_set_translation_unit(const decl_base_sptr&, translation_unit*)’:
../../src/abg-ir.cc:8002:5: error: ‘member’ was not declared in this scope
 8002 |     member->set_translation_unit(tu);
      |     ^~~~~~
...
Comment 4 Dodji Seketeli 2023-11-09 09:06:49 UTC
"paolo.pisati at canonical dot com" <sourceware-bugzilla@sourceware.org>
a écrit:

> --- Comment #3 from Paolo Pisati <paolo.pisati at canonical dot com> ---
> fresh checkout of your PR31045, doesn't build:

[...]

> ../../src/abg-ir.cc: In function ‘void
> abigail::ir::maybe_set_translation_unit(const decl_base_sptr&,
> translation_unit*)’:
> ../../src/abg-ir.cc:8002:5: error: ‘member’ was not declared in this scope
>  8002 |     member->set_translation_unit(tu);

Ooops, indeed.  Could you try again please?  I have just fixed that.
Sorry for the inconvenience.
Comment 5 Paolo Pisati 2023-11-09 12:10:44 UTC
Applied, rebuilt abigail and it builds zfs-dkms successfully now, thanks!
Comment 6 Dodji Seketeli 2023-11-09 12:30:28 UTC
Thanks!

I have applied the patch https://inbox.sourceware.org/libabigail/87h6lvdsb1.fsf@redhat.com/ to the master branch of the Git repository.  That fix should be available in libabigail 2.5.

Thank you for reporting this problem and sorry for the inconvenience.