File: README.md

package info (click to toggle)
tinysparql 3.11.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 24,528 kB
  • sloc: ansic: 119,209; python: 6,139; javascript: 725; sh: 121; perl: 106; xml: 67; makefile: 31; sql: 1
file content (49 lines) | stat: -rw-r--r-- 1,964 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
Fuzz targets used by [oss-fuzz](https://github.com/google/oss-fuzz/).

## How to add new targets

Add **fuzz_target_name.c** and edit `meson.build` accordingly.

New targets are picked up by oss-fuzz automatically within a day. Targets must not be renamed once added.

Add (optional) **fuzz_target_name.dict** containing keywords and magic bytes.

Add (optional) **fuzz_target_name.corpus** with file names on separate lines. Wildcards `?`, `*` and `**` are supported. Examples below.

```bash
tests/*  # all files in directory tests
tests/** # all files in directory tests and sub-directories
**.rq # all files ending with .rq in the repository
```

Recommended reading: [Fuzz Target](https://llvm.org/docs/LibFuzzer.html#fuzz-target), [Dictionaries](https://llvm.org/docs/LibFuzzer.html#dictionaries), [Corpus](https://llvm.org/docs/LibFuzzer.html#corpus)

## How to reproduce oss-fuzz bugs locally

Build with at least the following flags, choosing a sanitizer as needed. A somewhat recent version of [clang](http://clang.llvm.org/) is recommended.

```bash
$ CC=clang CXX=clang++ meson DIR -Db_sanitize=<address|undefined> -Db_lundef=false
```

Afterwards run the affected target against the provided test case.

```bash
$ DIR/fuzzing/fuzz_target_name FILE
```

#### FAQs

###### What about Memory Sanitizer (MSAN)?

Correct MSAN instrumentation is [difficult to achieve](https://clang.llvm.org/docs/MemorySanitizer.html#handling-external-code) locally, so false positives are very likely to mask the actual bug.

If need be, [you can still reproduce](https://google.github.io/oss-fuzz/advanced-topics/reproducing/#building-using-docker) those bugs with the oss-fuzz provided docker images.

###### There are no file/function names in the stack trace.

`llvm-symbolizer` must be in `PATH`.

###### UndefinedBehavior Sanitizer (UBSAN) doesn't provide a stack trace.

Set environment variable `UBSAN_OPTIONS` to `print_stacktrace=1` prior to running the target.