public inbox for dwz@sourceware.org
 help / color / mirror / Atom feed
From: "vries at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org>
To: dwz@sourceware.org
Subject: [Bug default/27115] FAIL: dwz-0.13/testsuite/dwz.tests/devel-ignore-size.sh
Date: Mon, 04 Jan 2021 08:52:46 +0000	[thread overview]
Message-ID: <bug-27115-11298-QbPO4RiHnR@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-27115-11298@http.sourceware.org/bugzilla/>

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

--- Comment #7 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Vitaly Chikunov from comment #6)
> Created attachment 13088 [details]
> example of dwz in/out binaries
> 
> Attached archive with `min` is source, `1` is processed.

Comparing the size results, that looks sane:
...
$ ../../../measure/diff.sh min 1
.debug_info      red: 19.24%    1986  1604
.debug_abbrev    red: 16.19%    791  663
.debug_str       red: 0%        1726  1726
total            red: 11.33%    4503 3993
...

Looking at the created partial unit, it contains a couple of base types, like
"long unsigned int".

Using a grep, we can see that this comes from compilation units abi-note.c and
elf-init.c:
...
$ egrep "DW_AT_name.*(long unsigned int|\.)|Compilation" READELF.min | grep -v
"long long"
  Compilation Unit @ offset 0x0:
    <20>   DW_AT_name        : ../sysdeps/x86_64/start.S
  Compilation Unit @ offset 0x2e:
    <3f>   DW_AT_name        : abi-note.c
    <63>   DW_AT_name        : long unsigned int
  Compilation Unit @ offset 0x4ff:
    <510>   DW_AT_name        : init.c
  Compilation Unit @ offset 0x53f:
    <553>   DW_AT_name        : ../sysdeps/x86_64/crti.S
  Compilation Unit @ offset 0x561:
    <572>   DW_AT_name        : min.c
  Compilation Unit @ offset 0x5b4:
    <5c5>   DW_AT_name        : min-2.c
  Compilation Unit @ offset 0x607:
    <618>   DW_AT_name        : elf-init.c
    <64f>   DW_AT_name        : long unsigned int
  Compilation Unit @ offset 0x7a0:
    <7b4>   DW_AT_name        : ../sysdeps/x86_64/crtn.S
...

So this all seems ok.

Without reverting to dwarf assembly, it's hard to create an exec with debug
info that is guaranteed to not be compressed.

So for now, the easiest fix is to detect this situation, and mark the test
unsupported:
...
diff --git a/testsuite/dwz.tests/devel-ignore-size.sh
b/testsuite/dwz.tests/devel-ignore-si
ze.sh
index 5134043..78d28a2 100644
--- a/testsuite/dwz.tests/devel-ignore-size.sh
+++ b/testsuite/dwz.tests/devel-ignore-size.sh
@@ -12,7 +12,9 @@ cnt=$(readelf -wi 1 \
            | grep '(DW_TAG_partial_unit' \
            | wc -l)

-[ $cnt -eq 0 ]
+if [ $cnt -ne 0 ]; then
+    exit 77
+fi

 cp $execs/min 1

...

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

  parent reply	other threads:[~2021-01-04  8:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-27  7:36 [Bug default/27115] New: " vt at altlinux dot org
2020-12-28 12:20 ` [Bug default/27115] " vt at altlinux dot org
2020-12-28 14:33 ` mark at klomp dot org
2021-01-02 13:08 ` vt at altlinux dot org
2021-01-02 14:41 ` vt at altlinux dot org
2021-01-03  7:46 ` vries at gcc dot gnu.org
2021-01-03  8:50 ` vt at altlinux dot org
2021-01-04  8:52 ` vries at gcc dot gnu.org [this message]
2021-01-04  9:09 ` vries at gcc dot gnu.org
2021-01-09 11:52 ` vt at altlinux dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-27115-11298-QbPO4RiHnR@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=dwz@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).