New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KLEE with uclibc will hang if a call to fscanf is made. #30
Comments
Hi @delcypher , Thanks, |
I have the same issue with KLEE. There's a program which calls scanf to get the input to the program and I need to find all the paths for this program. Unfortunately KLEE hangs for the input (which I don't have). |
…acer plugin - Fixed KLEE expression printer to honor stream manipulators when printing numbers - Fixed the s2e tools suite to compile on Linux git-svn-id: https://dslabpc10.epfl.ch/svn/src/s2e/trunk@10451 f94e2f5b-dfd8-4992-a279-46519bc7c46e
I have tried Thanks |
@yxliang01 This bugreport is quite old. Currently I cannot reproduce @delcypher's example. Which KLEE and LLVM version are you using? What is the output of KLEE? |
Program used: #include <stdio.h>
int main(int argc, char** argv) {
int a;
scanf("%d", &a);
printf("%d", a);
return 0;
} Compiled using wllvm with KLEE command: KLEE output:
I am actually kind of surprised that you can't reproduce. Would be great if you can also pose your experiment setting. Thanks |
Thanks, I could reproduce the problem. @yxliang01 please use |
Thanks @MartinNowack. However, like what I said in the previous comment, the target programs that I want to run with KLEE requires |
@yxliang01 Ah, sorry, misread this. A couple of options, but they all have their drawbacks
|
@MartinNowack Thanks for the workaround. However... It didn't work for me. Could you share your experiment setting and did you modify base on commit 495b3e5 ? Thanks |
Interesting. With diff --git a/tools/klee/main.cpp b/tools/klee/main.cpp
index 589ce98..b001550 100644
--- a/tools/klee/main.cpp
+++ b/tools/klee/main.cpp
@@ -1071,6 +1071,7 @@ linkWithUclibc(StringRef libDir,
for (auto i = newModules, j = modules.size(); i < j; ++i) {
replaceOrRenameFunction(modules[i].get(), "__libc_open", "open");
replaceOrRenameFunction(modules[i].get(), "__libc_fcntl", "fcntl");
+replaceOrRenameFunction(modules[i].get(), "scanf", "__isoc99_scanf");
}
createLibCWrapper(modules, EntryPoint, "__uClibc_main"); |
@MartinNowack Indeed, this workaround works if the base is the pr #868 . Do you know which part of #868 is crucial for Thanks @MartinNowack |
@yxliang01 Well, I'm afraid that there is no easy way out. |
@MartinNowack Are there other quick fixes or workarounds that don't use Thanks! |
@yxliang01 maybe you just copy the function |
@MartinNowack Indeed, copy |
Is it copying 'scanf' or 'fscanf'? |
It worked. Thanks. |
commit e78e0c2b98c8fccbcde8a3bef67622a0287fbb2a Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Wed Mar 1 23:58:09 2023 +0300 [fix] commit 589fed6 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Sat Feb 11 14:44:37 2023 -0800 Squashed commit of the following: commit 19a57ba Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Fri Dec 16 04:21:33 2022 -0800 [fix] Skip locations without targets commit 0aa8b15 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Tue Dec 13 04:15:43 2022 -0800 [fix] Improve `parseTraceEvent` commit 35fd8bc Author: Yurii Kostyukov <kostyukov.yurii@gmail.com> Date: Sat Dec 10 11:19:20 2022 +0300 [feat] Return confidence and give advise commit be61cfa Author: Yurii Kostyukov <kostyukov.yurii@gmail.com> Date: Thu Dec 8 15:00:09 2022 +0300 [feat] Output number of reached events instead of confidence rate commit 5b5825f Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Mon Dec 5 15:48:09 2022 -0800 [fix] Update header commit db0ec33 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Tue Dec 6 01:26:58 2022 +0300 [feat] Update error report messages commit f017b8e Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Sun Dec 4 22:57:47 2022 +0300 [fix] Update tests commit 0b4c930 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Sat Dec 3 15:33:47 2022 +0300 [feat] Add trace reachability handling commit 84e164c Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Fri Dec 2 13:39:51 2022 +0300 [feat] Add use after free error handling for error guidance mode commit e73ef25 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Thu Dec 1 23:13:43 2022 +0300 [feat] Add double free error handling for error guidance mode commit cccd432 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Thu Dec 1 01:01:49 2022 +0300 [fix] Check if `address` semantically constant commit b0d9bad Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Wed Nov 30 11:55:59 2022 +0300 [feat] Add `ExternCallsCanReturnNull` commit f2ab180 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Tue Nov 29 18:41:19 2022 +0300 [fix] commit e043a94 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Mon Nov 28 23:32:19 2022 +0300 [fix] Update tests commit d90bb57 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Mon Nov 28 23:32:02 2022 +0300 [feat] Add `ReturnSplitter` commit 4b916df Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Sat Nov 26 06:16:05 2022 +0300 [feat] Add halting check in `resolveOne` commit 262305d Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Fri Nov 25 20:09:49 2022 +0300 [refactor] commit bc6ccc7 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Fri Nov 25 20:09:21 2022 +0300 [fix] Dump traces after the second interruption commit 437911b Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Fri Nov 25 12:59:26 2022 +0300 [fix] Init `KleeHandler` before the first `klee_...` usage commit 6adb679 Author: Yurii Kostyukov <kostyukov.yurii@gmail.com> Date: Thu Nov 24 13:14:48 2022 +0300 [feat] Report FP even before interpreter starts commit 7443bb4 Author: Yurii Kostyukov <kostyukov.yurii@gmail.com> Date: Thu Nov 24 01:27:05 2022 +0300 [fix] Smarter Call arg resolving commit bc5e72b Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Thu Nov 24 01:31:28 2022 +0300 [fix] Don't change `history` when going to a location with an error commit 3e933d7 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Thu Nov 24 00:33:58 2022 +0300 [fix] Relax the accuracy of the location of errors, consider only the line commit c8e87f6 Author: Yurii Kostyukov <kostyukov.yurii@gmail.com> Date: Thu Nov 24 00:31:18 2022 +0300 [chore] Improved bad JSON reporting commit 19b5086 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Wed Nov 23 21:54:39 2022 +0300 [fix] Always report traces commit 1f2d1d0 Author: Yurii Kostyukov <kostyukov.yurii@gmail.com> Date: Wed Nov 23 20:40:17 2022 +0300 [fix] Hack to overcome old KLEE *this* resolving in call commit 2012e9a Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Wed Nov 23 14:35:17 2022 +0300 [fix] Add small fix commit cffc2e7 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Wed Nov 23 14:07:02 2022 +0300 [fix] Disable `constraintsWithSymcretes`, save all in `constraints` commit 4c9f42d Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Wed Nov 23 04:58:47 2022 +0300 [fix] Disable independent solver because it is buggy commit 020715c Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Wed Nov 23 00:27:52 2022 +0300 [fix] Fix NPE commit 5a31aa6 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Tue Nov 22 23:59:02 2022 +0300 [fix] Fix bug in `isTheSameAsIn` and tests commit e720fef Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Tue Nov 22 22:28:19 2022 +0300 [fix] Small fix commit 8b67688 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Tue Nov 22 22:27:59 2022 +0300 [fix] Disable `AlignSymbolicPointers` in error guided mode commit d8a07ff Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Tue Nov 22 04:10:57 2022 +0300 [fix] Fix tests commit 8ed9e49 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Tue Nov 22 02:14:15 2022 +0300 [feat] Add Expr hash consing commit cc3a46e Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Tue Nov 22 00:48:06 2022 +0300 [fix] Fix tests commit ba4a345 Author: Yurii Kostyukov <kostyukov.yurii@gmail.com> Date: Tue Nov 22 00:04:06 2022 +0300 [chore] Suppress useless undef. ref. output commit d4fa3ad Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Mon Nov 21 18:27:08 2022 +0300 [fix] Fix test commit ecdb011 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Mon Nov 21 18:12:41 2022 +0300 [feat] Mesure initialization overhead commit 0f3932a Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Mon Nov 21 17:58:35 2022 +0300 [feat] Explore paths in fair style during error guided mode commit 3b4b94c Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Mon Nov 21 15:48:51 2022 +0300 [feat] Add `PForest` commit f9eeb02 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Mon Nov 21 14:02:57 2022 +0300 [fix] Fix handle a target with an error commit 167bc5f Author: Yurii Kostyukov <kostyukov.yurii@gmail.com> Date: Mon Nov 21 14:04:02 2022 +0300 [fix] Fixed CR 99% commit 3aabe74 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Fri Nov 18 15:59:13 2022 +0300 [fix] Fix bug and andd new test commit 44013c1 Author: Yurii Kostyukov <kostyukov.yurii@gmail.com> Date: Fri Nov 18 14:00:26 2022 +0300 [fix] Small fixes commit d52b207 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Fri Nov 18 12:46:33 2022 +0300 [feat] Add `max-stepped-instructions` option commit f2f9a8d Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Fri Nov 18 02:06:22 2022 +0300 [feat] Add new tests commit a828827 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Fri Nov 18 02:06:01 2022 +0300 [fix] Timers commit 284f0fc Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Fri Nov 18 01:53:34 2022 +0300 [fix] JSON parser commit 3891f7a Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Thu Nov 17 23:31:30 2022 +0300 [fix] Searcher commit 4a6a777 Author: Yurii Kostyukov <kostyukov.yurii@gmail.com> Date: Fri Nov 18 00:53:15 2022 +0300 [fix] Fixed suppress output commit e88a57f Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Thu Nov 17 22:53:30 2022 +0300 [fix] Always calculate weight when a state in `KCallBlock` commit 96ea95f Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Thu Nov 17 22:08:29 2022 +0300 [fix] Always calculate weight when a state in `KCallBlock` commit f719b88 Author: Yurii Kostyukov <kostyukov.yurii@gmail.com> Date: Thu Nov 17 15:07:51 2022 +0300 [chore] Minor improvements commit ba60972 Author: Yurii Kostyukov <kostyukov.yurii@gmail.com> Date: Tue Nov 15 17:39:58 2022 +0300 [feat] Confidence rate commit b0bd39b Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Thu Nov 17 04:46:51 2022 +0300 Fixed-resolving-locations-to-blocks-then-to-targets commit 5b82acb Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Thu Nov 17 00:30:27 2022 +0300 [feat] Use partial lazy instantiation in `ErrorGuidance` mode commit c0f31f9 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Thu Nov 17 00:28:26 2022 +0300 [fix] commit db223ef Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Wed Nov 16 22:23:16 2022 +0300 [feat] Remove `targetsOfCurrentKBlock` commit 0132dfa Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Wed Nov 16 19:47:31 2022 +0300 [feat] Parse a column and a opcode from .json input commit 574036d Author: Yurii Kostyukov <kostyukov.yurii@gmail.com> Date: Wed Nov 16 16:46:37 2022 +0300 [fix] Fixed searcher commit 72ece10 Author: Yurii Kostyukov <kostyukov.yurii@gmail.com> Date: Wed Nov 16 13:25:46 2022 +0300 [fix] Fixed types commit 49e0afd Author: Yurii Kostyukov <kostyukov.yurii@gmail.com> Date: Wed Nov 16 10:08:41 2022 +0300 [fix] Fixed broken traces filtering commit 9368da9 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Wed Nov 16 01:57:11 2022 +0300 [feat] Expand `Target` commit 08ccd1a Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Tue Nov 15 23:08:46 2022 +0300 [feat] Check null in conservative style commit eff02b5 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Tue Nov 15 23:07:34 2022 +0300 [fix] commit d4fd8be Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Tue Nov 15 23:06:49 2022 +0300 [fix] Revert target caching commit 83020be Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Tue Nov 15 23:05:37 2022 +0300 [fix] commit 3a560a5 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Tue Nov 15 23:03:56 2022 +0300 [fix] `use-gep-expr` -> `use-gep-opt` commit 6fc0997 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Tue Nov 15 15:43:17 2022 +0300 [fix] The instruction in `Location` can be wrong commit 76e06b7 Author: Yurii Kostyukov <kostyukov.yurii@gmail.com> Date: Tue Nov 15 12:56:36 2022 +0300 [feat] Reporting bad traces commit f5fc1d6 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Sun Nov 13 19:54:42 2022 +0300 [fix] Move `getExprBases` to `ExecutionState` commit 70af507 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Sun Nov 13 19:31:17 2022 +0300 [fix] Small fixes commit 00096e4 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Sun Nov 13 19:28:04 2022 +0300 [fix] Improve `UseSymcreteAddresses` commit 602a863 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Sun Nov 13 05:12:58 2022 +0300 [fix] Block paths to reached targets from the targeted forest commit 193eb93 Author: Yurii Kostyukov <kostyukov.yurii@gmail.com> Date: Sat Nov 12 23:45:23 2022 +0300 [fix] Report FP for different runs independently commit c2f6bae Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Sat Nov 12 20:31:23 2022 +0300 [style] commit 943c7ea Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Sat Nov 12 20:30:28 2022 +0300 [fix] NPE check should be before every resolve commit 098e85d Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Sat Nov 12 20:29:28 2022 +0300 [fix] Ad-hoc fix for li char's arrays commit 036d31c Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Sat Nov 12 20:24:42 2022 +0300 [feat] Set default options for error-guided mode commit 6119f1e Author: Alex Babushkin <ocelaiwo@gmail.com> Date: Fri Nov 11 16:32:20 2022 +0300 add flag for partial validity commit 8a87c6d Author: Alex Babushkin <ocelaiwo@gmail.com> Date: Fri Nov 11 15:18:31 2022 +0300 add partial validity, change fork behavior commit 63b7cc8 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Sat Nov 12 14:02:30 2022 +0300 [fix] Search is done when the target is init block commit beb64d5 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Sat Nov 12 14:01:10 2022 +0300 [feat] Add `SimplifyModule` commit a4fe077 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Sat Nov 12 13:53:57 2022 +0300 [feat] Add `MockAllExternalCalls` commit 33119f6 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Sat Nov 12 13:43:03 2022 +0300 [fix] Handle only in bound case commit c4030e2 Author: Yurii Kostyukov <kostyukov.yurii@gmail.com> Date: Sat Nov 12 00:51:43 2022 +0300 [feat] Deduce column from offset commit e125f1d Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Fri Nov 11 22:12:39 2022 +0300 [wip] Add kmoduleOrig commit f31030a Author: Alex Babushkin <ocelaiwo@gmail.com> Date: Fri Nov 11 17:02:25 2022 +0300 mock external objects commit a7a0beb Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Fri Nov 11 15:51:28 2022 +0300 [fix] Order is unimportant commit 7c9716f Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Fri Nov 11 15:50:50 2022 +0300 [fix] NPE commit 8c22a89 Author: Yurii Kostyukov <kostyukov.yurii@gmail.com> Date: Fri Nov 11 14:45:33 2022 +0300 [fix] Use column instead of instruction offset commit 35cc2d9 Author: Yurii Kostyukov <kostyukov.yurii@gmail.com> Date: Fri Nov 11 13:36:51 2022 +0300 [fix] FP duplicate commit 62e3820 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Fri Nov 11 11:42:03 2022 +0300 [fix] Check out of bound for the newly created li object commit 7eaf7f8 Author: Sergey Morozov <morozov.serg901@gmail.com> Date: Fri Nov 11 03:30:14 2022 +0300 Fixed check for lazy instantiation commit acec060 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Fri Nov 11 04:56:46 2022 +0300 [fix] Small fixes, style commit e7dc6e8 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Fri Nov 11 04:54:56 2022 +0300 [fix] Saved function can be invalid, save only names commit 1eb447e Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Fri Nov 11 04:51:49 2022 +0300 [fix] commit 964412c Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Fri Nov 11 04:51:18 2022 +0300 [fix] Improve CallSplitter commit 72b0bb9 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Fri Nov 11 01:10:13 2022 +0300 [fix] There are false negatives with expected error and different locations commit 28f8c98 Author: Yurii Kostyukov <kostyukov.yurii@gmail.com> Date: Fri Nov 11 01:00:18 2022 +0300 [fix] Small fixes commit dd39e73 Author: Yurii Kostyukov <kostyukov.yurii@gmail.com> Date: Fri Nov 11 00:22:17 2022 +0300 [feat] Prints with trace ids commit d140272 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Wed Nov 9 17:17:52 2022 +0300 [fix] Small fix and test commit 7911dfb Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Wed Nov 9 06:47:09 2022 +0300 [feat] Rewrite GuidedSearcher, improve performance commit 010885f Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Wed Nov 9 06:44:07 2022 +0300 [fix] Add default case to `TargetCalculator::update` commit e40bd34 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Tue Nov 8 03:55:53 2022 +0300 [feat] Add `TargetCalculatorMode` option commit 12a1e44 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Mon Nov 7 21:26:42 2022 +0300 [fix] `clearMemory` calls once at run commit 188a00c Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Mon Nov 7 21:25:55 2022 +0300 [fix] Reorder initialization commit d4ca322 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Mon Nov 7 21:24:57 2022 +0300 [fix] WithPOSIXRuntime kcaller expects not void return commit 119125e Author: Yurii Kostyukov <kostyukov.yurii@gmail.com> Date: Mon Nov 7 19:24:49 2022 +0300 [fix] Small fixes commit 425be71 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Mon Nov 7 18:54:51 2022 +0300 [fix] `targetRun` finishes after reaching the target commit fdf8079 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Mon Nov 7 18:54:42 2022 +0300 [fix] Improve out of memory check commit 16b4e09 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Mon Nov 7 18:52:59 2022 +0300 [fix] Separate the case when the target is both in return and with an error commit ecd0934 Author: Yurii Kostyukov <kostyukov.yurii@gmail.com> Date: Mon Nov 7 16:25:47 2022 +0300 [fix] Small fixes and tests commit 55c9422 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Mon Nov 7 02:44:02 2022 +0300 [fix] The test should not depend on the order in which the paths are explored commit 72adc90 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Fri Oct 21 18:18:01 2022 +0300 [feat] Add read optimization commit 2ae6c4f Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Fri Oct 21 05:29:17 2022 +0300 [feat] commit afb4e0c Author: Sergey Morozov <morozov.serg901@gmail.com> Date: Sat Nov 5 03:09:58 2022 +0300 Added option for symcrete addresses, fixed test commit d568034 Author: Sergey Morozov <morozov.serg901@gmail.com> Date: Sat Nov 5 02:59:46 2022 +0300 Fixed execution states merging. commit a3ca32b Author: Sergey Morozov <morozov.serg901@gmail.com> Date: Fri Sep 23 19:19:47 2022 +0300 * Added symcretes for lazy instantiated objects: using with evaluateWithSymcretes() and evaluateConstraintsWithSymcretes(). Note, that we rely on address from malloc() and terminate execution if it returned non-appropriate address. * LazyInstantiationSource is using now only for test generation. Actual address of MemoryObject can be received via getBaseExpr() or addressExpr. * Speeded up executeMemoryOperation by changing fork() with mayBeTrue() * Remove `binding` from `Array` commit 3718525 Author: Alex Babushkin <ocelaiwo@gmail.com> Date: Fri Sep 16 17:56:56 2022 +0300 [feature] add symcretes commit 845a7a1 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Mon Nov 7 00:45:36 2022 +0300 [fix] Improve performance commit a5cb15e Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Sun Nov 6 20:15:01 2022 +0300 [fix] Erase targeted searcher after reaching of target in some cases [feat] Select searcher in random-round-robin way commit 6815014 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Wed Nov 2 04:18:37 2022 +0300 [fix] Improve WeightedQueue performance commit 305ba8e Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Sat Nov 5 02:21:07 2022 +0300 [feat] Add hash consing for `Target` and `History` commit dd949af Author: Yurii Kostyukov <kostyukov.yurii@gmail.com> Date: Sat Nov 5 17:11:53 2022 +0300 [feat] Changed JSON format commit d94dec1 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Fri Nov 4 01:47:05 2022 +0300 [feat] Check our of memory for malloc commit 66d7bd7 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Fri Nov 4 05:32:21 2022 +0300 [feat] Improve `TargetedForest::dump()` commit d22816c Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Fri Nov 4 05:00:34 2022 +0300 [fix] Improve add-remove processing commit 27c2f78 Author: Yurii Kostyukov <kostyukov.yurii@gmail.com> Date: Fri Nov 4 02:45:19 2022 +0300 [chore] Minor improvements commit 0dc0559 Author: Yurii Kostyukov <kostyukov.yurii@gmail.com> Date: Fri Nov 4 02:25:14 2022 +0300 [fix] Small fixes commit 60cbcbc Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Fri Nov 4 02:25:12 2022 +0300 [fix] Delete reached states only from existing targeted searchers commit 83d5cc2 Author: Yurii Kostyukov <kostyukov.yurii@gmail.com> Date: Fri Nov 4 02:01:00 2022 +0300 [chore] Added examples for README commit 565baae Author: Yurii Kostyukov <kostyukov.yurii@gmail.com> Date: Fri Nov 4 01:51:35 2022 +0300 [fix] Small fixes commit dd43371 Author: Yurii Kostyukov <kostyukov.yurii@gmail.com> Date: Thu Nov 3 21:44:31 2022 +0300 [feat] JSON static analysis input commit 31c42aa Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Thu Nov 3 23:40:53 2022 +0300 [FIX] DISABLE TEST BECAUSE IT BREAKS THE BUILD commit 88b129b Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Thu Nov 3 22:37:23 2022 +0300 [feat] Add `History` in `TargetetForest` Targets with different histories shouldn't be merged during a targeted search commit 6ba4a33 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Thu Nov 3 22:33:35 2022 +0300 [fix] commit a97b114 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Thu Nov 3 22:33:23 2022 +0300 [refactor] commit ce9ebec Author: Yurii Kostyukov <kostyukov.yurii@gmail.com> Date: Thu Nov 3 16:48:03 2022 +0300 [fix] Minor fixes commit aca2dbc Author: Yurii Kostyukov <kostyukov.yurii@gmail.com> Date: Thu Nov 3 16:23:52 2022 +0300 [feat] README for UTBot version commit c454c00 Author: Yurii Kostyukov <kostyukov.yurii@gmail.com> Date: Thu Nov 3 16:20:40 2022 +0300 [feat] README and small fixes commit d860087 Author: Lana243 <lana0771711@gmail.com> Date: Wed Nov 2 23:31:26 2022 +0300 Fix memory leak commit 9613d66 Author: Lana243 <lana0771711@gmail.com> Date: Wed Nov 2 18:54:21 2022 +0300 Add simple mocks for external calls commit 254faca Author: Yurii Kostyukov <kostyukov.yurii@gmail.com> Date: Thu Nov 3 12:51:45 2022 +0300 [fix] Minor fixes commit 5dc33cf Author: Yurii Kostyukov <kostyukov.yurii@gmail.com> Date: Thu Nov 3 12:04:24 2022 +0300 [chore] Reimplemented mapping between locations and targets commit 7dad44f Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Thu Nov 3 11:55:18 2022 +0300 [fix] Reduce stepTo calls commit 9a5bae3 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Wed Nov 2 23:05:35 2022 +0300 [feat] Support POSIX in ErrorGuided mode commit 2cdd752 Author: Yurii Kostyukov <kostyukov.yurii@gmail.com> Date: Wed Nov 2 12:32:52 2022 +0300 [feat] Reporting FP and FN commit 8d33954 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Wed Nov 2 00:50:50 2022 +0300 [fix] Only `TargetedSearcher` manages the targets to avoid conflicts commit dfba0f4 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Wed Nov 2 00:44:20 2022 +0300 [fix] Update constructor commit 91686bd Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Tue Nov 1 21:29:02 2022 +0300 [fix] baseSearcher can be null in an error guidance case commit a31a373 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Tue Nov 1 21:27:05 2022 +0300 [style] commit 3695def Author: Yurii Kostyukov <kostyukov.yurii@gmail.com> Date: Tue Nov 1 17:28:51 2022 +0300 [feat] Analysis source and sink arguments commit 17b47a7 Author: Yurii Kostyukov <kostyukov.yurii@gmail.com> Date: Tue Nov 1 16:40:45 2022 +0300 [fix] Removed --entry-point flag for error-guided mode commit 3696fd8 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Tue Nov 1 16:21:07 2022 +0300 [feat] Add `ErrorGuidance` mode for `GuidedSearcher` commit 10f75cd Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Tue Nov 1 14:23:47 2022 +0300 [style] commit f368509 Author: Yurii Kostyukov <kostyukov.yurii@gmail.com> Date: Tue Nov 1 12:50:37 2022 +0300 [fix] Fixed TargetForest memory management commit 3927b33 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Tue Nov 1 12:43:23 2022 +0300 [refactor] Replace a set of targets with a `TargetForest` commit 8bb8f30 Author: Yurii Kostyukov <kostyukov.yurii@gmail.com> Date: Mon Oct 31 18:40:39 2022 +0300 [feat] Linked found errors with original markings commit b59f1d2 Author: Yurii Kostyukov <kostyukov.yurii@gmail.com> Date: Sat Oct 29 12:33:06 2022 +0300 [feat] Added error guided mode - added error-guided mode flag - added TargetForest structure to be used to store input keypoint locations - added whitelist TargetForest field to ExecutionState - removed a call to `MemoryObject::deallocate() { assert(0); }` from `makeSymbolicValue` commit a30267a Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Fri Oct 28 12:31:42 2022 +0300 [feat] Take important things from the improved non-stable version commit 240e220 Author: Alex Babushkin <ocelaiwo@gmail.com> Date: Thu Oct 6 23:39:41 2022 +0600 [feat] Add CodeGraphDistance commit b03bb2e Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Thu Oct 27 20:41:48 2022 +0300 [fix] Fix calculateDistance commit 72acf63 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Thu Oct 27 21:39:38 2022 +0300 [fix] Update test commit 48042d2 Author: Alex Babushkin <ocelaiwo@gmail.com> Date: Thu Oct 6 23:38:15 2022 +0600 [feat] Add CallSplitter commit 5d34091 Author: Alex Babushkin <ocelaiwo@gmail.com> Date: Thu Oct 6 23:39:59 2022 +0600 [feat] Add WeightedQueue commit 6f5ee62 Author: Saveliy Grigoryev <grigoryev.saveliy@huawei.com> Date: Mon Oct 10 13:31:33 2022 +0300 Add support fopen commit 9a117e9 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Sat Sep 17 12:51:06 2022 +0300 [fix] Set right type for lazy instantiation [feat] Сonsider the size of the base object commit 94cc4a4 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Sun Sep 18 19:46:33 2022 +0300 [fix] Remove duplicate restrictions commit 3fa7014 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Sat Sep 3 19:51:49 2022 +0300 [feat] Revert resolve handling in executeMemoryOperation commit 2d00585 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Fri Sep 2 13:05:43 2022 +0300 [feat] Improve perfomance commit 403361b Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Thu Sep 1 14:51:12 2022 +0300 [feat] Track only function from main module commit 4c5cba8 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Mon Aug 29 19:24:15 2022 +0300 [test] Show elapsed wall time for each test commit 5bc0312 Author: Sergey Morozov <morozov.serg901@gmail.com> Date: Wed Aug 31 14:58:33 2022 +0300 Added constaints for pointers: for alignment and size of underlying objects. Fixed type creation for C++ types, fixed tests for types and added for alignment. commit 40e004c Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Tue Aug 23 14:04:31 2022 +0300 [feat] Improve getAddressInfo commit d1b2235 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Tue Aug 23 13:54:13 2022 +0300 [fix] base can be concrete commit 4a5dae7 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Fri Aug 26 10:21:01 2022 +0300 [fix] Fix iterator dereferencing over last block in a function commit 9bf58f3 Author: Mikhail <mishok2503@mail.ru> Date: Wed Jun 8 16:36:28 2022 +0300 Inline asm external call (cherry picked from commit 99c522b) commit 5eb8a21 Author: Sergey Morozov <morozov.serg901@gmail.com> Date: Fri Aug 26 16:21:40 2022 +0300 Fixed __ctype_b_loc type and removed fix for skipped objects. commit 8c27bd6 Merge: 4a5230b acaaab0 Author: Sergey Morozov <50552659+getN1ght@users.noreply.github.com> Date: Wed Aug 24 19:03:24 2022 +0300 Merge pull request klee#30 from UnitTestBot/typed-klee commit acaaab0 Author: Sergey Morozov <morozov.serg901@gmail.com> Date: Wed Aug 17 18:45:29 2022 +0300 Added tests. commit 10320fd Author: Sergey Morozov <morozov.serg901@gmail.com> Date: Tue Aug 23 18:46:17 2022 +0300 Added type system support for C and (partially) C++ languages. commit 6826541 Author: Sergey Morozov <morozov.serg901@gmail.com> Date: Tue Aug 23 18:40:42 2022 +0300 Integrated type system. ObjectStates own type of memory, that they hold, as type can be changed dynamically, e.g. during first write into malloc'ed memory. commit ec8aa20 Author: Sergey Morozov <morozov.serg901@gmail.com> Date: Mon Aug 22 17:25:18 2022 +0300 Implemented classes for types in type system. Added handling TypeManager entity, that can create such these KType's. commit 4a5230b Author: Vladislav Kalugin <kalugin.vladislav@huawei.com> Date: Mon Aug 22 16:53:30 2022 +0300 Change UB to error type commit b2e8b2a Author: Mikhail <mishok2503@mail.ru> Date: Sat Jul 2 19:22:35 2022 +0300 add constraint commit 92cebf4 Author: Saveliy Grigoryev <grigoryev.saveliy@huawei.com> Date: Thu Jul 28 12:59:21 2022 +0300 Add support stdin/stdout with interactive mode Implement getc, fgetc, fread, fgets, getchar, gets, putc, fputc, fwrite, fputs, putchar, puts commit 93297b5 Author: Saveliy Grigoryev <grigoryev.saveliy@huawei.com> Date: Tue Jul 26 16:24:27 2022 +0300 Add TimeoutPerTest for generation tests for project commit 3f67f2f Author: Pavel <operasfantom@gmail.com> Date: Sun Mar 20 01:13:04 2022 +0400 Fix typo commit 8e9d770 Author: Pavel <operasfantom@gmail.com> Date: Sun Mar 20 00:47:54 2022 +0400 Add intrinsic replacement for 'sqrt' commit a1f0a64 Author: Saveliy Grigoryev <grigoryev.saveliy@huawei.com> Date: Tue Jul 26 16:05:54 2022 +0300 Add interactive mode commit c202ef6 Author: Saveliy Grigoryev <grigoryev.saveliy@huawei.com> Date: Thu Jul 21 18:10:53 2022 +0300 Set pointers on lazy and symbolic variables commit 2cb3c46 Author: Saveliy Grigoryev <grigoryev.saveliy@huawei.com> Date: Tue Jul 26 12:35:08 2022 +0300 Several fixes for utbot commit c259384 Author: Saveliy Grigoryev <grigoryev.saveliy@huawei.com> Date: Thu Jul 21 12:59:55 2022 +0300 Added possibility of installing as a library and launching as a function commit 6b32563 Author: Saveliy Grigoryev <grigoryev.saveliy@huawei.com> Date: Thu Jul 21 12:48:48 2022 +0300 Add timeouts commit 2ec8d94 Author: Saveliy Grigoryev <grigoryev.saveliy@huawei.com> Date: Mon Jul 25 21:01:41 2022 +0300 Prepared KLEE for launching it with POSIX runtime. Added symbolic variable for stdin buffer size to ktests. Disabled tests for now broken klee-replay and klee-zesti (unused). commit df00157 Author: Saveliy Grigoryev <grigoryev.saveliy@huawei.com> Date: Mon Jul 25 18:35:22 2022 +0300 Integrate sanitizer commit 440bccb Author: Saveliy Grigoryev <grigoryev.saveliy@huawei.com> Date: Mon Jul 25 11:48:55 2022 +0300 KLEE floating-point support. The implementation is based on KLEE-float. Supported llvm math intrinsic functions related to floating-point. Added ENABLE_FP and FP_RUNTIME options to CMake. Provided an ability to switch between Z3Builder implementations. Building KLEE without -DCMAKE_ENABLE_FLOATING_POINT does not change the core. Changed scripts and github actions to launch fp-tests commit ab89c36 Author: Saveliy Grigoryev <grigoryev.saveliy@huawei.com> Date: Sat Jul 23 13:22:25 2022 +0300 Add build script, add github actions and fix tests commit eb51e43 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Thu Aug 6 11:17:10 2020 +0300 [feat] Add distance-based TargetedSearcher and GuidedSearcher [feat] Add lazy instantiation [fix] Fixed GEPExpr lazy instantiation handler [fix] Included llvm::format in header [fix] Fixed memory leak [fix] Added KCallBlock destructor [fix] Fixed POSIX CMakeList [test] Disable msan for the test because it times out on CI fix unclosed files [fix] base cannot be ConstantExpr commit eaa5f23 Author: Alex Babushkin <ocelaiwo@gmail.com> Date: Mon Dec 26 16:01:50 2022 +0500 [tempfix] Write addresses of MOs in KTest commit 9e95780 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Thu Sep 29 16:54:33 2022 +0300 [feat] Add check instruction coverage [feat] Add releaseStates commit 26c2f5c Author: Saveliy Grigoryev <sava-cska@mail.ru> Date: Wed Dec 14 02:56:10 2022 +0300 Add support fopen and add counter of read/write bytes in files commit 625e8d3 Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Fri Aug 26 10:21:01 2022 +0300 [fix] Fix iterator dereferencing over last block in a function commit 1482d4c Author: Mikhail <mishok2503@mail.ru> Date: Wed Jun 8 16:36:28 2022 +0300 Inline asm external call (cherry picked from commit 99c522b) commit c4cc6ad Author: Mikhail <mishok2503@mail.ru> Date: Sat Jul 2 19:22:35 2022 +0300 add constraint commit 61f3dc1 Author: Saveliy Grigoryev <sava-cska@mail.ru> Date: Wed Dec 14 02:27:09 2022 +0300 Add support stdin/stdout with interactive mode Implement getc, fgetc, fread, fgets, getchar, gets, putc, fputc, fwrite, fputs, putchar, puts commit e6c4bc5 Author: Saveliy Grigoryev <sava-cska@mail.ru> Date: Wed Dec 14 02:12:37 2022 +0300 Add TimeoutPerTest for generation tests for project commit 869df9b Author: Pavel <operasfantom@gmail.com> Date: Sun Mar 20 01:13:04 2022 +0400 Fix typo commit dbe5556 Author: Pavel <operasfantom@gmail.com> Date: Sun Mar 20 00:47:54 2022 +0400 Add intrinsic replacement for 'sqrt' commit b720f61 Author: Saveliy Grigoryev <sava-cska@mail.ru> Date: Wed Dec 14 02:09:26 2022 +0300 Add interactive mode commit b9014a4 Author: Saveliy Grigoryev <grigoryev.saveliy@huawei.com> Date: Tue Jul 26 12:35:08 2022 +0300 Several fixes for utbot commit 629639f Author: Saveliy Grigoryev <grigoryev.saveliy@huawei.com> Date: Thu Jul 21 12:59:55 2022 +0300 Added possibility of installing as a library and launching as a function commit 31e354a Author: Saveliy Grigoryev <grigoryev.saveliy@huawei.com> Date: Thu Jul 21 12:48:48 2022 +0300 Add timeouts commit 3a92ea4 Author: Alex Babushkin <ocelaiwo@gmail.com> Date: Tue Dec 6 15:53:58 2022 +0500 Prepared KLEE for launching it with POSIX runtime. Added symbolic variable for stdin buffer size to ktests. Disabled tests for now broken klee-replay and klee-zesti (unused). commit 426751c Author: Saveliy Grigoryev <sava-cska@mail.ru> Date: Wed Dec 14 01:43:38 2022 +0300 Integrate sanitizer commit 8a9dede Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Tue Jan 24 06:50:10 2023 -0800 [fix] KLEE floating-point support Use `createCachedExpr` commit 84cdccd Author: Saveliy Grigoryev <sava-cska@mail.ru> Date: Wed Dec 14 01:30:49 2022 +0300 KLEE floating-point support. The implementation is based on KLEE-float. Supported llvm math intrinsic functions related to floating-point. Added ENABLE_FP and FP_RUNTIME options to CMake. Provided an ability to switch between Z3Builder implementations. Building KLEE without -DCMAKE_ENABLE_FLOATING_POINT does not change the core. Changed scripts and github actions to launch fp-tests. commit a505283 Author: Saveliy Grigoryev <sava-cska@mail.ru> Date: Wed Dec 14 01:24:49 2022 +0300 Add build script and github action commit 9b6cc5d Author: Aleksandr Misonizhnik <misonijnik@gmail.com> Date: Wed Feb 1 06:15:46 2023 -0800 [fix] Consider all symbolic pointers during `setInitializationGraph`
Take concrete input file (numbers.txt):
and program (open.c):
Compile this to llvm bitcode and try to run this is KLEE
$ llvm-gcc --emit-llvm open.c -o open.bc
$ klee --posix-runtime --libc=uclibc open.bc numbers.txt
KLEE will output the following and then hang:
It appears that that KLEE is stuck in the JIT
This was an issue I noticed a while ago and a recent mailing list post ( http://www.mail-archive.com/klee-dev@imperial.ac.uk/msg01259.html ) reminded me of this.
Uclibc seems to provide fscanf so I'm not quite sure why KLEE is trying to call fscanf externally. I unfortunately do not have time to investigate now.
The text was updated successfully, but these errors were encountered: