c4-project / c4f

The C4 Concurrent C Fuzzer
MIT License
14 stars 1 forks source link
c11 concurrency fuzzer litmus testing

c4f: the C4 fuzzer

Main workflow

c4f (previously known as act) is a 'fuzzer' over C litmus tests of a format broadly compatible with that produced by memalloy and consumed by herdtools7. It takes initial litmus tests, and performs transformations to them that complicate their compilation while (hopefully!) preserving the soundness of the initial test's postcondition.

Other parts of the C4 project include:

Licence and Acknowledgements

Included programs

c4f consists of two programs:

Each command has various subcommands, including the help command: for example, c4f help will tell you information about which subcommands the fuzzer has.

Building and running

NOTE: c4f uses Jane Street's core library, which only works properly on POSIX-style operating systems. If you're using Windows, consider using WSL, or Cygwin, etc.

There are two main ways to build and run c4f:

You can also manually build c4f using dune build, or make (which just calls the former).

Preparation

c4f optionally accepts a configuration file listing fuzzer parameters. If you're using c4t, it sets up the configuration itself; if not, check c4f.conf.example for an idea of what goes in such a file, and use -config PATH to supply one.

Basic usage

To test whether c4f is installed and working, you can try:

$ git clone https://github.com/c4-project/c4-corpora /path/to/corpora
$ c4f run /path/to/corpora/partialSC/small/test_8.litmus

(or dune exec c4f -- run, per above)

This should output some truly horrendous C to stdout. (You can experiment with the other test_X.litmus files in that directory, supply your own Litmus test, or add -o path.litmus to write to a file.)