[llvm-dev] Crash on cyclic struct type

Peter Lammich via llvm-dev llvm-dev at lists.llvm.org
Fri Jan 18 10:45:09 PST 2019


Hi,

I accidentally defined a cyclic struct, and llc 6.0.0 crashes. I would
have expected a meaningful error message, rather than a crash.
Minimal example attached.

Has this been fixed already? If not, can I test this against the latest
LLVM version without locally installing/compiling the whole thing, or
should I file a bug report against LLVM-6.0.0?

---

cyclic_type.ll:
 
  target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
  target triple = "x86_64-pc-linux-gnu"

  %T1 = type { %T2 }
  %T2 = type { %T1 }

  define %T2 @f() {
    ret %T2 zeroinitializer
  }

> llc -O0 cyclic_type.ll 
[...]
Floating point exception (core dumped)


Full output:

lammich at lapnipkow10:~/tmp/llvm_test$ llc -O0 cyclic_type.ll 
/usr/lib/x86_64-linux-gnu/libLLVM-
6.0.so.1(_ZN4llvm3sys15PrintStackTraceERNS_11raw_ostreamE+0x2a)[0x7f871
c1fb2ea]
/usr/lib/x86_64-linux-gnu/libLLVM-
6.0.so.1(_ZN4llvm3sys17RunSignalHandlersEv+0x3e)[0x7f871c1f94ae]
/usr/lib/x86_64-linux-gnu/libLLVM-6.0.so.1(+0x8635fc)[0x7f871c1f95fc]
/lib/x86_64-linux-gnu/libc.so.6(+0x354b0)[0x7f871b27f4b0]
/usr/lib/x86_64-linux-gnu/libLLVM-
6.0.so.1(_ZN4llvm12StructLayoutC2EPNS_10StructTypeERKNS_10DataLayoutE+0
x11f)[0x7f871c25e68f]
/usr/lib/x86_64-linux-gnu/libLLVM-
6.0.so.1(_ZNK4llvm10DataLayout15getStructLayoutEPNS_10StructTypeE+0x284
)[0x7f871c25eed4]
/usr/lib/x86_64-linux-gnu/libLLVM-
6.0.so.1(_ZNK4llvm10DataLayout12getAlignmentEPNS_4TypeEb+0x12b)[0x7f871
c25fcab]
/usr/lib/x86_64-linux-gnu/libLLVM-
6.0.so.1(_ZN4llvm12StructLayoutC2EPNS_10StructTypeERKNS_10DataLayoutE+0
xd3)[0x7f871c25e643]
/usr/lib/x86_64-linux-gnu/libLLVM-
6.0.so.1(_ZNK4llvm10DataLayout15getStructLayoutEPNS_10StructTypeE+0x284
)[0x7f871c25eed4]
/usr/lib/x86_64-linux-gnu/libLLVM-
6.0.so.1(_ZN4llvm15ComputeValueVTsERKNS_14TargetLoweringERKNS_10DataLay
outEPNS_4TypeERNS_15SmallVectorImplINS_3EVTEEEPNS8_ImEEm+0x88)[0x7f871c
344848]
/usr/lib/x86_64-linux-gnu/libLLVM-
6.0.so.1(_ZN4llvm13GetReturnInfoEPNS_4TypeENS_13AttributeListERNS_15Sma
llVectorImplINS_3ISD9OutputArgEEERKNS_14TargetLoweringERKNS_10DataLayou
tE+0x80)[0x7f871c5fc620]
/usr/lib/x86_64-linux-gnu/libLLVM-
6.0.so.1(_ZN4llvm20FunctionLoweringInfo3setERKNS_8FunctionERNS_15Machin
eFunctionEPNS_12SelectionDAGE+0xe1)[0x7f871c69bd21]
/usr/lib/x86_64-linux-gnu/libLLVM-
6.0.so.1(_ZN4llvm16SelectionDAGISel20runOnMachineFunctionERNS_15Machine
FunctionE+0x41d)[0x7f871c7cb73d]
/usr/lib/x86_64-linux-gnu/libLLVM-6.0.so.1(+0x23296c4)[0x7f871dcbf6c4]
/usr/lib/x86_64-linux-gnu/libLLVM-
6.0.so.1(_ZN4llvm19MachineFunctionPass13runOnFunctionERNS_8FunctionE+0x
91)[0x7f871c47e3f1]
/usr/lib/x86_64-linux-gnu/libLLVM-
6.0.so.1(_ZN4llvm13FPPassManager13runOnFunctionERNS_8FunctionE+0x1f2)[0
x7f871c2c8a22]
/usr/lib/x86_64-linux-gnu/libLLVM-
6.0.so.1(_ZN4llvm13FPPassManager11runOnModuleERNS_6ModuleE+0x33)[0x7f87
1c2c8ad3]
/usr/lib/x86_64-linux-gnu/libLLVM-
6.0.so.1(_ZN4llvm6legacy15PassManagerImpl3runERNS_6ModuleE+0x30f)[0x7f8
71c2c866f]
llc[0x4200c6]
llc(main+0x3ad)[0x4156ad]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f871b26a830]
llc(_start+0x29)[0x415869]
Stack dump:
0.      Program arguments: llc -O0 cyclic_type.ll 
1.      Running pass 'Function Pass Manager' on module
'cyclic_type.ll'.
2.      Running pass 'X86 DAG->DAG Instruction Selection' on function '
@f'
Floating point exception (core dumped)



More information about the llvm-dev mailing list