Minqi Zhou via llvm-dev
2016-Aug-08 17:32 UTC
[llvm-dev] core dump when upgraded from llvm 3.5 to llvm 3.8.1
Dear LLVM Guys: These days, I run into a big problem after I upgraded llvm version from 3.5 to 3.8.1. I have digged it for one week already, but failed to fix it. When using the version 3.5, I use the JIT, but after upgrade to version 3.8.1, I do need to use the MCJIT. I also changed the code base to add: llvm::InitializeNativeTargetAsmPrinter(); llvm::InitializeNativeTargetAsmParser(); and use getFunctionAddress() instead of getPointerToFunction(); However, it code dumps when running the EE->runFunciton(); I also the run the example HwoToUseJIT in the example dictionary, and gets the same results. It shows as follows: We just constructed this LLVM module: ; ModuleID = 'test' define i32 @add1(i32 %AnArg) { EntryBlock: %0 = add i32 1, %AnArg ret i32 %0 } define i32 @foo() { EntryBlock: %0 = tail call i32 @add1(i32 10) ret i32 %0 } Running foo: Program received signal SIGSEGV, Segmentation fault. 0x00007ffff7ff5010 in foo () (gdb) where #0 0x00007ffff7ff5010 in foo () #1 0x00000000016278f0 in llvm::MCJIT::runFunction(llvm::Function*, llvm::ArrayRef<llvm::GenericValue>) () #2 0x0000000000b5a497 in Tests::JITadd (this=0x7fffffffd310) at ../../tests/Test_llvm.cpp:194 #3 0x0000000000b47520 in llvmGen (inputFile=..., optionLine="llvmgen fun_jit_add", position=@0x7fffffffd5f8: 18446744073709551615) at ../tests/Harness.cpp:619 #4 0x0000000000b41e95 in main (argc=2, argv=0x7fffffffd7b8) at ../tests/Harness.cpp:48 Is there anything missed when I upgrade the llvm version to 3.8 and using MCJIT? Do I need to change the Makefile a little bit? Thanks. -- Best Regards! Dr.Minqi Zhou Software Engineering Institute Institute of Massive Computing East China Normal University, Shanghai, China 200062 Tel/Fax: +86-21-62235022 Email: mqzhou at sei dot ecnu dotedu dot cn