https://github.com/agroce/deepstate-c-blosc2
DeepState harness to test CBlosc2 compression library
https://github.com/agroce/deepstate-c-blosc2
Last synced: over 1 year ago
JSON representation
DeepState harness to test CBlosc2 compression library
- Host: GitHub
- URL: https://github.com/agroce/deepstate-c-blosc2
- Owner: agroce
- Created: 2019-12-04T18:31:19.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-02-23T15:23:44.000Z (over 5 years ago)
- Last Synced: 2025-01-19T13:31:08.400Z (over 1 year ago)
- Language: C++
- Size: 12 MB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
The test harness + Makefile will allow you to test
[CBlosc-2](https://github.com/Blosc/c-blosc2) and the original
[CBlosc](https://github.com/Blosc/c-blosc) using
- DeepState's built-in brute force fuzzer
- AFL
- libFuzzer
- Eclipser (seems Eclipser/QEMU causes some spurious fails that don't reproduce, but still generates interesting tests)
It also can make use of [swarm testing](https://agroce.github.io/issta12.pdf).
The Makefile expects that:
- you installed everything in `install` under the cblosc[2] dir
- for AFL, you built c-blosc2 using `CC=afl-clang CXX=afl-clang++ cmake -DCMAKE_INSTALL_PREFIX=../install ..`
- for libFuzzer, you built c-blosc2 using `CC=clang CXX=clang++ CFLAGS=-fsanitize=fuzzer-no-link CXXFLAGS=-fsanitize=fuzzer-no-link cmake -DCMAKE_INSTALL_PREFIX=../install ..`
and copied the resulting library `.a` files to appropriately named
files (see the Makefile). Running `source getbloscs.sh` should, in
the DeepState docker environment, do all these things for you. This
will take a while, due to compilation of some compressors being very
slow with sanitizers.
Tests are binary compatible (in fact use the same harness, with
very small code changes) between the c-blosc versions, which means
original c-blosc tests read some pointless bytes to set delta.
You can get started fuzzing with just a few commands:
```
$ git clone https://github.com/trailofbits/deepstate.git
$ cd deepstate
$ docker build -t deepstate . -f docker/Dockerfile
$ docker run -it deepstate bash
```
In the docker do:
```
$ git clone https://github.com/agroce/deepstate-c-blosc2.git
$ cd deepstate-c-blosc2
$ source getbloscs.sh
$ make
$ ./testcblosc2 --fuzz --timeout 100
```
The pre-computed tests can be run like this:
```
$ ./testcblosc2 --input_test_files_dir reduced_LF_novalue_corpus_testcblosc2 --no_fork
```
See https://github.com/trailofbits/deepstate for more on DeepState.