Age | Commit message (Collapse) | Author |
|
This was executing the loop when n==0 leading to an out of bound pointer
error.
Found while verifying Rust code that compares strings.
|
|
|
|
|
|
|
|
|
|
Co-authored-by: Felix Rath <felix.rath@comsys.rwth-aachen.de>
|
|
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>
|
|
|
|
with a test case.
|
|
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.
|
|
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++.
|
|
|
|
|
|
|
|
to function names.
|
|
|
|
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.
|
|
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.
|
|
|
|
|
|
|
|
|
|
consistent naming convention
|
|
|
|
|
|
|
|
|
|
|
|
Otherwise optimizations done in klee won't have any effect.
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
|
|
* also adds klee-replay as dependency for systemtests
|
|
add a corresponding check.
|
|
test.
|
|
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.
|
|
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.
|
|
klee_make_symbolic. Changed a test case to check this feature.
|
|
|
|
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.
|
|
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.
|
|
|
|
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
|
|
options. Make klee_abort() call abort() in replay, and removed trivial test which cannot be easily integrated into the test suite.
|
|
corresponding tests
|
|
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.
|
|
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.
|
|
This was introduced when we added the --readable-posix-inputs option.
|
|
|
|
provide a better error message (and stop earlier) when no C source
files are found.
|
|
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.
|
|
to clean the runtime build.
Unfortuantely there is no way to have the `clean` target trigger the
`clean_runtime` target unfortunately.
|
|
`ExternalProject_Add_Step()` so that when using Ninja the output of the
bitcode build system is shown immediately.
|