# introduce a web interface for fuzzing · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/e0ffac4e3c2271a617616760f3084f5f01fb0785)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: e0ffac4e3c2271a617616760f3084f5f01fb0785

Requested commit: e0ffac4e3c2271a617616760f3084f5f01fb0785

Commit: e0ffac4e3c2271a617616760f3084f5f01fb0785

Tree: 5769c9280878ebb3cc5f76345cf00050012e8198

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
introduce a web interface for fuzzing

* new .zig-cache subdirectory: 'v'
  - stores coverage information with filename of hash of PCs that want
    coverage. This hash is a hex encoding of the 64-bit coverage ID.
* build runner
  * fixed bug in file system inputs when a compile step has an
    overridden zig_lib_dir field set.
  * set some std lib options optimized for the build runner
    - no side channel mitigations
    - no Transport Layer Security
    - no crypto fork safety
  * add a --port CLI arg for choosing the port the fuzzing web interface
    listens on. it defaults to choosing a random open port.
  * introduce a web server, and serve a basic single page application
    - shares wasm code with autodocs
    - assets are created live on request, for convenient development
      experience. main.wasm is properly cached if nothing changes.
    - sources.tar comes from file system inputs (introduced with the
      `--watch` feature)
  * receives coverage ID from test runner and sends it on a thread-safe
    queue to the WebServer.
* test runner
  - takes a zig cache directory argument now, for where to put coverage
    information.
  - sends coverage ID to parent process
* fuzzer
  - puts its logs (in debug mode) in .zig-cache/tmp/libfuzzer.log
  - computes coverage_id and makes it available with
    `fuzzer_coverage_id` exported function.
  - the memory-mapped coverage file is now namespaced by the coverage id
    in hex encoding, in `.zig-cache/v`
* tokenizer
  - add a fuzz test to check that several properties are upheld

```

## Parents

- [ffc050e0557c5d951cd293ca365ed0cd3cdf83db](https://git.cafe/gitcafe/zig/commit/ffc050e0557c5d951cd293ca365ed0cd3cdf83db?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/e0ffac4e3c2271a617616760f3084f5f01fb0785?format=markdown)
