From: Tom de Vries <tdevries@suse.de>
To: dwz@sourceware.org, jakub@redhat.com
Subject: [committed] Fix 'refd != NULL' assertion in write_die
Date: Tue, 01 Jan 2019 00:00:00 -0000 [thread overview]
Message-ID: <20191128090436.GA16198@delia> (raw)
Hi,
When running dwz on a file that contains invalid DW_FORM_ref_addr attributes
(which has been observed to be generated by a google go compiler) we run
either into an assert:
...
$ dwz multidictionary
dwz: dwz.c:9461: write_die: Assertion `refd != NULL' failed.
Aborted (core dumped)
...
or a segmentation fault in case of low-mem mode:
...
$ dwz -l0 multidictionary
Segmentation fault (core dumped)
...
Fix this by erroring out instead:
...
$ dwz multidictionary
dwz: Couldn't find DIE at DW_FORM_ref_addr offset 0x97
...
Committed to trunk.
Thanks,
- Tom
Fix 'refd != NULL' assertion in write_die
2019-02-05 Tom de Vries <tdevries@suse.de>
PR dwz/24169
* dwz.c (write_die): Error out on invalid DW_FORM_ref_addr.
---
dwz.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/dwz.c b/dwz.c
index e26b02e..5cf05f8 100644
--- a/dwz.c
+++ b/dwz.c
@@ -9458,6 +9458,10 @@ write_die (unsigned char *ptr, dw_cu_ref cu, dw_die_ref die,
? ptr_size : 4);
inptr += refcu->cu_version == 2 ? ptr_size : 4;
refd = off_htab_lookup (NULL, value);
+ if (refd == NULL || refd->die_tag == 0)
+ error (1, 0,
+ "Couldn't find DIE at DW_FORM_ref_addr offset 0x%lx",
+ value);
assert (refd != NULL);
refdt = refd;
while (refdt->die_toplevel == 0)
reply other threads:[~2019-11-28 9:04 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=20191128090436.GA16198@delia \
--to=tdevries@suse.de \
--cc=dwz@sourceware.org \
--cc=jakub@redhat.com \
/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).