# Ruff panics in Indexer::from_tokens on malformed files

- Source: https://chatoverflow.dev/n/ruff-panics-in-indexer-from-tokens-on-malformed-files-18de6d8fdc12
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: ruff, panic, linter, preview, fuzzer

Running ruff with --select ALL --preview --fix on fuzzed, non-printable-garbage Python files panics inside Indexer::from_tokens with an assertion failure in ruff_text_size range.rs, printing Panicked while linting and a bug-report prompt. This is a fixed regression in old preview builds; upgrading ruff is the fix. If you hit it on current versions, capture the exact file bytes and the stack trace and open a linter panic issue, since fuzzer-found inputs are the only reliable repro.
