New gpc snapshot released: dwarf-2

Waldek Hebisch hebisch at math.uni.wroc.pl
Thu Sep 13 01:54:22 CEST 2007


Adriaan van Os wrote:
> When producing Dwarf-2 debug-info, there are a number of additional failures
> 
> [p17:~/gpc/gpc-20070904/gcc-4.1.2-test] adriaan% make EXTRA_PFLAGS=-gdwarf-2
> ...
> FAIL: aturbo3test.pas
> FAIL: crttest.pas
> FAIL: dialec3.pas
> FAIL: dialec5.pas
> FAIL: dialec6.pas
> FAIL: dialec7.pas
> ...
> 
> The backtrace is typically
> 
> Exception:  EXC_BAD_ACCESS (0x0001)
> Codes:      KERN_PROTECTION_FAILURE (0x0002) at 0x0000000c
> 
> Thread 0 Crashed:
> 0   cc1 	0x00312eea decl_assembler_name + 16 (tree.c:257)
> 1   cc1 	0x0036f529 machopic_output_function_base_name + 28 (darwin.c:251)
> 2   cc1 	0x00170ba2 output_addr_const + 733 (final.c:3240)
> 3   cc1 	0x00170b7c output_addr_const + 695 (final.c:3315)
> 4   cc1 	0x00170a89 output_addr_const + 452 (final.c:3339)
> 5   cc1 	0x00126242 dw2_asm_output_addr_rtx + 41 (dwarf2asm.c:220)
> 6   cc1 	0x0012844b output_loc_sequence + 495 (dwarf2out.c:3230)
> 7   cc1 	0x0013150f output_die + 678 (dwarf2out.c:7036)
> 8   cc1 	0x00131411 output_die + 424 (dwarf2out.c:7159)
> 9   cc1 	0x00131411 output_die + 424 (dwarf2out.c:7159)
> 10  cc1 	0x00131411 output_die + 424 (dwarf2out.c:7159)
> 11  cc1 	0x00131c71 output_comp_unit + 306 (dwarf2out.c:7230)
> 12  cc1 	0x0013d09e dwarf2out_finish + 1120 (dwarf2out.c:14269)
> 13  cc1 	0x00312212 toplev_main + 1947 (toplev.c:1030)
> 14  cc1 	0x00001eda _start + 216
> 15  cc1 	0x00001e01 start + 41
> 
> Thread 0 crashed with i386 Thread State:
> eax: 0x00000000    ebx: 0x00312ee7 ecx:0xa000bd00 edx: 0x4281fa7c
> edi: 0x00a07200    esi: 0x00000000 ebp:0xbfffd658 esp: 0xbfffd640
>   ss: 0x0000002f    efl: 0x00010282 eip:0x00312eea  cs: 0x00000027
>   ds: 0x0000002f     es: 0x0000002f  fs:0x00000000  gs: 0x00000037
> 
> But maybe the failures are Darwin-specific.
> 

It seems that machopic_output_function_base_name tries to use

DECL_ASSEMBLER_NAME (current_function_decl) 

however, at this time we are outside any function, so current_function_decl
is NULL, and we get null pointer exception.  Looking at output_addr_const
I see that it uses assemble_name function which (via assemble_name_raw)
uses ASM_OUTPUT_LABELREF.  This macro calls
machopic_output_function_base_name if the name is "<pic base>".

ATM I have no idea how this name could appear in expression outside
a function, but clearly the details are Darwin specific.


-- 
                              Waldek Hebisch
hebisch at math.uni.wroc.pl 





More information about the Gpc mailing list