Bug 24169 - dwz: dwz.c:8792: write_die: Assertion `refd != NULL' failed.
Summary: dwz: dwz.c:8792: write_die: Assertion `refd != NULL' failed.
Status: RESOLVED FIXED
Alias: None
Product: dwz
Classification: Unclassified
Component: default (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-02-05 14:40 UTC by Tom de Vries
Modified: 2019-11-28 16:27 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
multidictionary executable (3.70 KB, application/x-executable)
2019-02-05 14:42 UTC, Tom de Vries
Details
[Patch 1/2] Factor out skip_attr (1.26 KB, patch)
2019-02-05 14:45 UTC, Tom de Vries
Details | Diff
[PATCH 2/2] Error out for invalid DW_FORM_ref_addr (1.52 KB, patch)
2019-02-05 14:48 UTC, Tom de Vries
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tom de Vries 2019-02-05 14:40:05 UTC
For these gdb test-cases (implptr-64bit-d2o4a8r8t0, implptr-64bit-d2o4a8r8t1, implptr-64bit-d3o4a8r4t0, implptr-64bit-d3o4a8r4t1, multidictionary) we run into this assert:
...
dwz: dwz.c:8792: write_die: Assertion `refd != NULL' failed.
...
Comment 1 Tom de Vries 2019-02-05 14:42:04 UTC
Created attachment 11585 [details]
multidictionary executable
Comment 2 Tom de Vries 2019-02-05 14:45:15 UTC
Created attachment 11586 [details]
[Patch 1/2]  Factor out skip_attr
Comment 3 Tom de Vries 2019-02-05 14:48:16 UTC
Created attachment 11587 [details]
[PATCH 2/2] Error out for invalid DW_FORM_ref_addr
Comment 4 Tom de Vries 2019-03-07 13:12:34 UTC
patch submitted: https://sourceware.org/ml/dwz/2019-q1/msg00100.html
Comment 5 Matthias Klose 2019-07-02 07:36:09 UTC
fyi, this seems to be fixed on trunk 20190701
Comment 6 Tom de Vries 2019-07-02 07:48:15 UTC
(In reply to Matthias Klose from comment #5)
> fyi, this seems to be fixed on trunk 20190701

Well, I can't reproduce that. 

For me the failure still triggers with current trunk:
...
$ ./dwz multidictionary 
dwz: /data/dwz/dwz.git/dwz.c:9108: write_die: Assertion `refd != NULL' failed.
Aborted (core dumped)
$ ./dwz -l0 multidictionary 
Segmentation fault (core dumped)
...
Comment 8 Tom de Vries 2019-11-28 16:27:26 UTC
(In reply to Tom de Vries from comment #7)
> https://sourceware.org/git/?p=dwz.git;a=commit;
> h=695943014fd1d6e942988accf302bca327bf4304

FTR, this is a pragmatic fix. For something more structural, I've filed PR25229 - "Add input verification phase".