about summary refs log tree commit diff homepage
path: root/runtime
AgeCommit message (Collapse)Author
2022-01-04Use more precise version check for selecting swapoff() signature.Gleb Popov
2021-12-24Added correct signature for swapoff on FreeBSD (to solve recent CI failures)Cristian Cadar
2021-04-30posix runtime: add malloc checksFrank Busse
2021-02-22runtime/POSIX: fix failures with glibc-2.33Jiri Slaby
commit 8ed005daf0ab of glibc-2.33 (Remove stat wrapper functions, move them to exported symbols) removed renames of `__fxstat`, `__xstat`, and `__lxstat` to `__fxstat64`, `__xstat64`, and `__lxstat64`, respectively. But we relied on the renames to build `fd_64.c` properly. With glibc 2.33, we now see link failures of the POSIX runtime: error: Linking globals named '__xstat': symbol multiply defined! Rename the functions using `__REDIRECT_NTH` in the code as `__USE_FILE_OFFSET64` case (which we define at the top of the file by `#define _FILE_OFFSET_BITS 64`) did exactly that. Fixes #1384.
2020-12-23posix runtime: getcwd: check malloc and set errnoFrank Busse
* failing malloc was not handled before, now returns null/ENOMEM * when path is non-null and size is zero return null/EINVAL
2020-12-23klee-libc: simplify mempcpyFrank Busse
2020-12-23posix runtime: remove dead branchFrank Busse
2020-12-18fix cflags for runtime build typesJulian Büning
- `-DNDebug` -> `-DNDEBUG` - different flags for `Release{+Debug,}+Asserts` - `-g` is no longer part of common flags - `-D_DEBUG` is now only set for debug builds - removed unused `LIB_BC_FLAGS_{32,64}` - added example, architecture prefix for specific flags
2020-12-04Only build 32bit runtime libraries if supported by platformMartin Nowack
Automatically detect if 32bit bitcode files can be built. In this case, build runtime library with 32bit as well.
2020-12-04Declare mempcpy on macOS, to silence compiler warningsCristian Cadar
2020-11-09Added fortified library (for -D_FORTIFY_SOURCE), to be linked when uclibc is ↵Cristian Cadar
used.
2020-11-09Added fortified versions for the functions in the klee-libc libraryCristian Cadar
2020-11-09Since the runtime now contains fortified libc functions, it is important to ↵Cristian Cadar
compile it with -D_FORTIFY_SOURCE=0 to avoid infinite recursion.
2020-11-09Added fortified versions for the functions in the freestanding library.Cristian Cadar
2020-11-04Rename FreeStanding to Freestanding where appropriateMartin Nowack
2020-11-04[cmake] Add support to generate arbitrary runtime library configurationsMartin Nowack
Every runtime library can be build with multiple configurations. Replace the Makefile-based setup by cmake one. Currently, we generate 32bit and 64bit libraries simultaneously and can link against them.
2020-11-03fix: bcmp with n==0Alastair Reid
This was executing the loop when n==0 leading to an out of bound pointer error. Found while verifying Rust code that compares strings.
2020-10-30Call functions in __cxa_atexit in reverse orderTomas Jasek
2020-10-12address MartinNowack's remaining feedbackJulian Büning
2020-10-12Exception handling only for LLVM >= 8.0.0Julian Büning
2020-10-12fix cxa_exception include for older LLVM versionsJulian Büning
2020-10-12fix building klee-cxxabiJulian Büning
Co-authored-by: Felix Rath <felix.rath@comsys.rwth-aachen.de>
2020-10-12Implemented support for C++ ExceptionsFelix Rath
We implement the Itanium ABI unwinding base-API, and leave the C++-specific parts to libcxxabi. Co-authored-by: Lukas Wölfer <lukas.woelfer@rwth-aachen.de>
2020-10-06Ran clang-format on intrinsics.c and removed unneeded commentCristian Cadar
2020-10-06Added support for klee_open_merge and klee_close_merge in replay, together ↵Cristian Cadar
with a test case.
2020-08-28Definition of __cxa_thread_atexit_impl for the KLEE libc.Alastair Reid
This is a thread-local version of __cxa_atexit (but, in the absence of threads, it is sufficient to just call __cxa_atexit). The test is based on the existing test for atexit in test/Runtime/Uclibc/2008-03-04-libc-atexit-uses-dso-handle.c The motivation for adding this function is to support the Rust standard library that calls __cxa_thread_atexit_impl. This function is usually a weak symbol but, in KLEE, this behaves like a call to an unknown function and chaos ensues. Worse, it happens just as the program is cleanly shutting itself down, so programs that are cleanly exiting crash with the wrong message.
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.