about summary refs log tree commit diff homepage
path: root/runtime
AgeCommit message (Collapse)Author
2020-08-07New intrinsic: klee_is_replayAlastair Reid
This instrinsic detects whether the program is being executed symbolically or concretely (i.e., using the libkleeRuntest library). The intended usage (illustrated in the test program) is to allow the test program to display the input values by invoking any libraries it wants to. This is especially valuable if you are constructing complex, structured values and for languages like Rust (or C++) that have rich libraries and print libraries. For example, you might pick a symbolic value N with the assumption "0 <= N < 10" and then pick N symbolic values and write them to an array. The resulting ktest file is a bit hard to understand compared with the output of the standard print function in Rust/C++.
2020-04-30Removed the Internal directory from include/kleeCristian Cadar
2020-04-09[posix-runtime] Improve model to handle full-path symbolic filesTimotej Kapus
2020-03-22[posix-runtime] Simple GET/SET_LK modelTimotej Kapus
2019-11-09Compile fd_64.c file of POSIX runtime correctly on FreeBSD - append "64" suffixGleb Popov
to function names.
2019-11-07Allow main with 3 argumentsCristian Cadar
2019-11-05Do not modify strings if they are read-only.Martin Nowack
Hoist increment of `sc` into the loop header. Memory locations can only be written to if they are writeable. Avoid concretising a value by writing it. If the location is not symbolic in the first place. This avoids writing read-only memory locations.
2019-11-05runtime: fix for glibc 2.30Jiri Slaby
glibc 2.30 moved definition of getdents64 to dirent_ext.h. Hence, it became visible to us (via dirent.h) and conflicts with our definition: runtime/POSIX/fd_64.c:112:5: error: conflicting types for 'getdents64' int getdents64(unsigned int fd, struct dirent *dirp, unsigned int count) { ^ /usr/include/bits/dirent_ext.h:29:18: note: previous declaration is here extern __ssize_t getdents64 (int __fd, void *__buffer, size_t __length) We use the parameters defined by kernel, not by userspace (libc). Both glibc and uclibc define it as: ssize_t __getdents64 (int fd, char *buf, size_t nbytes) so follow it.
2019-10-31klee-libc: add bcmpJulian Büning
2019-08-01gen(-random)-bout: add --bout-file flagFrank Busse
2019-07-30Use #include "klee/..." (instead of #include <klee/...>) consistently.Cristian Cadar
2019-06-04make include guard naming consistentJulian Büning
2019-06-04Fixed identifiers used in ifdefs to (1) not use reserved names and (2) use a ↵Cristian Cadar
consistent naming convention
2019-05-06Fix compilation of POSIX runtime on FreeBSD 11.Gleb Popov
2019-05-06Fix build of POSIX runtime on FreeBSD i386.Gleb Popov
2019-04-29More FreeBSD related fixes to POSIX runtime.Gleb Popov
2019-04-02POSIX runtime fixes for FreeBSD.Gleb Popov
2019-03-17Added libcxx flagLukas Wölfer
2018-10-26llvm5: test, add -disable-O0-optnone to -O0Jiri Slaby
Otherwise optimizations done in klee won't have any effect. Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
2018-10-08add support for klee-replay on OSXFrank Busse
* also adds klee-replay as dependency for systemtests
2018-09-29Changed code to create up to 100 properly-numbered symbolic arguments, and ↵Cristian Cadar
add a corresponding check.
2018-09-29Add checks for correct usage of the POSIX model, together with an associated ↵Cristian Cadar
test.
2018-09-10POSIX: Add invocation of klee_init_env into wrapper before calling mainMartin Nowack
To enable the POSIX support, the former implementation instrumented the main function and inserted a call to `klee_init_env` at the beginning. This has multiple disadvantages: * debugging information was not correctly propagated leaving the call to `klee_init_env` without debug information * the main function always required `int arg, char**` as part of the function definition of `main` Based on the new linking infrastructure, we can now add an additional wrapper `__klee_posix_wraper(int, char**)` that gets always called when POSIX support is enabled. It executes `klee_init_env` and after that calls the `main` function. Enabling POSIX support only requires the renaming of the user provided `main` into `__klee_posix_wrapped_main` in addition to linking.
2018-09-06runtime: fix memory error in canonicalize_file_nameFrank Busse
Fixes #46 and reverts #47. As stated in #46, the solution works for musl, glibc etc. However, the code in stub.c is executed by uclibc and uclibc doesn't allocate the target buffer in realpath. The memory error occured while running df for 10min with DFS.
2018-08-03Fixed runtest library to handle the case of a NULL "name" argument in ↵Cristian Cadar
klee_make_symbolic. Changed a test case to check this feature.
2018-07-04runtime: remove obsolete code for building modules instead of archivesJulian Büning
2018-07-04Reorder linking and optimizationsMartin Nowack
Link intrinsic library before executing optimizations. This makes sure that any optimization run by KLEE on the module is executed for the intrinsic library as well. Support .ll files as input for KLEE as well.
2018-07-04Reorganise runtime libraries provided by KLEEMartin Nowack
Strictly differentiate between the following type of libraries: * FreeStanding: contains minimal amount of methods a compiler would expect * klee-libc: contains a minimal libc implementation * POSIX: contains a POSIX layer that can be used on top of a libc implementation * Intrinsic: contains additional runtime functions which provide KLEE-specific functionalities, (e.g. checks) Builds always archives instead of single modules. This allows to reduce linked-in dependencies of tested applications.
2018-05-07Fixed utimes() behavior for symbolic files when the second argument is NULLyxliang01
2018-05-05Fix handling of errno if external functions are invokedMartin Nowack
If an external function in KLEE is invoked, it might update errno. Previously, the errno specific variable in a state was only updated if it was part of the executed instructions. That opened up a timeframe that increased the likelihood of errno being overwritten by another method call. This patch fixes two issues: * the errno of the KLEE process state is updated before the external function call allowing to detect changes to it later on * after the external call, the memory object of errno is directly updated with its new value, reducing the likelihood to be overwritten by another call Additional features: * Add support for `errno()` for Darwin as well. * Simplified errno handling in POSIX layer
2018-05-01Ensured program reliably has 3 paths to be explored, and removed unnecessary ↵Cristian Cadar
options. Make klee_abort() call abort() in replay, and removed trivial test which cannot be easily integrated into the test suite.
2018-05-01Implement klee_prefer_cex() and klee_abort() in Runtest and added ↵lyxia
corresponding tests
2017-10-04[CMake] Add global clean target `clean_all`. Fixes #718.Dan Liew
This target invokes the `clean` target but is also intended for use by other cleaning targets. The `clean_runtime` target is now declared as a dependency of `clean-all` so that the runtime is cleaned as well.
2017-10-04Remove Autoconf/Makefile build system and adjust the TravisCIDan Liew
configuration, TravisCI scripts and Dockerfile build appropriately. There are a bunch of clean ups this enables but this commit doesn't attempt them. We can do that in future commits.
2017-08-09Fixed a bug causing KLEE to generate files with no permissions bits set. ↵Cristian Cadar
This was introduced when we added the --readable-posix-inputs option.
2017-07-24Moved klee_choose from klee-libc to KLEE intrinsics.Cristian Cadar
2017-07-24[CMake] Add a sanity check to the runtime build system so that weDan Liew
provide a better error message (and stop earlier) when no C source files are found.
2017-07-24[CMake] Fix bug where the runtime build system would not rebuild bitcodeDan Liew
archive/modules when the list of source files that constitute it changes. To fix this a file is written in the build directory that contains the list of `.bc` files. This file is updated whenever the list of `.bc` files for a module changes and then the rule that builds the module/archive depends on that file. This fixes a bug reported by @ccadar in #718.
2017-03-30[CMake] Add the `clean_runtime` top level target to provide an easy wayDan Liew
to clean the runtime build. Unfortuantely there is no way to have the `clean` target trigger the `clean_runtime` target unfortunately.
2017-03-30[CMake] When supported pass `USES_TERMINAL` argument toDan Liew
`ExternalProject_Add_Step()` so that when using Ninja the output of the bitcode build system is shown immediately.
2017-03-30[CMake] Fix #631Dan Liew
This fixes a bug in the bitcode build system where the build would fail if the build directory was a symbolic link (i.e. create a symbolic link for the root of the build tree and try to do the build in that directory). The problem was that `DIR_SUFFIX` implicitly assumed that there was only one way to refer to the build tree which is an incorrect assumption in the presence of symbolic links. This has been fixed by using the `$(realpath)` GNU make built in to resolve all symbolic links. An additional sanity check has been added to check that `SRC_DIR` exists.
2017-03-28Merge pull request #616 from jirislaby/glibc_225Cristian Cadar
runtime: POSIX, make it compile with glibc 2.25
2017-03-20runtime: POSIX, check path prior dereferenceJiri Slaby
clang warns about check-after-use in POSIX runtime: runtime/POSIX/fd.c:573:17: warning: nonnull parameter 'path' will evaluate to 'true' on first r [-Wpointer-bool-conversion] (path ? __concretize_string(path) : NULL), ^~~~ ~ path is dereferenced in __get_sym_file before this check. So add a check to __get_sym_file and handle NULL appropriatelly by returning NULL too. Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
2017-03-15runtime: POSIX, make it compile with glibc 2.25Jiri Slaby
With glibc 2.25, we see: runtime/POSIX/stubs.c:243:14: error: conflicting types for 'gnu_dev_major' unsigned int gnu_dev_major(unsigned long long int __dev) __attribute__((weak)); ^ /usr/include/sys/sysmacros.h:79:27: note: previous definition is here __SYSMACROS_DEFINE_MAJOR (__SYSMACROS_IMPL_TEMPL) ^ Glibc 2.25 switched from ULL to dev_t for gnu_dev_major, gnu_dev_minor, and gnu_dev_makedev. Handle by using an appropriate type according to the glibc version. Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
2017-02-13Merge pull request #506 from delcypher/travis_asan_ubsanCristian Cadar
Modify scripts and a test to allow ASan/UBSan builds.
2017-02-11[CMake] More widely available rebuilding for runtimesLevente Kurusa
Signed-off-by: Levente Kurusa <levex@linux.com>
2017-01-19In legacy build system fix building libkleeRuntest when buildingDan Liew
with ASan.
2017-01-14Change how error handling is done in libkleeRuntest.Dan Liew
Previously error messages would be emitted but execution would continue which might not be desirable. Now a wrapper function (for fprintf) `report_internal_error()` is used which will cause the program to exit. The older behaviour of continuing to execute after an error can be achieved by setting a new environment variable `KLEE_RUN_TEST_ERRORS_NON_FATAL`. This commit also adds a test for each error case.
2017-01-14Fix bug reported privately by @danielschemmel .Dan Liew
If KLEE generates ktest files with `--posix-runtime` then if replaying using libkleeRuntest then replay would be incorrect because the `model_version` object would be unintentionally used during replay. For now just skip over that object and try the next one. Also emit a warning if the object names don't match.
2017-01-14Write tests to test `libkleeRuntest`. The `replay_posix_runtime.c`Dan Liew
test is marked XFAIL because there is a bug in the implementation of `libkleeRuntest`. Quite a few changes had to be made to the lit configuration in order to support these tests. To run the tests I had to fix #480 for the autoconf/Makefile build system otherwise the `libkleeRuntest` library would not be found by the system linker at runtime.