public inbox for
 help / color / mirror / Atom feed
* [committed] Fix get_name in low-mem mode
@ 2020-01-01  0:00 Tom de Vries
  0 siblings, 0 replies; only message in thread
From: Tom de Vries @ 2020-01-01  0:00 UTC (permalink / raw)
  To: dwz, jakub


When using --devel-dump-dups in low-mem mode for benchmark cc1 I run into a
$ dwz cc1 -o 1 -l0 --devel-dump-dups
Segmentation fault (core dumped)

The segfault happens in get_AT (called from get_AT_string, called from
get_name) due to trying to access invalidated fields in a DIE with
die_collapsed_child set.

Fix this by handling die_collapsed_child DIEs in get_name.

Committed to trunk.

- Tom

Fix get_name in low-mem mode

2020-01-08  Tom de Vries  <>

	* dwz.c (get_name): Handle die->die_collapsed_child == 1.

 dwz.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/dwz.c b/dwz.c
index 8fac945..b4b8339 100644
--- a/dwz.c
+++ b/dwz.c
@@ -4380,6 +4380,8 @@ find_dups_fi (dw_die_ref parent)
 static const char *
 get_name (dw_die_ref die)
+  if (die->die_collapsed_child)
+    return NULL;
   const char *name = get_AT_string (die, DW_AT_name);
   if (name)
     return name;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-01-08 13:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-01  0:00 [committed] Fix get_name in low-mem mode Tom de Vries

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