public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
* [Bug default/26182] New: type equality trouble with Linux kernel
@ 2020-06-29 14:53 gprocida+abigail at google dot com
  2020-09-04  9:18 ` [Bug default/26182] " gprocida+abigail at google dot com
  2020-09-08 17:21 ` gprocida+abigail at google dot com
  0 siblings, 2 replies; 3+ messages in thread
From: gprocida+abigail at google dot com @ 2020-06-29 14:53 UTC (permalink / raw)
  To: libabigail

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

            Bug ID: 26182
           Summary: type equality trouble with Linux kernel
           Product: libabigail
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: default
          Assignee: dodji at redhat dot com
          Reporter: gprocida+abigail at google dot com
                CC: libabigail at sourceware dot org
  Target Milestone: ---

Created attachment 12668
  --> https://sourceware.org/bugzilla/attachment.cgi?id=12668&action=edit
analyse ABI for unmerged declarations

We see some type equality issues when extracting ABI information from Linux
kernel build trees.

It's not feasible to attach the huge ABI files, let along whole Linux build
trees, so here's an approximate recipe for reproducing the issue.

1. Find (ideally) a Debian amd64 machine.

I suspect the problem is not architecture dependent. I've only tested with
amd64 host and both amd64 and aarch64 target architectures.

2. Build a recent version of libabigail in $ABIGAIL.

I built 2b2f073d7afc8adf90d9d7bb5e3793846b4dd5d7. However, I believe the issue
to be long-standing.

3. Fetch recent kernel sources.

I grabbed 9ebcfadb0610322ac537dd7aa5d9cbc2b2894c68 a.k.a. v5.8-rc3. However,
we've also seen the issue on Android 4.19 branches.

4. Build a minimal kernel in $KERNEL.

make tinyconfig
make menuconfig
to add these:
CONFIG_DEBUG_INFO=y
CONFIG_DEBUG_INFO_DWARF4=y
make

5. Extract the ABI.

$ABIGAIL/build/tools/abidw --no-corpus-path --no-comp-dir-path --type-id-style
hash --linux-tree $KERNEL --out-file $KERNEL/abi.xml

6. Check the ABI for unmerged declarations and definitions.

I put together a simple script to do this for structs and classes. It's
attached.

In my case, it finds 10 identical definitions of mm_struct and 1 extra
declaration. There are another 30 problematic types.

(The script also finds 92 declaration-only structs which seems unlikely but not
impossible.)

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

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

* [Bug default/26182] type equality trouble with Linux kernel
  2020-06-29 14:53 [Bug default/26182] New: type equality trouble with Linux kernel gprocida+abigail at google dot com
@ 2020-09-04  9:18 ` gprocida+abigail at google dot com
  2020-09-08 17:21 ` gprocida+abigail at google dot com
  1 sibling, 0 replies; 3+ messages in thread
From: gprocida+abigail at google dot com @ 2020-09-04  9:18 UTC (permalink / raw)
  To: libabigail

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

Giuliano Procida <gprocida+abigail at google dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #12668|0                           |1
        is obsolete|                            |

--- Comment #1 from Giuliano Procida <gprocida+abigail at google dot com> ---
Created attachment 12816
  --> https://sourceware.org/bugzilla/attachment.cgi?id=12816&action=edit
analyse ABI for unmerged declarations

This version does unions as well and gives more informative output.

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

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

* [Bug default/26182] type equality trouble with Linux kernel
  2020-06-29 14:53 [Bug default/26182] New: type equality trouble with Linux kernel gprocida+abigail at google dot com
  2020-09-04  9:18 ` [Bug default/26182] " gprocida+abigail at google dot com
@ 2020-09-08 17:21 ` gprocida+abigail at google dot com
  1 sibling, 0 replies; 3+ messages in thread
From: gprocida+abigail at google dot com @ 2020-09-08 17:21 UTC (permalink / raw)
  To: libabigail

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

--- Comment #2 from Giuliano Procida <gprocida+abigail at google dot com> ---
Analysis is bogus because...

ABI extraction by libabigail behaves very differently if `CONFIG_MODULES=n`.
This is because libabigail uses the presence of the ksymtab section to
determine whether something is a "Linux kernel" or not. If it is, then
different type equality rules apply (a bit like C++ ODR).

Right, so what I see is that declarations and definitions separately get
collapsed done to one entity in the XML. However, the bit's that's missing may
be special treatment to match up declarations and definitions when it's a Linux
kernel.

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

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

end of thread, other threads:[~2020-09-08 17:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-29 14:53 [Bug default/26182] New: type equality trouble with Linux kernel gprocida+abigail at google dot com
2020-09-04  9:18 ` [Bug default/26182] " gprocida+abigail at google dot com
2020-09-08 17:21 ` gprocida+abigail at google 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).