[Bug default/26646] unexpectedly declaration-only types
gprocida at google dot com
sourceware-bugzilla@sourceware.org
Mon Jan 17 17:46:28 GMT 2022
https://sourceware.org/bugzilla/show_bug.cgi?id=26646
gprocida at google dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |gprocida at google dot com
--- Comment #5 from gprocida at google dot com ---
A lot of changes and fixes have happened (including to the Clang compiler)
since this bug was originally opened.
I have a new test case which is very stable in terms of how abidw is built. I
get identical XML for each of two Android vmlinux objects, regardless of
whether built from upstream master (modulo disabling one assertion in the
symtab reader) or AOSP or the Google monorepo builds.
Between the two kernels, the ABIs differ only in that two types that were
declared in the first ABI appear fully defined in the second. For example:
<class-decl name='ip_mc_list' is-struct='yes' visibility='default'
is-declaration-only='yes' id='c2a59aaa'/>
vs
<class-decl name='ip_mc_list' size-in-bits='1152' is-struct='yes'
visibility='default' id='c2a59aaa'>
<data-member access='public' layout-offset-in-bits='0'>
...
Looking at the 2 DWARF dumps, locally at least, nothing has changed in relation
to the one type I checked. Both files have 1 declaration and 14 definitions of
the type.
Tracing through abidw execution, I see differing numbers of
add_or_update_class_type calls for that type.
In particular, there is only one such call for first vmlinux object and I'm
guessing it's for the only declaration-only DIE in the DWARF (as both appear
first in the DWARF dump and in the debug output).
I also noticed that the wrapper build_ir_node_from_die function hard codes as
true the is_declaration_only parameter passed to the other
build_ir_node_from_die function.
If I interpose a check for the specific type name and flip this flag to false,
then I *do* see a fully-defined type in the output XML.
I think the test files and this information should be enough for a proper
investigation. Unfortunately, the files are rather large. If you only need to
work with the first kernel, size requirements are halved, but still too large
for Bugzilla.
$ ls -lh declarations.tar.bz2 vmlinux[34]{,.abidw_g3}
-rw-r----- 1 gprocida primarygroup 264M Jan 17 17:19 declarations.tar.bz2
-rw-r----- 1 gprocida primarygroup 471M Jan 17 14:14 vmlinux3
-rw-r----- 1 gprocida primarygroup 7.5M Jan 17 14:32 vmlinux3.abidw_g3
-rw-r----- 1 gprocida primarygroup 471M Jan 17 14:16 vmlinux4
-rw-r----- 1 gprocida primarygroup 7.5M Jan 17 14:32 vmlinux4.abidw_g3
I was testing with ip_mc_list. These are two differences in the ABIs:
$ stgdiff --abi --format small /tmp/vmlinux{3,4}.abidw_g3 -o /dev/stdout
type 'struct udp_table' changed
was only declared, is now fully defined
type 'struct ip_mc_list' changed
was only declared, is now fully defined
Let me know how I can get these files to you. Alternatively, if you think you
have a quick fix, I'd be happy to try it out.
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the Libabigail
mailing list