Input fuzzing action for tree-sitter parsers
  • Perl 49.2%
  • Makefile 33.9%
  • C 16.9%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2025-07-11 12:40:56 +03:00
.editorconfig feat!: convert to composite action 2024-02-14 14:31:52 +02:00
.gitignore feat: allow specifying a seed corpus 2024-03-04 15:43:27 +02:00
action.yml feat: bump setup-action version 2025-07-11 12:40:56 +03:00
annotate.pl fix(annotate): print with newline 2024-05-12 14:37:55 +03:00
fuzzer.c feat: respect CFLAGS 2024-03-31 16:05:00 +03:00
ignorelist.ini feat: show sanitizer output as annotations 2024-03-04 21:41:16 +02:00
LICENSE refactor: merge installation steps 2024-02-24 23:12:04 +02:00
Makefile feat: respect CFLAGS 2024-03-31 16:05:00 +03:00
README.md docs: add instructions for local use 2024-03-18 19:45:26 +02:00

Tree-sitter parser fuzzing

Important

This only works on Linux.

Options

directory:
  description: The directory of the grammar
corpus:
  description: The directory of the seed corpus
timeout:
  description: The time to wait if the fuzzer hangs
  default: 10
max-time:
  description: The maximum total fuzzing time
  default: 60
max-length:
  description: The maximum fuzz input length
  default: 4096
tree-sitter-version:
  description: The tree-sitter version to install
  default: latest

Example configuration

name: Fuzz parser

on:
  push:
    branches: [master]
    paths:
      - src/scanner.c
  pull_request:
    paths:
      - src/scanner.c

jobs:
  test:
    name: Parser fuzzing
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: tree-sitter/fuzz-action@v4

Using locally

Requirements

  • pkg-config
  • make
  • jq
  • llvm
  • tree-sitter library

Usage

make LANG_NAME=parser LANG_DIR=/path/to/tree-sitter-parser

Tip

Check the Makefile for more options.

Credits

Based on vigoux/tree-sitter-fuzz-action