Skip to content

Segmentation Fault in 0.17.1 codegen #1411

@todayman

Description

@todayman

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 Statement_toIR(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 Statement_toIR(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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions