cornell-zhang/hcl-dialect

[Frontend] Incorrect input data type leads to SegFault

Closed this issue · 1 comments

We need to add type checking before executing the module and throw out errors when types are unmatched. Sometimes the data type of the input HCL array is different from the one of the placeholder, but it does not notify the users, thus leads to the following SegFault.

#0 0x00007f39e0f7378f PrintStackTraceSignalHandler(void*) Signals.cpp:0:0
 #1 0x00007f39e0f711b9 SignalHandler(int) Signals.cpp:0:0
 #2 0x00007f39fdd8e630 __restore_rt sigaction.c:0:0
 #3 0x000055d3d6f8e28a gc_list_remove /home/builder/ktietz/cos6/ci_cos6/python_1622833237666/work/Modules/gcmodule.c:264:0
 #4 0x000055d3d6f8e28a PyObject_GC_Del /home/builder/ktietz/cos6/ci_cos6/python_1622833237666/work/Modules/gcmodule.c:1795:0
 #5 0x000055d3d6f8e28a code_dealloc.cold.1808 /home/builder/ktietz/cos6/ci_cos6/python_1622833237666/work/Objects/codeobject.c:471:0
 #6 0x000055d3d701391f func_dealloc /home/builder/ktietz/cos6/ci_cos6/python_1622833237666/work/Objects/funcobject.c:528:0
 #7 0x000055d3d6fbfe13 free_keys_object /home/builder/ktietz/cos6/ci_cos6/python_1622833237666/work/Objects/dictobject.c:560:0
 #8 0x000055d3d6fbfe13 PyDict_Clear /home/builder/ktietz/cos6/ci_cos6/python_1622833237666/work/Objects/dictobject.c:1753:0
 #9 0x000055d3d6fbfe89 dict_tp_clear /home/builder/ktietz/cos6/ci_cos6/python_1622833237666/work/Objects/dictobject.c:3071:0
#10 0x000055d3d6fce15d delete_garbage /home/builder/ktietz/cos6/ci_cos6/python_1622833237666/work/Modules/gcmodule.c:865:0
#11 0x000055d3d6fce15d collect /home/builder/ktietz/cos6/ci_cos6/python_1622833237666/work/Modules/gcmodule.c:1016:0
#12 0x000055d3d704ecba _PyGC_CollectNoFail /home/builder/ktietz/cos6/ci_cos6/python_1622833237666/work/Modules/gcmodule.c:1627:0
#13 0x000055d3d703325b PyImport_Cleanup /home/builder/ktietz/cos6/ci_cos6/python_1622833237666/work/Python/import.c:434:0
#14 0x000055d3d7079d8e Py_FinalizeEx /home/builder/ktietz/cos6/ci_cos6/python_1622833237666/work/Python/pylifecycle.c:611:0
#15 0x000055d3d707c811 Py_Main /home/builder/ktietz/cos6/ci_cos6/python_1622833237666/work/Modules/main.c:834:0
#16 0x000055d3d6fb6197 main /home/builder/ktietz/cos6/ci_cos6/python_1622833237666/work/Programs/python.c:73:0
#17 0x00007f39fd9d3555 __libc_start_main (/lib64/libc.so.6+0x22555)
#18 0x000055d3d704633e _start (/home/hc676/.conda/envs/pydev/bin/python3.6+0x1a733e)
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.

Fixed by f9d481.