ldc-developers / ldc

The LLVM-based D Compiler.
http://wiki.dlang.org/LDC
Other
1.2k stars 259 forks source link

Segmentation Fault in 0.17.1 codegen #1411

Open todayman opened 8 years ago

todayman commented 8 years ago

System: Arch Linux Architecture: x86_64 LLVM: 3.7.1-1 from repositories LDC: 0.17.1-1 from repositories

Compiling the attached code with "ldc .d dast/.d translate/*.d" causes a segmentation fault. The code fails to link as is with DMD, but the full project (from which this was taken via DustMite) compiles. Here's the stacktrace:

0 0x1b0cc40 llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/usr/bin/ldc+0x1b0cc40)

1 0x1b0ba21 (/usr/bin/ldc+0x1b0ba21)

2 0x7f6658ed1e80 __restore_rt (/usr/lib/libpthread.so.0+0x10e80)

3 0x79fb42 DtoCallFunction(Loc&, Type, DValue, Array<Expression*>, llvm::Value) (/usr/bin/ldc+0x79fb42)

4 0x838439 (/usr/bin/ldc+0x838439)

5 0x836b50 toElemDtor(Expression*) (/usr/bin/ldc+0x836b50)

6 0x841e6f (/usr/bin/ldc+0x841e6f)

7 0x841f14 (/usr/bin/ldc+0x841f14)

8 0x847064 StatementtoIR(Statement, IRState_) (/usr/bin/ldc+0x847064)

9 0x7c214c DtoDefineFunction(FuncDeclaration*) (/usr/bin/ldc+0x7c214c)

10 0x7a8c43 (/usr/bin/ldc+0x7a8c43)

11 0x7a99ce Declaration_codegen(Dsymbol*) (/usr/bin/ldc+0x7a99ce)

12 0x795608 DtoDeclarationExp(Dsymbol*) (/usr/bin/ldc+0x795608)

13 0x83867a (/usr/bin/ldc+0x83867a)

14 0x836b50 toElemDtor(Expression*) (/usr/bin/ldc+0x836b50)

15 0x841e6f (/usr/bin/ldc+0x841e6f)

16 0x841f14 (/usr/bin/ldc+0x841f14)

17 0x841f14 (/usr/bin/ldc+0x841f14)

18 0x847064 StatementtoIR(Statement, IRState_) (/usr/bin/ldc+0x847064)

19 0x7c214c DtoDefineFunction(FuncDeclaration*) (/usr/bin/ldc+0x7c214c)

20 0x7a99ce Declaration_codegen(Dsymbol*) (/usr/bin/ldc+0x7a99ce)

21 0x7b5b5d codegenModule(IRState, Module, bool) (/usr/bin/ldc+0x7b5b5d)

22 0x6861f0 ldc::CodeGenerator::emit(Module*) (/usr/bin/ldc+0x6861f0)

23 0x63cc0b main (/usr/bin/ldc+0x63cc0b)

24 0x7f6657c1c710 __libc_start_main (/usr/lib/libc.so.6+0x20710)

25 0x67fd09 _start (/usr/bin/ldc+0x67fd09)

testcase.tar.gz

JohanEngelen commented 8 years ago

Did you test compilation with 1.0.0? (or 1.1.0-alpha)