https://bugs.llvm.org/show_bug.cgi?id=41258
Bug ID: 41258
Summary: ORC JIT fails with standard math librrary
Product: new-bugs
Version: 8.0
Hardware: PC
OS: Linux
Status: NEW
Severity: release blocker
Priority: P
Component: new bugs
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected]
Created attachment 21686
--> https://bugs.llvm.org/attachment.cgi?id=21686&action=edit
Exploit
Hi,
when transitioning our application (which uses the IR Builder and JIT) from
using LLVM release 6.0 to release 8.0 we noticed that some JIT'd function work
fine while others don't. They actually crashed the program (always with the
same error message, see below). I narrowed it down to whenever a JIT'd function
make calls to the standard math library it fails.
I provide a minimal exploit.
Description of the exploit:
The program uses the KaleidoscopeJIT.h that ships with LLVM 8 (except that I
had to expose the Datalayout). It reads from the filesystem an IR file
(filename "func_works.ll" or "func_cos_fails.ll) and asks the ORC JIT first for
the symbol "func_ir" and then for the address.
In case the file "func_works.ll" was read the program succeeds with:
symbol found!
address found!
In case the file "func_cos_fails.ll" was read the program fails with:
symbol found!
Failure value returned from cantFail wrapped call
UNREACHABLE executed at
install/llvm-8.0-x86-debug/include/llvm/Support/Error.h:732!
Stack dump:
The program needs to be rebuild for it to use the other input file since the
filename is a C literal.
This was tested on an x86 Linux Ubuntu system using a "debug" build of LLVM 8.0
configured with
cmake -G "Unix Makefiles" \
-DBUILD_SHARED_LIBS="ON" \
-DLLVM_ENABLE_RTTI="ON" \
-DLLVM_ENABLE_ZLIB="OFF" \
-DLLVM_ENABLE_TERMINFO="OFF" \
-DCMAKE_BUILD_TYPE="Debug" \
-DCMAKE_INSTALL_PREFIX=$CMAKE_INSTALL_PREFIX \
-DLLVM_TARGETS_TO_BUILD="X86" \
-DCMAKE_BUILD_TYPE="Debug" \
$SRC
We are not doing something obviously wrong, do we?
This is a show stopper for us. We cannot use LLVM 8.0 in our production code.
--
You are receiving this mail because:
You are on the CC list for the bug._______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs