Integrate Slipcover to Atheris
- Dominant language
- Python
- Stars
- 1.7k
- Forks
- 127
- PR merge metrics
- No merged PRs in 30d
Description
From the beginning, Atheris used [^1] `sys.settrace`-like instrumentation, same instrumentation used in `Coverage.py` ([^2], [^3]):
> Atheris is a native Python extension, and is typically compiled with libFuzzer linked in. When you initialize Atheris, it registers a [tracer](https://nedbatchelder.com/text/trace-function.html) with CPython to collect information about Python code flow. This tracer can keep track of every line reached and every function executed.
In commit e76f6375ec69f01b6794de779588b8567d5de943 `sys.settrace` has been replaced with bytecode instrumentation [^6].
There is a Python library SlipCover that tracks a Python program as it runs and reports on the parts that executed and those that didn't. SlipCover uses just-in-time instrumentation and de-instrumentation. It has proved coverage precise and near-zero overhead [^4] [^5].
I propose to reuse slipcover source code in Atheris.
[^1]: https://security.googleblog.com/2020/12/how-atheris-python-fuzzer-works.html
[^2]: https://explog.in/notes/settrace.html
[^3]: https://nedbatchelder.com/text/trace-function.html
[^4]: https://github.com/plasma-umass/slipcover
[^5]: [SlipCover: Near Zero-Overhead Code Coverage for Python](https://arxiv.org/pdf/2305.02886.pdf) -- Juan Altmayer Pizzorno, Emery D. Berger
[^6]: https://github.com/google/atheris/blob/33a1322dadaf4d561f7c99b5641cb33748d4036c/hooking.md?plain=1#L14
Contributor guide
Assessment
This issue has not been assessed yet.