Bug 22186

Summary: divide-by-zero in decode_line_info (dwarf2.c)
Product: binutils Reporter: Agostino Sarubbo <ago>
Component: binutilsAssignee: Alan Modra <amodra>
Status: RESOLVED FIXED    
Severity: normal CC: luanjunchao
Priority: P2    
Version: 2.30   
Target Milestone: 2.30   
Host: Target:
Build: Last reconfirmed: 2017-09-23 00:00:00
Attachments: stacktrace
testcase

Description Agostino Sarubbo 2017-09-22 09:58:35 UTC
Created attachment 10459 [details]
stacktrace

On master compiled on 20170921
# nm -V
GNU nm (Gentoo git) 2.29.51.20170921


Command to reproduce:
# nm -A -a -l -S -s --special-syms --synthetic --with-symbol-versions -D $FILE
Comment 1 Agostino Sarubbo 2017-09-22 09:59:30 UTC
Created attachment 10460 [details]
testcase
Comment 2 Alan Modra 2017-09-23 10:29:21 UTC
*** Bug 22192 has been marked as a duplicate of this bug. ***
Comment 3 cvs-commit@gcc.gnu.org 2017-09-24 06:50:24 UTC
The master branch has been updated by Alan Modra <amodra@sourceware.org>:

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

commit d8010d3e75ec7194a4703774090b27486b742d48
Author: Alan Modra <amodra@gmail.com>
Date:   Sun Sep 24 14:36:48 2017 +0930

    PR22186, divide-by-zero in decode_line_info
    
    	PR 22186
    	* dwarf2.c (decode_line_info): Fail on lh.line_range of zero
    	rather than dividing by zero.
Comment 4 Alan Modra 2017-09-24 06:59:21 UTC
Fixed