From: "wcohen at redhat dot com" <sourceware-bugzilla@sourceware.org>
To: dwz@sourceware.org
Subject: [Bug default/28594] New: Consider removing 0 length entries from variable and formal parameter location lists
Date: Mon, 15 Nov 2021 03:19:06 +0000 [thread overview]
Message-ID: <bug-28594-11298@http.sourceware.org/bugzilla/> (raw)
https://sourceware.org/bugzilla/show_bug.cgi?id=28594
Bug ID: 28594
Summary: Consider removing 0 length entries from variable and
formal parameter location lists
Product: dwz
Version: unspecified
Status: NEW
Severity: normal
Priority: P2
Component: default
Assignee: nobody at sourceware dot org
Reporter: wcohen at redhat dot com
CC: dwz at sourceware dot org
Target Milestone: ---
When reviewing the kernel debuginfo of the Fedora Linux kernel I found that
there were a number of places where gcc generated locations lists that had
entries that are 0 length. There is a upstream gcc bug
(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103241) that shows an example of
this occurring. There are a number of places in the kernel with 0 length
entries that are not going to match anything due to the 0-length and the
entries are just taking up space. As an alternative to fixing gcc upstream dwz
could also remove these 0-length entries. To get an idea of the number of times
this occurred a dwgrep (https://pmachata.github.io/dwgrep/) was written to
print out each occurrence 0-length location list entries for regular and
inlined functions:
[wcohen@haro perf]$ dwgrep
/usr/lib/debug/lib/modules/5.14.15-200.fc34.x86_64/vmlinux -e '
let A := entry (?TAG_subprogram || ?TAG_inlined_subroutine) (?AT_ranges ||
?AT_low_pc);
let FSTART := (A ?AT_ranges @AT_ranges low) || ( A low);
let PARM := A child (?TAG_formal_parameter || ?TAG_variable);
(PARM ?AT_location @AT_location address length==0) ([A name, FSTART, PARM
name])' | grep \\[ |wc
93105 279315 4386700
One function in the kernel that has 0-length entries is static_protections.
Took a look at it with:
llvm-dwarfdump -c --name="static_protection"
/usr/lib/debug/lib/modules/5.14.15-200.fc34.x86_64/vmlinux | more
See the following for static_protections where first entry for "prot" parameter
is 0 length and overlaps the next entry:
0x00e44d5c: DW_TAG_formal_parameter
DW_AT_abstract_origin (0x00e3fb6d "prot")
DW_AT_location (0x002c83db:
[0xffffffff8107a540, 0xffffffff8107a540): DW_OP_reg5 RDI
[0xffffffff8107a540, 0xffffffff8107a569): DW_OP_reg5 RDI,
DW_OP_piece 0x8
[0xffffffff8107a5a0, 0xffffffff8107a5f3): DW_OP_reg5 RDI
[0xffffffff8107a617, 0xffffffff8107a65b): DW_OP_reg3 RBX
[0xffffffff8107a66a, 0xffffffff8107a67e): DW_OP_reg3 RBX,
DW_OP_piece 0x8
[0xffffffff8107a67e, 0xffffffff8107a68c): DW_OP_reg5 RDI
[0xffffffff8107a68c, 0xffffffff8107a6a1): DW_OP_reg3 RBX,
DW_OP_piece 0x8
[0xffffffff8107a6a1, 0xffffffff8107a6a1): DW_OP_reg3 RBX,
DW_OP_piece 0x8
[0xffffffff8107a6a1, 0xffffffff8107a6cb): DW_OP_reg3 RBX
[0xffffffff8107a6cb, 0xffffffff8107a6cb): DW_OP_reg3 RBX,
DW_OP_piece 0x8
[0xffffffff81bc6967, 0xffffffff81bc6994): DW_OP_reg3 RBX,
DW_OP_piece 0x8
[0xffffffff81bc69b5, 0xffffffff81bc6a24): DW_OP_reg3 RBX,
DW_OP_piece 0x8)
DW_AT_unknown_2137 (0x002c83c3)
0x00e44d69: DW_TAG_formal_parameter
DW_AT_abstract_origin (0x00e3fb7a "start")
DW_AT_location (0x002c84ed:
[0xffffffff8107a540, 0xffffffff8107a5a0): DW_OP_reg4 RSI
[0xffffffff8107a5a0, 0xffffffff8107a65b): DW_OP_reg12 R12
[0xffffffff8107a65b, 0xffffffff8107a66a):
DW_OP_GNU_entry_value(DW_OP_reg4 RSI), DW_OP_s
tack_value
[0xffffffff8107a66a, 0xffffffff8107a68c): DW_OP_reg4 RSI
[0xffffffff8107a68c, 0xffffffff8107a6cb): DW_OP_reg12 R12
[0xffffffff8107a6cb, 0xffffffff8107a6cb): DW_OP_reg4 RSI
[0xffffffff81bc6967, 0xffffffff81bc698c): DW_OP_reg4 RSI
[0xffffffff81bc698c, 0xffffffff81bc6a24): DW_OP_reg12 R12)
DW_AT_unknown_2137 (0x002c84dd)
0x00e44d76: DW_TAG_formal_parameter
DW_AT_abstract_origin (0x00e3fb87 "pfn")
DW_AT_location (0x002c85a8:
[0xffffffff8107a540, 0xffffffff8107a5a0): DW_OP_reg1 RDX
[0xffffffff8107a5a0, 0xffffffff8107a65b): DW_OP_reg15 R15
[0xffffffff8107a65b, 0xffffffff8107a66a):
DW_OP_GNU_entry_value(DW_OP_reg1 RDX), DW_OP_s
tack_value
[0xffffffff8107a66a, 0xffffffff8107a68c): DW_OP_reg1 RDX
[0xffffffff8107a68c, 0xffffffff8107a6cb): DW_OP_reg15 R15
[0xffffffff8107a6cb, 0xffffffff8107a6cb): DW_OP_reg1 RDX
[0xffffffff81bc6967, 0xffffffff81bc6983): DW_OP_reg1 RDX
[0xffffffff81bc6983, 0xffffffff81bc6a24): DW_OP_reg15 R15)
DW_AT_unknown_2137 (0x002c8598)
0x00e44d83: DW_TAG_formal_parameter
DW_AT_abstract_origin (0x00e3fb94 "npg")
DW_AT_location (0x002c8663:
[0xffffffff8107a540, 0xffffffff8107a5a0): DW_OP_reg2 RCX
[0xffffffff8107a5a0, 0xffffffff8107a65b): DW_OP_reg13 R13
[0xffffffff8107a65b, 0xffffffff8107a66a):
DW_OP_GNU_entry_value(DW_OP_reg2 RCX), DW_OP_s
tack_value
[0xffffffff8107a66a, 0xffffffff8107a68c): DW_OP_reg2 RCX
[0xffffffff8107a68c, 0xffffffff8107a6cb): DW_OP_reg13 R13
[0xffffffff8107a6cb, 0xffffffff8107a6cb): DW_OP_reg2 RCX
[0xffffffff81bc6967, 0xffffffff81bc6977): DW_OP_reg2 RCX
[0xffffffff81bc6977, 0xffffffff81bc6a24): DW_OP_reg13 R13)
DW_AT_unknown_2137 (0x002c8653)
0x00e44d90: DW_TAG_formal_parameter
DW_AT_abstract_origin (0x00e3fba1 "lpsize")
DW_AT_location (0x002c8718:
[0xffffffff8107a540, 0xffffffff8107a585): DW_OP_reg8 R8
[0xffffffff8107a585, 0xffffffff8107a65b): DW_OP_reg14 R14
[0xffffffff8107a65b, 0xffffffff8107a66a):
DW_OP_GNU_entry_value(DW_OP_reg8 R8), DW_OP_st
ack_value
[0xffffffff8107a66a, 0xffffffff8107a6cb): DW_OP_reg14 R14
[0xffffffff81bc6967, 0xffffffff81bc6a24): DW_OP_reg14 R14)
DW_AT_unknown_2137 (0x002c870e)
0x00e44d9d: DW_TAG_formal_parameter
DW_AT_abstract_origin (0x00e3fbae "warnlvl")
DW_AT_location (0x002c8798:
[0xffffffff8107a540, 0xffffffff8107a5a0): DW_OP_reg9 R9
[0xffffffff8107a5a0, 0xffffffff8107a66a): DW_OP_fbreg -72
[0xffffffff8107a66a, 0xffffffff8107a68c): DW_OP_reg9 R9
[0xffffffff8107a68c, 0xffffffff8107a6cb): DW_OP_fbreg -72
[0xffffffff8107a6cb, 0xffffffff8107a6cb): DW_OP_reg9 R9
[0xffffffff81bc6967, 0xffffffff81bc6974): DW_OP_reg9 R9
[0xffffffff81bc6974, 0xffffffff81bc6a24): DW_OP_fbreg -72)
DW_AT_unknown_2137 (0x002c878a)
--
You are receiving this mail because:
You are on the CC list for the bug.
reply other threads:[~2021-11-15 3:19 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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-28594-11298@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).