Hi all,
I am running some experiments with KLEE on Coreutils 6.11 and I deterministically experience this crash on date and touch utility:
KLEE: HaltTimer invoked
KLEE: halting execution, dumping remaining states
klee: IndependentSolver.cpp:532: virtual bool IndependentSolver::computeInitialValues(const klee::Query&, const std::vector<const klee::Array*>&, std::vector<std::vector<unsigned char> >&, bool&): Assertion `assertCreatedPointEvaluatesToTrue(query, objects, values) && "should satisfy the equation"' failed.
0 libLLVM-3.4.so.1 0x00007fca47c60d62 llvm::sys::PrintStackTrace(_IO_FILE*) + 50
1 libLLVM-3.4.so.1 0x00007fca47c607bc
2 libpthread.so.0 0x00007fca46cb8d10
3 libc.so.6 0x00007fca45e41267 gsignal + 55
4 libc.so.6 0x00007fca45e42eca abort + 362
5 libc.so.6 0x00007fca45e3a03d
6 libc.so.6 0x00007fca45e3a0f2
7 klee 0x00000000004f24ac IndependentSolver::computeInitialValues(klee::Query const&, std::vector<klee::Array const*, std::allocator<klee::Array const*> > const&, std::vector<std::vector<unsigned char, std::allocator<unsigned char> >, std::allocator<std::vector<unsigned char, std::allocator<unsigned char> > > >&, bool&) + 8012
8 klee 0x00000000004f8aa9 QueryLoggingSolver::computeInitialValues(klee::Query const&, std::vector<klee::Array const*, std::allocator<klee::Array const*> > const&, std::vector<std::vector<unsigned char, std::allocator<unsigned char> >, std::allocator<std::vector<unsigned char, std::allocator<unsigned char> > > >&, bool&) + 73
9 klee 0x00000000004fd4b3 klee::Solver::getInitialValues(klee::Query const&, std::vector<klee::Array const*, std::allocator<klee::Array const*> > const&, std::vector<std::vector<unsigned char, std::allocator<unsigned char> >, std::allocator<std::vector<unsigned char, std::allocator<unsigned char> > > >&) + 35
10 klee 0x00000000004b8d57 klee::TimingSolver::getInitialValues(klee::ExecutionState const&, std::vector<klee::Array const*, std::allocator<klee::Array const*> > const&, std::vector<std::vector<unsigned char, std::allocator<unsigned char> >, std::allocator<std::vector<unsigned char, std::allocator<unsigned char> > > >&) + 263
11 klee 0x000000000048899b klee::Executor::getSymbolicSolution(klee::ExecutionState const&, std::vector<std::pair<std::string, std::vector<unsigned char, std::allocator<unsigned char> > >, std::allocator<std::pair<std::string, std::vector<unsigned char, std::allocator<unsigned char> > > > >&) + 763
12 klee 0x0000000000480e4e KleeHandler::processTestCase(klee::ExecutionState const&, char const*, char const*) + 302
13 klee 0x000000000048930a klee::Executor::terminateStateEarly(klee::ExecutionState&, llvm::Twine const&) + 394
14 klee 0x00000000004989d1 klee::Executor::run(klee::ExecutionState&) + 1377
15 klee 0x000000000049937c klee::Executor::runFunctionAsMain(llvm::Function*, int, char**, char**) + 1644
16 klee 0x0000000000476c2e main + 11326
17 libc.so.6 0x00007fca45e2ca40 __libc_start_main + 240
18 klee 0x000000000047e0f9 _start + 41
Aborted (core dumped)
My setup:
Ubuntu 15.10
LLVM 3.4
KLEE (built with uclibc) 2a0eca5
STP 3785148da15919de445e476a6f20b06c881cf50c
Coreutils 6.11 built with whole-program-llvm (with clang as llvm compiler) and configured as in the KLEE tutorial page
I experience this bug also in this setup:
Ubuntu 15.10
LLVM 2.9
KLEE (built with uclibc) 2a0eca5
STP 3785148da15919de445e476a6f20b06c881cf50c
Coreutils 6.11 built with klee-gcc and configured as in the KLEE tutorial page
The commands I use:
klee --libc=uclibc --posix-runtime -use-query-log=all:pc --simplify-sym-indices --output-module --max-memory=1000 --disable-inlining --optimize --use-forked-solver --max-sym-array-size=4096 --max-instruction-time=30. --max-time=3600. --max-memory-inhibit=false --max-static-fork-pct=1 --max-static-solve-pct=1 --max-static-cpfork-pct=1 --switch-type=internal --randomize-fork --search=random-path --search=nurs:covnew --use-batching-search --batch-instructions=10000 --use-cex-cache=false ../coreutils-6.11/obj-llvm/src/date.bc --sym-args 0 1 10 --sym-args 0 2 2 --sym-files 1 8 --sym-stdout
klee --libc=uclibc --posix-runtime -use-query-log=all:pc --simplify-sym-indices --output-module --max-memory=1000 --disable-inlining --optimize --use-forked-solver --max-sym-array-size=4096 --max-instruction-time=30. --max-time=3600. --max-memory-inhibit=false --switch-type=internal --randomize-fork --search=random-path --search=nurs:covnew --use-batching-search --batch-instructions=10000 --use-cex-cache=false ../coreutils-6.11/obj-llvm/src/touch.bc --sym-args 0 1 10 --sym-args 0 2 2 --sym-files 1 8 --sym-stdout
The counterexample cache is disabled as per issue #347. The assertion fails both with and without -optimize
option. Moreover, the assertion fails deterministically not only in KLEE but also in KLEAVER for example with the following query:
array n_args[4] : w32 -> w8 = symbolic
array n_args_1[4] : w32 -> w8 = symbolic
array A-data-stat[144] : w32 -> w8 = symbolic
array stdin-stat[144] : w32 -> w8 = symbolic
(query [(Ult N0:(ReadLSB w32 0 n_args) 2)
(Slt 0 N0)
(Ult N1:(ReadLSB w32 0 n_args_1) 3)
(Slt 0 N1)
(Slt 1 N1)
(Eq false (Eq 0 (And w64 (ReadLSB w64 8 A-data-stat) 2147483647)))
(Ult (ReadLSB w64 56 A-data-stat) 65536)
(Eq false (Eq 0 (And w64 (ReadLSB w64 8 stdin-stat) 2147483647)))]
(Eq false (Ult (ReadLSB w64 56 stdin-stat) 65536)) [] [n_args])
KLEAVER does not crash when we do not ask for a counterexample.
I will try to figure out what is happening to KLEE by also looking into the core dump. I hope to find out something useful to fix the bug.
bug