public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
* [Bug default/27616] New: libabigail treats empty and nearly empty XML elements inconsistently
@ 2021-03-20 20:09 gprocida+abigail at google dot com
  2021-03-31 11:16 ` [Bug default/27616] " gprocida+abigail at google dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: gprocida+abigail at google dot com @ 2021-03-20 20:09 UTC (permalink / raw)
  To: libabigail

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

            Bug ID: 27616
           Summary: libabigail treats empty and nearly empty XML elements
                    inconsistently
           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: ---

At least in the case of abi-corpus, the case of "no children" is handled
differently from "only blank children". One consequence is that the
architecture of an empty corpus may be ignored if the XML is normalised or has
blank text stripped.

tests/data/test-abidiff/test-empty-corpus-2.xml:

<abi-corpus-group architecture='elf-arm-aarch64'>
  <abi-corpus path='vmlinux' architecture='elf-arm-aarch64'>
  </abi-corpus>
</abi-corpus-group>

Nothing changes if the inner element is changed to.

<abi-corpus path='vmlinux' architecture='elf-arm-aarch64'> </abi-corpus>

These are treated differently (abidiff reports architecture is ''):

<abi-corpus path='vmlinux' architecture='elf-arm-aarch64'></abi-corpus>

and

<abi-corpus path='vmlinux' architecture='elf-arm-aarch64'/>

I've not audited the code in detail, but any early return or similar
short-cutting on (!node->children) etc. should be reviewed.

Actually, the following shows plenty of places where whitespace is significant
where it should not be.

find tests -name '*.abi' -or -name '*.xml' | while read f; do
  <"$f" sed 's;^ *;;' | tr -d '\n' >"$f".wrung
  build/tools/abidiff --harmless "$f" "$f".wrung
done

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

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

end of thread, other threads:[~2022-05-24 14:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-20 20:09 [Bug default/27616] New: libabigail treats empty and nearly empty XML elements inconsistently gprocida+abigail at google dot com
2021-03-31 11:16 ` [Bug default/27616] " gprocida+abigail at google dot com
2021-04-14 10:56 ` dodji at redhat dot com
2021-04-15 14:17 ` dodji at redhat dot com
2022-05-24 14:15 ` gprocida 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).