klee / klee

KLEE Symbolic Execution Engine

Home Page:https://klee-se.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

can't execute KLEE on target compiled as "-m32" on ubuntu 16.04

labba opened this issue · comments

commented

after searching for the issue in the issue list found one smilier that was resolved for 16.04 (#1404)

so i have created the same environment and tested:

using ubuntu 16.04 x64:

lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 16.04.7 LTS
Release:	16.04
Codename:	xenial
uname -a
Linux toor-virtual-machine 4.15.0-112-generic #113~16.04.1-Ubuntu SMP Fri Jul 10 04:37:08 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

using Klee version:

klee --version                           
KLEE 3.0-pre (https://klee.github.io)
  Build mode: RelWithDebInfo (Asserts: TRUE)
  Build revision: unknown

LLVM (http://llvm.org/):
  LLVM version 11.0.0
  Optimized build with assertions.
  Default target: x86_64-unknown-linux-gnu
  Host CPU: tigerlake

compiling code with :
clang -march="" -m32 -emit-llvm -c klee_test.c -o klee_test.bc

when executing getting the following issue:

 klee@b25601eeaca2:/home/share$ klee --search=random-path klee_test.bc
KLEE: WARNING: Module and host target triples do not match: 'i386-unknown-linux-gnu' != 'x86_64-unknown-linux-gnu'
This may cause unexpected crashes or assertion violations.
KLEE: output directory is "/home/share/klee-out-1"
KLEE: Using STP solver backend
warning: Linking two modules of different target triples: memset32_Debug+Asserts.bc' is 'i386-pc-linux-gnu' whereas 'klee_test.bc' is 'i386-unknown-linux-gnu'

KLEE: WARNING: undefined reference to function: printf
klee: /tmp/klee_src/include/klee/Expr/Expr.h:1082: static klee::ref<klee::ConstantExpr> klee::ConstantExpr::create(uint64_t, klee::Expr::Width): Assertion `v == bits64::truncateToNBits(v, w) && "invalid constant"' failed.
 #0 0x000014edb7cf45fa llvm::sys::PrintStackTrace(llvm::raw_ostream&) /tmp/llvm-110/llvm/lib/Support/Unix/Signals.inc:568:0
 #1 0x000014edb7cf2304 llvm::sys::RunSignalHandlers() /tmp/llvm-110/llvm/lib/Support/Signals.cpp:68:0
 #2 0x000014edb7cf2dd5 SignalHandler(int) /tmp/llvm-110/llvm/lib/Support/Unix/Signals.inc:396:0
 #3 0x000014edb7081f10 (/lib/x86_64-linux-gnu/libc.so.6+0x3ef10)
 #4 0x000014edb7081e87 raise (/lib/x86_64-linux-gnu/libc.so.6+0x3ee87)
 #5 0x000014edb70837f1 abort (/lib/x86_64-linux-gnu/libc.so.6+0x407f1)
 #6 0x000014edb70733fa (/lib/x86_64-linux-gnu/libc.so.6+0x303fa)
 #7 0x000014edb7073472 (/lib/x86_64-linux-gnu/libc.so.6+0x30472)
 #8 0x0000560da795200c klee::bits64::truncateToNBits(unsigned long, unsigned int) /tmp/klee_src/include/klee/ADT/Bits.h:79:0
 #9 0x0000560da795200c klee::ConstantExpr::create(unsigned long, unsigned int) /tmp/klee_src/include/klee/Expr/Expr.h:1082:0
#10 0x0000560da794fd76 klee::ref<klee::Expr>& klee::ref<klee::Expr>::operator=<klee::ConstantExpr>(klee::ref<klee::ConstantExpr>&&) /tmp/klee_src/include/klee/ADT/Ref.h:196:0
#11 0x0000560da794fd76 klee::ref<klee::Expr>::ref<klee::ConstantExpr>(klee::ref<klee::ConstantExpr>&&) /tmp/klee_src/include/klee/ADT/Ref.h:125:0
#12 0x0000560da794fd76 klee::Executor::runFunctionAsMain(llvm::Function*, int, char**, char**) /tmp/klee_src/lib/Core/Executor.cpp:4380:0
#13 0x0000560da791dceb main /tmp/klee_src/tools/klee/main.cpp:1516:0
#14 0x000014edb7064c87 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c87)
#15 0x0000560da792aaba _start (/tmp/klee_build110stp_z3/bin/klee+0x35aba)
Aborted (core dumped)

This is a duplicate of #286, please continue the conversation there.