This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug debug/84317] New: [8 regression] SEGV in dwarf2out.c (dwarf2out_source_line)


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84317

            Bug ID: 84317
           Summary: [8 regression] SEGV in dwarf2out.c
                    (dwarf2out_source_line)
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ro at gcc dot gnu.org
                CC: aoliva at gcc dot gnu.org, ebotcazou at gcc dot gnu.org
  Target Milestone: ---
              Host: sparc-sun-solaris2.*
            Target: sparc-sun-solaris2.*
             Build: sparc-sun-solaris2.*

Within the last week, Solaris/SPARC bootstrap got broken (Solaris 10 and 11.3
only, Solaris 11.4 is fine):

raised CONSTRAINT_ERROR : SIGSEGV
make[7]: *** [a-strsup.o] Error 1

Can be reproduced with

$ gnat1 -gnatwa -quiet -O2 -g -fPIC -gnatpg -mcpu=v9 -gnatO a-strsup.o
a-strsup.adb -o a-strsup.s

Thread 2 received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1 (LWP 1)]
dwarf2out_source_line (line=41, column=4, filename=0xfa80d410 "a-strsup.adb", 
    discriminator=0, is_stmt=<optimized out>)
    at /vol/gcc/src/hg/trunk/local/gcc/dwarf2out.c:27543
27543         if (is_stmt != table->is_stmt)

(gdb) p table
$1 = (dw_line_info_table *) 0x0

(gdb) where
#0  dwarf2out_source_line (line=41, column=4, 
    filename=0xfa80d410 "a-strsup.adb", discriminator=0, 
    is_stmt=<optimized out>)
    at /vol/gcc/src/hg/trunk/local/gcc/dwarf2out.c:27543
#1  0x00b6b4d8 in maybe_output_next_view (seen=0xffbff004)
    at /vol/gcc/src/hg/trunk/local/gcc/final.c:1729
#2  final_scan_insn (insn=insn@entry=0xfaa87ae0, file=0x1fcd030 <_iob+48>, 
    optimize_p=<optimized out>, nopeepholes=nopeepholes@entry=0, 
    seen=seen@entry=0xffbff004) at /vol/gcc/src/hg/trunk/local/gcc/final.c:2714
#3  0x012f4d78 in output_sibcall (insn=0xfaa87e78, call_operand=0xf9045100)
    at /vol/gcc/src/hg/trunk/local/gcc/config/sparc/sparc.c:6517
#4  0x00b6a054 in get_insn_template (code=<optimized out>, insn=0xfaa87e78)
    at /vol/gcc/src/hg/trunk/local/gcc/is-a.h:171
#5  0x00b6c6e4 in final_scan_insn (insn=0xfaa87e78, 
    file=file@entry=0x1fcd030 <_iob+48>, optimize_p=optimize_p@entry=0, 
    nopeepholes=nopeepholes@entry=1, seen=seen@entry=0xffbff224)
    at /vol/gcc/src/hg/trunk/local/gcc/final.c:3101
#6  0x00b6c378 in final_scan_insn (insn=insn@entry=0xfaa7c820, 
    file=file@entry=0x1fcd030 <_iob+48>, optimize_p=optimize_p@entry=2, 
    nopeepholes=nopeepholes@entry=0, seen=seen@entry=0xffbff224)
    at /vol/gcc/src/hg/trunk/local/gcc/is-a.h:171
#7  0x00b6d2e4 in final_1 (first=0xfa05c800, file=0x1fcd030 <_iob+48>, 
    seen=<optimized out>, optimize_p=2)
    at /vol/gcc/src/hg/trunk/local/gcc/final.c:2088
#8  0x00b6f064 in rest_of_handle_final ()
    at /vol/gcc/src/hg/trunk/local/gcc/final.c:4637
#9  (anonymous namespace)::pass_final::execute (this=<optimized out>)
    at /vol/gcc/src/hg/trunk/local/gcc/final.c:4711
#10 0x00e0a2b0 in execute_one_pass (pass=pass@entry=0x202fd98)
    at /vol/gcc/src/hg/trunk/local/gcc/passes.c:2497
#11 0x00e0aba8 in execute_pass_list_1 (pass=0x202fd98)
    at /vol/gcc/src/hg/trunk/local/gcc/passes.c:2586
#12 0x00e0abcc in execute_pass_list_1 (pass=0x202fa58)
    at /vol/gcc/src/hg/trunk/local/gcc/passes.c:2587
#13 0x00e0abcc in execute_pass_list_1 (pass=0x202e858, pass@entry=0x202c088)
    at /vol/gcc/src/hg/trunk/local/gcc/passes.c:2587
#14 0x00e0ac3c in execute_pass_list (fn=0xfa834208, pass=0x202c088)
    at /vol/gcc/src/hg/trunk/local/gcc/passes.c:2597
#15 0x00a50228 in cgraph_node::expand (this=this@entry=0xfa80e510)
    at /vol/gcc/src/hg/trunk/local/gcc/context.h:48
#16 0x00a51c20 in expand_all_functions ()
    at /vol/gcc/src/hg/trunk/local/gcc/cgraphunit.c:2275
#17 symbol_table::compile (this=this@entry=0xfa80e000)
    at /vol/gcc/src/hg/trunk/local/gcc/cgraphunit.c:2624
#18 0x00a54e2c in symbol_table::compile (this=0xfa80e000)
    at /vol/gcc/src/hg/trunk/local/gcc/cgraphunit.c:2717
#19 symbol_table::finalize_compilation_unit (this=0xfa80e000)
    at /vol/gcc/src/hg/trunk/local/gcc/cgraphunit.c:2717
#20 0x00f0ca08 in compile_file ()
    at /vol/gcc/src/hg/trunk/local/gcc/toplev.c:480
#21 0x0193fd6c in do_compile ()
    at /vol/gcc/src/hg/trunk/local/gcc/toplev.c:2097
#22 toplev::main (this=this@entry=0xffbff6be, argc=<optimized out>, 
    argc@entry=13, argv=<optimized out>, argv@entry=0xffbff724)
    at /vol/gcc/src/hg/trunk/local/gcc/toplev.c:2232
#23 0x019414c4 in main (argc=13, argv=0xffbff724)
    at /vol/gcc/src/hg/trunk/local/gcc/main.c:39

It's pretty obvious that one of Alexandre's patches is the culprit, probably
the location views one.

I suspect that the difference is related to the fact that Solaris 11.4 uses
DWARF-4, while 10 and 11.3 only use DWARF-2.  However, I've not been able to
make the SEGV vanish by passing -gdwarf-4 on S11.3 or trigger it with -gdwarf-2
on S11.4.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]