Skip to content

index out of bounds: the len is 4 but the index is 140353459346585 #378

@Lslightly

Description

@Lslightly

Env:

$ cargo version --verbose
cargo 1.87.0-nightly (6cf826701 2025-03-14)
release: 1.87.0-nightly
commit-hash: 6cf8267012570f63d6b86e85a2ae5627de52df9e
commit-date: 2025-03-14
host: x86_64-unknown-linux-gnu
libgit2: 1.9.0 (sys:0.20.0 vendored)
libcurl: 8.12.1-DEV (sys:0.4.80+curl-8.12.1 vendored ssl:OpenSSL/3.4.1)
ssl: OpenSSL 3.4.1 11 Feb 2025
os: Ubuntu 24.4.0 (noble) [64-bit]

Demo repo: https://github.com/Lslightly-courses/cs431/tree/loom-index-out-of-bounds

# loom-index-out-of-bounds branch
git clone -b loom-index-out-of-bounds https://github.com/Lslightly-courses/cs431.git

Run source loom.sh in homework directory.

cd homework
LOOM_CHECKPOINT_INTERVAL=1 LOOM_CHECKPOINT_FILE=my_test.json cargo test --features check-loom,loom/checkpoint --test arc --release -- correctness::count_sync --nocapture --test-threads 1

Error:

thread 'correctness::count_sync' panicked at /home/lqw/.cargo/registry/src/rsproxy.cn-e3de039b2554c837/loom-0.7.2/src/rt/object.rs:286:38:
index out of bounds: the len is 4 but the index is 140476439911577
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
FAILED

I don't know whether loom can handle all cases. More user-friendly feedback might help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions