Bug 22205 - .debug_line file table NULL filename
Summary: .debug_line file table NULL filename
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: binutils (show other bugs)
Version: 2.30
: P2 normal
Target Milestone: 2.30
Assignee: Alan Modra
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-09-25 13:36 UTC by Agostino Sarubbo
Modified: 2017-09-26 00:16 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed: 2017-09-25 00:00:00


Attachments
stacktrace (632 bytes, text/plain)
2017-09-25 13:36 UTC, Agostino Sarubbo
Details
testcase (10.94 KB, application/x-executable)
2017-09-25 13:37 UTC, Agostino Sarubbo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo 2017-09-25 13:36:40 UTC
Created attachment 10478 [details]
stacktrace

On master at 1da5c9a485f3dcac4c45e96ef4b7dae5948314b5:
# nm -V
GNU nm (Gentoo git) 2.29.51.20170925


Command to reproduce:
# nm -A -a -l -S -s --special-syms --synthetic --with-symbol-versions -D $FILE
Comment 1 Agostino Sarubbo 2017-09-25 13:37:07 UTC
Created attachment 10479 [details]
testcase
Comment 2 Sourceware Commits 2017-09-26 00:14:54 UTC
The master branch has been updated by Alan Modra <amodra@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=a54018b72d75abf2e74bf36016702da06399c1d9

commit a54018b72d75abf2e74bf36016702da06399c1d9
Author: Alan Modra <amodra@gmail.com>
Date:   Tue Sep 26 09:38:26 2017 +0930

    PR22205, .debug_line file table NULL filename
    
    The PR22200 fuzzer testcase found one way to put NULLs into .debug_line
    file tables.  PR22205 finds another.  This patch gives up on trying to
    prevent NULL files in the file table and instead just copes with them.
    Arguably, this is better than giving up and showing no info from
    .debug_line.  I've also fixed a case where the fairly recent DWARF5
    support in handling broken DWARG could result in uninitialized memory
    reads, and made a small tidy.
    
    	PR 22205
    	* dwarf2.c (concat_filename): Return "<unknown>" on NULL filename.
    	(read_formatted_entries): Init "fe".
    	(decode_line_info <DW_LNE_define_file>): Use line_info_add_file_name.
Comment 3 Alan Modra 2017-09-26 00:16:35 UTC
Fixed