llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
29.13k stars 12.02k forks source link

LLJITWithObjectCache example program segfaults #43465

Closed llvmbot closed 4 years ago

llvmbot commented 4 years ago
Bugzilla Link 44120
Resolution FIXED
Resolved on Mar 15, 2020 10:14
Version 9.0
OS Linux
Reporter LLVM Bugzilla Contributor
CC @AlexDenisov,@lhames

Extended Description

The example program crashes with SIGSEGV.

The symbol lookup of the generated function fails which leads to the function pointer being NULL. The indirect call through the function pointer results in the segfault.

My build configuration is nearly default: cmake -DCMAKE_BUILD_TYPE=Release/Debug -DLLVM_BUILD_LLVM_DYLIB=ON ..

lhames commented 4 years ago

Hi Frank,

This appears to have been fixed on LLVM trunk. I'm not sure exactly which patch fixed it, but there have been a number of tweaks to this part of the codebase recently as part of the effort to move the Swift interpreter over to OrcV2.

Unfortunately these fixes came after we branched for LLVM 10, but this should be fixed in LLVM 11.

The test case should work on Darwin in LLVM 10 (and LLVM 9 too, I believe).

-- Lang.

llvmbot commented 4 years ago

assigned to @lhames