Skip to content

cargo run resulting in panic #5593

@merelymyself

Description

@merelymyself

Describe the bug

    Finished dev [unoptimized + debuginfo] target(s) in 29.22s
     Running `target/debug/nu`
warning: use `let-env config = ...` instead of `let config = ...`
thread 'main' panicked at 'capacity overflow', library/alloc/src/raw_vec.rs:517:5
stack backtrace:
   0: rust_begin_unwind
             at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/panicking.rs:584:5
   1: core::panicking::panic_fmt
             at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/core/src/panicking.rs:143:14
   2: alloc::raw_vec::capacity_overflow
             at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/alloc/src/raw_vec.rs:517:5
   3: alloc::raw_vec::RawVec<T,A>::allocate_in
             at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/alloc/src/raw_vec.rs:178:27
   4: alloc::raw_vec::RawVec<T,A>::with_capacity_in
             at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/alloc/src/raw_vec.rs:132:9
   5: alloc::collections::vec_deque::VecDeque<T,A>::with_capacity_in
             at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/alloc/src/collections/vec_deque/mod.rs:562:43
   6: alloc::collections::vec_deque::VecDeque<T>::with_capacity
             at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/alloc/src/collections/vec_deque/mod.rs:527:9
   7: reedline::history::file_backed::FileBackedHistory::new
             at /home/gabriel/.cargo/registry/src/github.com-1ecc6299db9ec823/reedline-0.5.0/src/history/file_backed.rs:218:22
   8: reedline::history::file_backed::FileBackedHistory::with_file
             at /home/gabriel/.cargo/registry/src/github.com-1ecc6299db9ec823/reedline-0.5.0/src/history/file_backed.rs:235:24
   9: nu_cli::repl::evaluate_repl
             at ./crates/nu-cli/src/repl.rs:92:13
  10: nu::main
             at ./src/main.rs:244:21
  11: core::ops::function::FnOnce::call_once
             at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/core/src/ops/function.rs:227:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

When I cargo run after the latest nushell commit, this panic is found.

cargo test still works.

I'm fairly certain panicking should not be the appropriate response for this.

How to reproduce

  1. Download latest nushell
  2. cargo run

Expected behavior

I expected nu to not panic - or at least panic with some helpful information as to what went wrong.

Screenshots

No response

Configuration

key value
version 0.62.1
branch main
commit_hash 6efd1bc
build_os linux-x86_64
rust_version rustc 1.61.0 (fe5b13d68 2022-05-18)
rust_channel stable-x86_64-unknown-linux-gnu
cargo_version cargo 1.61.0 (a028ae4 2022-04-29)
pkg_version 0.62.1
build_time 2022-05-20 20:50:01 +08:00
build_rust_channel debug
features default, trash, which, zip
installed_plugins

Note this may be misleading - I git reset --hard to my own fork in order to actually run nushell. No issues there for some reason.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions