cargo-spellcheck: Help identifying panic: `assertion failed: plain_range.start <= plain_range.end`

** Q: **

I am using cargo-spellcheck in my repo and with dev_comments set to true I receive this panic error:

cargo spellcheck --cfg=./spellcheck/era.cfg
The application panicked (crashed).
Message:  assertion failed: plain_range.start <= plain_range.end
Location: /Users/dustinbrickwood/.cargo/registry/src/index.crates.io-6f17d22bba15001f/doc-chunks-0.0.5/src/markdown.rs:363

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.

When I run with -vvvvv verbosity it doesn’t seem to panic but perhaps I reading it wrong? Also ran with RUST_BACKTRACE=full but no clarity on the root issue is.

Question: How can I see where in my application it is causing this panic?

To reproduce

  1. git clone git@github.com:matter-labs/zksync-era.git
  2. git checkout dutterbutter-pla-646-add-spelling-linter-for-zksync-era-core-part-2
  3. cargo spellcheck --cfg=./spellcheck/era.cfg --code 1
  4. Error result:
The application panicked (crashed).
Message:  assertion failed: plain_range.start <= plain_range.end
Location: /Users/dustinbrickwood/.cargo/registry/src/index.crates.io-6f17d22bba15001f/doc-chunks-0.0.5/src/markdown.rs:363

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.

cargo-spellcheck Config file:

Click to view config file
# Project settings where a Cargo.toml exists and is passed
# ${CARGO_MANIFEST_DIR}/.config/spellcheck.toml

# Also take into account developer comments
dev_comments = true

# Skip the README.md file as defined in the cargo manifest
skip_readme = false

[Hunspell]
# lang and name of `.dic` file
lang = "en_US"
# OS specific additives
# Linux: [ /usr/share/myspell ]
# Windows: []
# macOS [ /home/alice/Libraries/hunspell, /Libraries/hunspell ]

# Additional search paths, which take presedence over the default
# os specific search dirs, searched in order, defaults last
search_dirs = ["."]

# Adds additional dictionaries, can be specified as
# absolute paths or relative in the search dirs (in this order).
# Relative paths are resolved relative to the configuration file
# which is used.
# Refer to `man 5 hunspell`
# or https://www.systutorials.com/docs/linux/man/4-hunspell/#lbAE
# on how to define a custom dictionary file.
extra_dictionaries = ["era.dic"]

# If set to `true`, the OS specific default search paths
# are skipped and only explicitly specified ones are used.
skip_os_lookups = false

# Use the builtin dictionaries if none were found in
# in the configured lookup paths.
# Usually combined with `skip_os_lookups=true`
# to enforce the `builtin` usage for consistent
# results across distributions and CI runs.
# Setting this will still use the dictionaries
# specified in `extra_dictionaries = [..]`
# for topic specific lingo.
use_builtin = true


[Hunspell.quirks]
# Transforms words that are provided by the tokenizer
# into word fragments based on the capture groups which are to
# be checked.
# If no capture groups are present, the matched word is whitelisted.
transform_regex = ["^'([^\\s])'$", "^[0-9]+x$"]
# Accepts `alphabeta` variants if the checker provides a replacement suggestion
# of `alpha-beta`.
allow_concatenation = true
# And the counterpart, which accepts words with dashes, when the suggestion has
# recommendations without the dashes. This is less common.
allow_dashed = false

[NlpRules]
# Allows the user to override the default included
# exports of LanguageTool, with other custom
# languages

# override_rules = "/path/to/rules_binencoded.bin"
# override_tokenizer = "/path/to/tokenizer_binencoded.bin"

[Reflow]
# Reflows doc comments to adhere to a given maximum line width limit.
max_line_length = 80

Version:

cargo spellcheck --version
cargo-spellcheck 0.13.1

Any assistance here would be greatly appreciated 🙏 Thanks!

About this issue

  • Original URL
  • State: closed
  • Created 7 months ago
  • Comments: 15 (8 by maintainers)

Most upvoted comments

Re-opening, it’s not acceptable for cargo-spellcheck to crash and burn on a stray space.

RUST_BACKTRACE=1 cargo-spellcheck --cfg=../../../spellcheck/era.cfg --code 1 zksync-era/core/lib/multivm/src/versions/vm_m6/tests/bootloader.rs fails reproducibly

It turns out it only happens when run with a directory as argument, not a single file, single files don’t trigger it. -j1 also does not trigger it. I run it on a 64 threads machine. It doesn’t popup when using -vvvvv