Skip to content

Panic byte index 15 is out of bounds in oxc_span/src/span.rs #4651

@qarmin

Description

@qarmin

File content(at the bottom should be attached raw, not formatted file - github removes some non-printable characters, so copying from here may not work):

module A.B {
}

command

timeout -v 100 oxlint -D all -D nursery --import-plugin --jsdoc-plugin --jest-plugin --vitest-plugin --jsx-a11y-plugin --nextjs-plugin --react-perf-plugin TEST___FILE.ts --fix

App was compiled with nightly rust compiler to be able to use address sanitizer
On Ubuntu 24.04, the commands to compile were:

rustup default nightly
rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu
rustup component add llvm-tools-preview --toolchain nightly-x86_64-unknown-linux-gnu

export RUST_BACKTRACE=1
export ASAN_SYMBOLIZER_PATH=$(which llvm-symbolizer-18)
export ASAN_OPTIONS=symbolize=1
RUSTFLAGS="-Zsanitizer=address" cargo +nightly build --target x86_64-unknown-linux-gnu

cause this

thread '<unnamed>' panicked at crates/oxc_span/src/span.rs:300:21:
byte index 15 is out of bounds of `module A.B {
}`
stack backtrace:
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

##### Automatic Fuzzer note, output status "None", output signal "Some(6)"

compressed.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory - Buggood first issueExperience Level - Good for newcomers

    Type

    No type

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions