Files
harfbuzz/test/fuzzing
Khaled Hosny 9d7bba088a Try to fix msan bot (#6124)
* [test/fuzzing] Skip hb-depend-closure-parity without GLib

It depends on GLib unlike the other fuzzers.

* [ci] Build the msan bot without external dependencies

We don’t care about msan errors in code that is not ours, and some
libraries like GLib are not built with memory sanitizers in mind.

* [ci] Don't pipe sanitizer test output

The pipe was masking meson exit status, and it was redundant anyway
since the sanitizer output is is already symbolized and demangled.

* [COLR] Fix integer overflow in get_extents

Use to_glyph_extents(), which guards against this.

Update test expectation since we now round instead of truncate.
2026-07-30 19:02:25 -06:00
..
2023-05-27 01:16:46 +02:00
2025-04-06 02:34:48 -06:00
2026-07-30 19:02:25 -06:00

Security Fuzzers

To build the fuzzers with libFuzzer to perform actual fuzzing, build with:

CXX=clang++ CXXFLAGS="-fsanitize=address,fuzzer-no-link" meson fuzzbuild --default-library=static -Dfuzzer_ldflags="-fsanitize=address,fuzzer"

ninja -Cfuzzbuild

Then, run the fuzzer like this:

fuzzbuild/test/fuzzing/hb-{shape,raster,vector,subset,repacker,depend}-fuzzer [-max_len=2048] [CORPUS_DIR]

Where max_len specifies the maximal length of font files to handle. The smaller the faster.

Note: The depend fuzzer requires -Ddepend_api=true meson option.

For more details consult the following locations:

Depend Closure Parity Test

The hb-depend-closure-parity test is distinct from the security fuzzers. While security fuzzers test robustness against malformed input, the closure parity test validates correctness by emulating the glyph closure calculation used for subsetting with one generated from the dependency graph to avoid implementation divergence. It should only be run on valid fonts.