A numpy fuzzing plugin for fusil's Python fuzzer.
It injects a large catalog of pre-built "tricky" numpy arrays and scalars (odd dtypes, huge/empty shapes, NaN/inf, object arrays, non-contiguous views, ...) as hostile arguments into fuzzed calls, and embeds their setup code into every generated script.
Unlike the h5py and cereggii plugins — which only activate when their library is the fuzz target — numpy arrays are useful hostile inputs for any C extension, so this plugin is active for every run whenever numpy is importable. This reproduces the behaviour of the in-core numpy support it replaces.
This machinery used to live in-tree (fusil/python/samples/tricky_numpy.py plus the numpy
branches of argument_generator / write_python_code / tricky_weird). It was extracted so
the core generator carries no numpy-specific code.
pip install -e . # from a checkout, into the same venv as fusilRequires fusil and numpy.
Just install it — it activates automatically for every run:
PYTHONPATH=$PWD python fuzzers/fusil-python-threaded --force-unsafe --modules json--no-numpyturns it off for a run.--no-external-referencessuppresses the injected references (the setup is still emitted).- Uninstall the plugin to remove numpy support entirely.
| Hook | Provided by |
|---|---|
--no-numpy CLI option |
opt-out, preserved from the core |
add_argument_generator (simple + complex, weight 50) |
reference to a random pre-built numpy_* object |
add_definitions_provider |
import numpy + the tricky-object setup source |
declare_dependency("numpy") |
advertises the numpy requirement |
fusil_numpy_plugin/__init__.py—register()and the thin adapters.fusil_numpy_plugin/tricky_numpy.py— the pre-built tricky-object catalog (embedded verbatim).