Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jwilk/detsan
determinism sanitizer
https://github.com/jwilk/detsan
fuzzing qa security
Last synced: about 20 hours ago
JSON representation
determinism sanitizer
- Host: GitHub
- URL: https://github.com/jwilk/detsan
- Owner: jwilk
- License: mit
- Created: 2017-10-22T16:19:48.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-11-13T20:39:19.000Z (2 months ago)
- Last Synced: 2024-11-25T13:51:50.327Z (2 months ago)
- Topics: fuzzing, qa, security
- Language: Python
- Size: 34.2 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
- License: LICENSE
Awesome Lists containing this project
README
Overview
========**detsan** leverages `clang's code coverage instrumentation
`_
to help you find sources of non-determinism in C (or C++) programs... code:: console
$ cat -n target.c
1 #include
2 #include
3
4 int main(int argc, char **argv)
5 {
6 FILE *fp = fopen("/dev/urandom", "r");
7 if (fp == NULL)
8 abort();
9 unsigned int v;
10 size_t r = fread(&v, sizeof v, 1, fp);
11 if (r != 1)
12 abort();
13 if (v & 1U)
14 puts("Looks like an odd number to me!");
15 else
16 puts("An even number? How quaint!");
17 fclose(fp);
18 return 0;
19 }$ clang -g -fsanitize-coverage=trace-pc-guard -fsanitize=address target.c -o target
$ detsan ./target
+ /path/to/target.c:16:9 (main)
- /path/to/target.c:14:9 (main)Prerequisites
=============* Python ≥ 3.6
* Clang ≥ 4.0
.. vim:ft=rst ts=3 sts=3 sw=3 et