Repository navigation
Description
Describe the bug
The datalog_eval fuzzer discovered a crash in the datalog evaluator when processing malformed query inputs with invalid UTF-8 sequences and syntactic structures.
To reproduce
The crash can be reproduced using the failing input:
cargo fuzz run datalog_eval fuzz/artifacts/datalog_eval/crash-3e945c96e1e6b1d0eaa8ed9d5fb3eb2c3bc6e0e9Or minimize the test case:
cargo +nightly fuzz tmin datalog_eval fuzz/artifacts/datalog_eval/crash-3e945c96e1e6b1d0eaa8ed9d5fb3eb2c3bc6e0e9Minimal input
The crashing input (in hex):
28,71,75,65,114,121,32,91,58,102,58,97,115,45,111,102,32,34,61,61,61,61,61,61,61,61,89,217,164,63,114,61,61,1,0,0,0,91,0,0,1,0,65,11,108,105,99,101,34,91,63,101,32,32,63,110,93,93,32,58,97,115,107,102,41,10
Decoding to string (with non-UTF-8 bytes):
(query [:f:as-of "========Y\xd9\xa4?r==\x01\x00\x00\x00[\x00\x00\x01\x00A\x0blice"[?e ?n]] :askf)\n
Expected behaviour
The datalog evaluator should either:
- Gracefully reject invalid inputs with a clear parse error, or
- Handle invalid UTF-8 sequences and malformed datalog syntax without crashing
Actual behaviour
The evaluator crashes with a deadly signal (exit status 77), causing libFuzzer to terminate.
NOTE: libFuzzer has rudimentary signal handlers.
Combine libFuzzer with AddressSanitizer or similar for better crash reports.
SUMMARY: libFuzzer: deadly signal
Environment
- Minigraf version: Latest (from commit e056905)
- Build: Nightly fuzzer
- OS: Ubuntu (runner environment)
Analysis
The crash occurs when the datalog parser/evaluator encounters:
- Invalid UTF-8 byte sequences (
\xd9\xa4- incomplete UTF-8 multibyte sequence) - Malformed query structure with special characters and null bytes
- Mixed invalid syntax tokens
The fuzzer was able to mutate valid input into this crash-inducing sequence through its dictionary-guided mutation process (indicated by MS: 1 PersAutoDict- DE: "Y\331\244?r").
Additional context
Fuzzer metadata:
- Base unit:
cc0b4e56ec223a334e85b318940db8c313894439 - Crash artifact:
/home/runner/work/minigraf/minigraf/fuzz/artifacts/datalog_eval/crash-3e945c96e1e6b1d0eaa8ed9d5fb3eb2c3bc6e0e9 - Exit status: 77 (deadly signal)
This indicates a potential memory safety issue or panic that should be investigated and fixed to improve the robustness of the datalog evaluator against adversarial/malformed input.
Activity
adityamukho commentedon Aug 22, 2026
Another
datalog_evalcrash from the nightly fuzz run, likely the same underlying bug with a clearer diagnostic this time.Run: https://github.com/project-minigraf/minigraf/actions/runs/32551793746
Commit: e056905
Crash artifact:
fuzz/artifacts/datalog_eval/crash-012232f88967026da67f1548a7d90910f6134d8aThis time the panic location is captured:
Failing input bytes:
Decoded:
(query [:::as-of"f[r[Y[[r[\330\205f"n_1])\nReproduce:
Same shape as the original report: an
:as-ofquery with a value containing a non-ASCII multi-byte UTF-8 char (\u{605}here vs\xd9\xa4originally). The new evidence points atsrc/temporal.rs:19doing a byte-index string slice (e.g.&s[..N]) that isn't validated against UTF-8 char boundaries before slicing — worth checking that as the root cause for both crashes.