klee / klee

KLEE Symbolic Execution Engine

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Different behaviors, when not found function in module in -libc=klee and -libc=uclibc

ladisgin opened this issue · comments

Run klee on module without function foo

When run KLEE with libc=klee KLEE fail on klee_error

utbot@03457909ca26:~/test_proj$ klee -entry-point=foo a.bc 
KLEE: output directory is "/home/utbot/test_proj/klee-out-10"
KLEE: Using Z3 solver backend
KLEE: Using Z3 bitvector builder
KLEE: ERROR: Could not link KLEE files Entry function 'foo' not found in module.

When run KLEE with libc=uclibc KLEE fail on assert

utbot@03457909ca26:~/test_proj$ klee -libc=uclibc -entry-point=foo a.bc 
klee: ../lib/Runner/run_klee.cpp:1189: void createLibCWrapper(std::vector<std::unique_ptr<llvm::Module> > &, llvm::StringRef, llvm::StringRef): Assertion `userMainFn && "unable to get user main"' failed.
 #0 0x0000000001cb296a llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/utbot_distr/klee/bin/klee+0x1cb296a)
 #1 0x0000000001cb08c4 llvm::sys::RunSignalHandlers() (/utbot_distr/klee/bin/klee+0x1cb08c4)
 #2 0x0000000001cb0a08 SignalHandler(int) (/utbot_distr/klee/bin/klee+0x1cb0a08)
 #3 0x00007f546c5bb980 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x12980)
 #4 0x00007f546b833e87 raise (/lib/x86_64-linux-gnu/libc.so.6+0x3ee87)
 #5 0x00007f546b8357f1 abort (/lib/x86_64-linux-gnu/libc.so.6+0x407f1)
 #6 0x00007f546b8253fa (/lib/x86_64-linux-gnu/libc.so.6+0x303fa)
 #7 0x00007f546b825472 (/lib/x86_64-linux-gnu/libc.so.6+0x30472)
 #8 0x0000000000522e40 createLibCWrapper(std::vector<std::unique_ptr<llvm::Module, std::default_delete<llvm::Module> >, std::allocator<std::unique_ptr<llvm::Module, std::default_delete<llvm::Module> > > >&, llvm::StringRef, llvm::StringRef) /home/utbot/klee/build/../lib/Runner/run_klee.cpp:0:3
 #9 0x0000000000522e40 linkWithUclibc(llvm::StringRef, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::vector<std::unique_ptr<llvm::Module, std::default_delete<llvm::Module> >, std::allocator<std::unique_ptr<llvm::Module, std::default_delete<llvm::Module> > > >&) /home/utbot/klee/build/../lib/Runner/run_klee.cpp:1261:3
#10 0x0000000000522e40 run_klee(int, char**, char**) /home/utbot/klee/build/../lib/Runner/run_klee.cpp:1700:5
#11 0x00007f546b816c87 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c87)
#12 0x0000000000519c6a _start (/utbot_distr/klee/bin/klee+0x519c6a)

It would be better if KLEE had the same behavior in these cases

This was fixed in #1574