Bug creation and email sending has been disabled, file new bugs at gcc.gnu.org/bugzilla
Bug 118 - Internal compiler error: Segmentation fault
Summary: Internal compiler error: Segmentation fault
Status: RESOLVED FIXED
Alias: None
Product: GDC
Classification: Unclassified
Component: gdc (show other bugs)
Version: development
Hardware: x86_64 Linux
: --- normal
Assignee: Iain Buclaw
URL:
Depends on:
Blocks:
 
Reported: 2014-04-13 18:17 CEST by K.
Modified: 2014-04-13 22:18 CEST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description K. 2014-04-13 18:17:12 CEST
When I try to build dub (https://github.com/rejectedsoftware/dub), I get an internal compiler error:

source/dub/dub.d: In member function 'getPackage':
source/dub/dub.d:725: internal compiler error: Segmentation fault
0x98c91f crash_signal
	../../gcc-4.9/gcc/toplev.c:337
0xb43015 tsi_stmt
	../../gcc-4.9/gcc/tree-iterator.h:92
0xb43015 try_catch_may_fallthru
	../../gcc-4.9/gcc/tree.c:12188
0xb43015 block_may_fallthru(tree_node const*)
	../../gcc-4.9/gcc/tree.c:12258
0x81a263 shortcut_cond_expr
	../../gcc-4.9/gcc/gimplify.c:2723
0x8218dc gimplify_cond_expr
	../../gcc-4.9/gcc/gimplify.c:2998
0x81c6ff gimplify_expr(tree_node**, gimple_statement_base**, gimple_statement_base**, bool (*)(tree_node*), int)
	../../gcc-4.9/gcc/gimplify.c:7435
0x81f546 gimplify_stmt(tree_node**, gimple_statement_base**)
	../../gcc-4.9/gcc/gimplify.c:5372
0x81fde6 gimplify_bind_expr
	../../gcc-4.9/gcc/gimplify.c:1098
0x81c90a gimplify_expr(tree_node**, gimple_statement_base**, gimple_statement_base**, bool (*)(tree_node*), int)
	../../gcc-4.9/gcc/gimplify.c:7676
0x81f546 gimplify_stmt(tree_node**, gimple_statement_base**)
	../../gcc-4.9/gcc/gimplify.c:5372
0x81d9eb gimplify_statement_list
	../../gcc-4.9/gcc/gimplify.c:1431
0x81d9eb gimplify_expr(tree_node**, gimple_statement_base**, gimple_statement_base**, bool (*)(tree_node*), int)
	../../gcc-4.9/gcc/gimplify.c:7894
0x81f546 gimplify_stmt(tree_node**, gimple_statement_base**)
	../../gcc-4.9/gcc/gimplify.c:5372
0x81dd01 gimplify_and_add
	../../gcc-4.9/gcc/gimplify.c:384
0x81dd01 gimplify_loop_expr
	../../gcc-4.9/gcc/gimplify.c:1405
0x81dd01 gimplify_expr(tree_node**, gimple_statement_base**, gimple_statement_base**, bool (*)(tree_node*), int)
	../../gcc-4.9/gcc/gimplify.c:7680
0x81f546 gimplify_stmt(tree_node**, gimple_statement_base**)
	../../gcc-4.9/gcc/gimplify.c:5372
0x81d9eb gimplify_statement_list
	../../gcc-4.9/gcc/gimplify.c:1431
0x81d9eb gimplify_expr(tree_node**, gimple_statement_base**, gimple_statement_base**, bool (*)(tree_node*), int)
	../../gcc-4.9/gcc/gimplify.c:7894
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.

Link to problematic source on github:
https://github.com/rejectedsoftware/dub/blob/d4d026861bf593c919ff69314b0a259e1e24d6a7/source/dub/dub.d#L725

I also tried to build with gdc 4.8.2 with same results :\
Comment 1 K. 2014-04-13 20:39:48 CEST
GDB output of command:

/path/to/usr/bin/gdc -wrapper gdb,--args -g -fdebug -Werror -fversion=DubUseCurl -I source @build-files.txt -Wl,-lcurl -o bin/dub

Program received signal SIGSEGV, Segmentation fault.
0x0000000000db0bc9 in tsi_stmt (i=...) at ../../gcc-4.9/gcc/tree-iterator.h:92
92	  return i.ptr->stmt;
(gdb) backtrace 
#0  0x0000000000db0bc9 in tsi_stmt (i=...) at ../../gcc-4.9/gcc/tree-iterator.h:92
#1  0x0000000000dc950a in try_catch_may_fallthru (stmt=0x7ffff6242780) at ../../gcc-4.9/gcc/tree.c:12188
#2  0x0000000000dc96d5 in block_may_fallthru (block=0x7ffff6242780) at ../../gcc-4.9/gcc/tree.c:12258
#3  0x0000000000dc96c4 in block_may_fallthru (block=0x7ffff623e7b0) at ../../gcc-4.9/gcc/tree.c:12255
#4  0x000000000096f46a in shortcut_cond_expr (expr=0x7ffff623eb70) at ../../gcc-4.9/gcc/gimplify.c:2723
#5  0x00000000009700ff in gimplify_cond_expr (expr_p=0x7ffff623ebc0, pre_p=0x7fffffffc5c8, fallback=0) at ../../gcc-4.9/gcc/gimplify.c:2998
#6  0x000000000097a11e in gimplify_expr (expr_p=0x7ffff623ebc0, pre_p=0x7fffffffc5c8, post_p=0x7fffffffc420, gimple_test_f=0x9730d4 <is_gimple_stmt(tree)>, 
    fallback=0) at ../../gcc-4.9/gcc/gimplify.c:7435
#7  0x0000000000975614 in gimplify_stmt (stmt_p=0x7ffff623ebc0, seq_p=0x7fffffffc5c8) at ../../gcc-4.9/gcc/gimplify.c:5372
#8  0x000000000096b2fc in gimplify_bind_expr (expr_p=0x7ffff6233f88, pre_p=0x7fffffffd0b8) at ../../gcc-4.9/gcc/gimplify.c:1098
#9  0x000000000097aacc in gimplify_expr (expr_p=0x7ffff6233f88, pre_p=0x7fffffffd0b8, post_p=0x7fffffffc720, gimple_test_f=0x9730d4 <is_gimple_stmt(tree)>, 
    fallback=0) at ../../gcc-4.9/gcc/gimplify.c:7676
#10 0x0000000000975614 in gimplify_stmt (stmt_p=0x7ffff6233f88, seq_p=0x7fffffffd0b8) at ../../gcc-4.9/gcc/gimplify.c:5372
#11 0x000000000096bd95 in gimplify_statement_list (expr_p=0x7fffffffcb38, pre_p=0x7fffffffd0b8) at ../../gcc-4.9/gcc/gimplify.c:1431
#12 0x000000000097b3a2 in gimplify_expr (expr_p=0x7fffffffcb38, pre_p=0x7fffffffd0b8, post_p=0x7fffffffc9c0, gimple_test_f=0x9730d4 <is_gimple_stmt(tree)>, 
    fallback=0) at ../../gcc-4.9/gcc/gimplify.c:7894
#13 0x0000000000975614 in gimplify_stmt (stmt_p=0x7fffffffcb38, seq_p=0x7fffffffd0b8) at ../../gcc-4.9/gcc/gimplify.c:5372
#14 0x0000000000969dd2 in gimplify_and_add (t=0x7ffff6238960, seq_p=0x7fffffffd0b8) at ../../gcc-4.9/gcc/gimplify.c:384
#15 0x000000000096bcbe in gimplify_loop_expr (expr_p=0x7ffff6233fb8, pre_p=0x7fffffffd0b8) at ../../gcc-4.9/gcc/gimplify.c:1405
#16 0x000000000097aaed in gimplify_expr (expr_p=0x7ffff6233fb8, pre_p=0x7fffffffd0b8, post_p=0x7fffffffcc70, gimple_test_f=0x9730d4 <is_gimple_stmt(tree)>, 
    fallback=0) at ../../gcc-4.9/gcc/gimplify.c:7680
#17 0x0000000000975614 in gimplify_stmt (stmt_p=0x7ffff6233fb8, seq_p=0x7fffffffd0b8) at ../../gcc-4.9/gcc/gimplify.c:5372
#18 0x000000000096bd95 in gimplify_statement_list (expr_p=0x7ffff623ebf0, pre_p=0x7fffffffd0b8) at ../../gcc-4.9/gcc/gimplify.c:1431
#19 0x000000000097b3a2 in gimplify_expr (expr_p=0x7ffff623ebf0, pre_p=0x7fffffffd0b8, post_p=0x7fffffffcf10, gimple_test_f=0x9730d4 <is_gimple_stmt(tree)>, 
    fallback=0) at ../../gcc-4.9/gcc/gimplify.c:7894
#20 0x0000000000975614 in gimplify_stmt (stmt_p=0x7ffff623ebf0, seq_p=0x7fffffffd0b8) at ../../gcc-4.9/gcc/gimplify.c:5372
#21 0x000000000096b2fc in gimplify_bind_expr (expr_p=0x7ffff6233fd0, pre_p=0x7fffffffd658) at ../../gcc-4.9/gcc/gimplify.c:1098
#22 0x000000000097aacc in gimplify_expr (expr_p=0x7ffff6233fd0, pre_p=0x7fffffffd658, post_p=0x7fffffffd210, gimple_test_f=0x9730d4 <is_gimple_stmt(tree)>, 
    fallback=0) at ../../gcc-4.9/gcc/gimplify.c:7676
#23 0x0000000000975614 in gimplify_stmt (stmt_p=0x7ffff6233fd0, seq_p=0x7fffffffd658) at ../../gcc-4.9/gcc/gimplify.c:5372
#24 0x000000000096bd95 in gimplify_statement_list (expr_p=0x7ffff623ec80, pre_p=0x7fffffffd658) at ../../gcc-4.9/gcc/gimplify.c:1431
#25 0x000000000097b3a2 in gimplify_expr (expr_p=0x7ffff623ec80, pre_p=0x7fffffffd658, post_p=0x7fffffffd4b0, gimple_test_f=0x9730d4 <is_gimple_stmt(tree)>, 
    fallback=0) at ../../gcc-4.9/gcc/gimplify.c:7894
#26 0x0000000000975614 in gimplify_stmt (stmt_p=0x7ffff623ec80, seq_p=0x7fffffffd658) at ../../gcc-4.9/gcc/gimplify.c:5372
#27 0x000000000096b2fc in gimplify_bind_expr (expr_p=0x7ffff621cd98, pre_p=0x7fffffffd930) at ../../gcc-4.9/gcc/gimplify.c:1098
#28 0x000000000097aacc in gimplify_expr (expr_p=0x7ffff621cd98, pre_p=0x7fffffffd930, post_p=0x7fffffffd7b0, gimple_test_f=0x9730d4 <is_gimple_stmt(tree)>, 
    fallback=0) at ../../gcc-4.9/gcc/gimplify.c:7676
#29 0x0000000000975614 in gimplify_stmt (stmt_p=0x7ffff621cd98, seq_p=0x7fffffffd930) at ../../gcc-4.9/gcc/gimplify.c:5372
#30 0x000000000097c9f7 in gimplify_body (fndecl=0x7ffff621cd00, do_parms=true) at ../../gcc-4.9/gcc/gimplify.c:8586
#31 0x000000000097cef6 in gimplify_function_tree (fndecl=0x7ffff621cd00) at ../../gcc-4.9/gcc/gimplify.c:8739
#32 0x0000000000811ca6 in analyze_function (node=0x7ffff622a8f8) at ../../gcc-4.9/gcc/cgraphunit.c:649
#33 0x00000000008128e8 in analyze_functions () at ../../gcc-4.9/gcc/cgraphunit.c:1017
#34 0x0000000000815469 in finalize_compilation_unit () at ../../gcc-4.9/gcc/cgraphunit.c:2320
#35 0x000000000074e226 in d_finish_compilation (vec=0x7ffff7fe7008, len=6853) at ../../gcc-4.9/gcc/d/d-objfile.cc:1984
#36 0x000000000073830c in d_write_global_declarations () at ../../gcc-4.9/gcc/d/d-lang.cc:645
#37 0x0000000000b90d9e in compile_file () at ../../gcc-4.9/gcc/toplev.c:562
#38 0x0000000000b92d58 in do_compile () at ../../gcc-4.9/gcc/toplev.c:1914
#39 0x0000000000b92ec3 in toplev_main (argc=46, argv=0x1c090e0) at ../../gcc-4.9/gcc/toplev.c:1990
#40 0x000000000127e4ed in main (argc=21, argv=0x7fffffffdca8) at ../../gcc-4.9/gcc/main.c:36
Comment 2 Iain Buclaw 2014-04-13 22:18:45 CEST
With --enable-checking:

source/dub/dub.d: In member function ‘getPackage’:
source/dub/dub.d:725: internal compiler error: tree check: expected statement_list, have catch_expr in tsi_start, at tree-iterator.h:42


https://github.com/D-Programming-GDC/GDC/commit/3d820cdbf7c8e86e6067ed4ff522da2bba8908c7