public inbox for dwz@sourceware.org
 help / color / mirror / Atom feed
* [Bug default/27115] New: FAIL: dwz-0.13/testsuite/dwz.tests/devel-ignore-size.sh
@ 2020-12-27  7:36 vt at altlinux dot org
  2020-12-28 12:20 ` [Bug default/27115] " vt at altlinux dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: vt at altlinux dot org @ 2020-12-27  7:36 UTC (permalink / raw)
  To: dwz

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

            Bug ID: 27115
           Summary: FAIL:
                    dwz-0.13/testsuite/dwz.tests/devel-ignore-size.sh
           Product: dwz
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: default
          Assignee: nobody at sourceware dot org
          Reporter: vt at altlinux dot org
                CC: dwz at sourceware dot org
  Target Milestone: ---

dwz 0.13 fails devel-ignore-size.sh test.

I try to reproduce test result manually:

builder@i586:~/RPM/BUILD/dwz-0.13$ make min
cc /usr/src/RPM/BUILD/dwz-0.13/testsuite/dwz.tests/min.c
/usr/src/RPM/BUILD/dwz-0.13/testsuite/dwz.tests/min-2.c -o min -g
builder@i586:~/RPM/BUILD/dwz-0.13$ cp min 1
builder@i586:~/RPM/BUILD/dwz-0.13$ readelf -wi 1 | grep '(DW_TAG_partial_unit'
builder@i586:~/RPM/BUILD/dwz-0.13$ ./dwz-for-test 1
builder@i586:~/RPM/BUILD/dwz-0.13$ readelf -wi 1 | grep '(DW_TAG_partial_unit'
 <0><b>: Abbrev Number: 44 (DW_TAG_partial_unit)
    <5d>   DW_AT_import      : <0xb>    [Abbrev Number: 44
(DW_TAG_partial_unit)]
    <4aa>   DW_AT_import      : <0xb>   [Abbrev Number: 44
(DW_TAG_partial_unit)]

Test seems to expect all matches by be 0 always.

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

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

* [Bug default/27115] FAIL: dwz-0.13/testsuite/dwz.tests/devel-ignore-size.sh
  2020-12-27  7:36 [Bug default/27115] New: FAIL: dwz-0.13/testsuite/dwz.tests/devel-ignore-size.sh vt at altlinux dot org
@ 2020-12-28 12:20 ` vt at altlinux dot org
  2020-12-28 14:33 ` mark at klomp dot org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: vt at altlinux dot org @ 2020-12-28 12:20 UTC (permalink / raw)
  To: dwz

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

--- Comment #1 from Vitaly Chikunov <vt at altlinux dot org> ---
To add, this is readelf from binutils 2.35.1.

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

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

* [Bug default/27115] FAIL: dwz-0.13/testsuite/dwz.tests/devel-ignore-size.sh
  2020-12-27  7:36 [Bug default/27115] New: FAIL: dwz-0.13/testsuite/dwz.tests/devel-ignore-size.sh 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
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: mark at klomp dot org @ 2020-12-28 14:33 UTC (permalink / raw)
  To: dwz

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

Mark Wielaard <mark at klomp dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2020-12-28
             Status|UNCONFIRMED                 |NEW
                 CC|                            |mark at klomp dot org

--- Comment #2 from Mark Wielaard <mark at klomp dot org> ---
It looks like binutils 2.35.1 readelf helpfully adds the tag
(DW_TAG_partial_unit in this case) to the DW_AT_import when reporting the
Abbrev Number. Older readelf produced:

<0><b>: Abbrev Number: 17 (DW_TAG_partial_unit)
    <6b>   DW_AT_import      : <0xb>    [Abbrev Number: 17]
    <da>   DW_AT_import      : <0xb>    [Abbrev Number: 17]

So an workaround might be something like:

diff --git a/testsuite/dwz.tests/pr24468.sh b/testsuite/dwz.tests/pr24468.sh
index 4dac9a1..3b1b671 100644
--- a/testsuite/dwz.tests/pr24468.sh
+++ b/testsuite/dwz.tests/pr24468.sh
@@ -7,7 +7,7 @@ dwz -m 3 1 2

 readelf -wi 1 > READELF 2>/dev/null

-offsets=$(grep '(DW_TAG_partial_unit' READELF \
+offsets=$(grep '(DW_TAG_partial_unit' READELF | grep -v DW_AT_import \
              | awk '{print $1}' \
              | sed 's/.*<//;s/>.*//')
 for off in $offsets; do

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

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

* [Bug default/27115] FAIL: dwz-0.13/testsuite/dwz.tests/devel-ignore-size.sh
  2020-12-27  7:36 [Bug default/27115] New: FAIL: dwz-0.13/testsuite/dwz.tests/devel-ignore-size.sh 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
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: vt at altlinux dot org @ 2021-01-02 13:08 UTC (permalink / raw)
  To: dwz

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

--- Comment #3 from Vitaly Chikunov <vt at altlinux dot org> ---
Mark,

Yes, this strips additional DW_AT_import lines, but test still fail.

builder@x86_64:~/RPM/BUILD/dwz-0.13$ \cp min 1
builder@x86_64:~/RPM/BUILD/dwz-0.13$ readelf -wi 1 | grep
'(DW_TAG_partial_unit'
builder@x86_64:~/RPM/BUILD/dwz-0.13$ ./dwz-for-test 1
builder@x86_64:~/RPM/BUILD/dwz-0.13$ readelf -wi 1 | grep
'(DW_TAG_partial_unit' | grep -v DW_AT_import
 <0><b>: Abbrev Number: 43 (DW_TAG_partial_unit)
builder@x86_64:~/RPM/BUILD/dwz-0.13$ cat
/usr/src/RPM/BUILD/dwz-0.13/testsuite/dwz.tests/devel-ignore-size.sh
...
[ $cnt -eq 0 ]
...
builder@x86_64:~/RPM/BUILD/dwz-0.13$ ls -la min 1
-rwxr-xr-x 1 builder builder 26104 Jan  2 12:58 1
-rwxr-xr-x 1 builder builder 26616 Jan  2 12:55 min

I think dwz modifies test binary even though it's expected to not(?).

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

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

* [Bug default/27115] FAIL: dwz-0.13/testsuite/dwz.tests/devel-ignore-size.sh
  2020-12-27  7:36 [Bug default/27115] New: FAIL: dwz-0.13/testsuite/dwz.tests/devel-ignore-size.sh vt at altlinux dot org
                   ` (2 preceding siblings ...)
  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
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: vt at altlinux dot org @ 2021-01-02 14:41 UTC (permalink / raw)
  To: dwz

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

Vitaly Chikunov <vt at altlinux dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ldv at sourceware dot org

--- Comment #4 from Vitaly Chikunov <vt at altlinux dot org> ---
After more investigating, I think it maybe related to glibc update from 2.30 to
2.32. (Time correlation w/o proof yet.)

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

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

* [Bug default/27115] FAIL: dwz-0.13/testsuite/dwz.tests/devel-ignore-size.sh
  2020-12-27  7:36 [Bug default/27115] New: FAIL: dwz-0.13/testsuite/dwz.tests/devel-ignore-size.sh vt at altlinux dot org
                   ` (3 preceding siblings ...)
  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
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: vries at gcc dot gnu.org @ 2021-01-03  7:46 UTC (permalink / raw)
  To: dwz

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

Tom de Vries <vries at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |vries at gcc dot gnu.org

--- Comment #5 from Tom de Vries <vries at gcc dot gnu.org> ---
Can you attach the binary, before and after dwz-ing?

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

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

* [Bug default/27115] FAIL: dwz-0.13/testsuite/dwz.tests/devel-ignore-size.sh
  2020-12-27  7:36 [Bug default/27115] New: FAIL: dwz-0.13/testsuite/dwz.tests/devel-ignore-size.sh vt at altlinux dot org
                   ` (4 preceding siblings ...)
  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
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: vt at altlinux dot org @ 2021-01-03  8:50 UTC (permalink / raw)
  To: dwz

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

--- Comment #6 from Vitaly Chikunov <vt at altlinux dot org> ---
Created attachment 13088
  --> https://sourceware.org/bugzilla/attachment.cgi?id=13088&action=edit
example of dwz in/out binaries

Attached archive with `min` is source, `1` is processed.

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

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

* [Bug default/27115] FAIL: dwz-0.13/testsuite/dwz.tests/devel-ignore-size.sh
  2020-12-27  7:36 [Bug default/27115] New: FAIL: dwz-0.13/testsuite/dwz.tests/devel-ignore-size.sh vt at altlinux dot org
                   ` (5 preceding siblings ...)
  2021-01-03  8:50 ` vt at altlinux dot org
@ 2021-01-04  8:52 ` vries at gcc dot gnu.org
  2021-01-04  9:09 ` vries at gcc dot gnu.org
  2021-01-09 11:52 ` vt at altlinux dot org
  8 siblings, 0 replies; 10+ messages in thread
From: vries at gcc dot gnu.org @ 2021-01-04  8:52 UTC (permalink / raw)
  To: dwz

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.

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

* [Bug default/27115] FAIL: dwz-0.13/testsuite/dwz.tests/devel-ignore-size.sh
  2020-12-27  7:36 [Bug default/27115] New: FAIL: dwz-0.13/testsuite/dwz.tests/devel-ignore-size.sh vt at altlinux dot org
                   ` (6 preceding siblings ...)
  2021-01-04  8:52 ` vries at gcc dot gnu.org
@ 2021-01-04  9:09 ` vries at gcc dot gnu.org
  2021-01-09 11:52 ` vt at altlinux dot org
  8 siblings, 0 replies; 10+ messages in thread
From: vries at gcc dot gnu.org @ 2021-01-04  9:09 UTC (permalink / raw)
  To: dwz

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

Tom de Vries <vries at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #8 from Tom de Vries <vries at gcc dot gnu.org> ---
https://sourceware.org/git/?p=dwz.git;a=commit;h=282322d59df6cbf3b0af572077d93d5b5b882b41 

[testsuite] Detect when devel-ignore-size.sh is unsupported

In PR27115, a failure of devel-ignore-size.sh is reported.

The test-case:
- tries to transform an executable
- checks that it didn't transform
- retries using --devel-ignore-size
- check that it did transform

The reported failure is in the second step.

Fix this by marking the test unsupported if the second step fails.

2021-01-04  Tom de Vries  <tdevries@suse.de>

PR dwz/27115
* testsuite/dwz.tests/devel-ignore-size.sh: If exec is transformed
without --devel-ignore-size, mark unsupported.

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

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

* [Bug default/27115] FAIL: dwz-0.13/testsuite/dwz.tests/devel-ignore-size.sh
  2020-12-27  7:36 [Bug default/27115] New: FAIL: dwz-0.13/testsuite/dwz.tests/devel-ignore-size.sh vt at altlinux dot org
                   ` (7 preceding siblings ...)
  2021-01-04  9:09 ` vries at gcc dot gnu.org
@ 2021-01-09 11:52 ` vt at altlinux dot org
  8 siblings, 0 replies; 10+ messages in thread
From: vt at altlinux dot org @ 2021-01-09 11:52 UTC (permalink / raw)
  To: dwz

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

--- Comment #9 from Vitaly Chikunov <vt at altlinux dot org> ---
Tom, thanks for solving this!

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

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

end of thread, other threads:[~2021-01-09 11:52 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-27  7:36 [Bug default/27115] New: FAIL: dwz-0.13/testsuite/dwz.tests/devel-ignore-size.sh 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
2021-01-04  9:09 ` vries at gcc dot gnu.org
2021-01-09 11:52 ` vt at altlinux dot org

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).