Skip to content

nushell panic on command: nu --testbin cococo 1 2 3 | first #12558

@WindSoilder

Description

@WindSoilder

Describe the bug

As title, while looking into an issue, I suddenly find out nushell panic when running testbin with first or last.

How to reproduce

run the given command: nu --testbin cococo 1 2 3 | first or nu --testbin cococo 1 2 3 | last

Expected behavior

I expect nu to show error message and not panic.

Screenshots

image

Configuration

key value
version 0.92.3
branch main
commit_hash 57b0c72
build_os linux-x86_64
build_target x86_64-unknown-linux-gnu
rust_version rustc 1.77.2 (25ef9e3d8 2024-04-09)
rust_channel stable-x86_64-unknown-linux-gnu
cargo_version cargo 1.77.2 (e52e36006 2024-03-26)
build_time 2024-04-18 06:26:33 +08:00
build_rust_channel debug
allocator mimalloc
features default, sqlite, trash, which
installed_plugins

Additional context

Here is the backtrace I get:

Error:   × Main thread panicked.
├─▶ at library/std/src/io/stdio.rs:1030:9
 ╰─▶ failed printing to stdout: Broken pipe (os error 32)
0: 0x5648a8039e14 - rust_begin_unwind at /rustc/25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04/library/std/src/panicking.rs:647
1: 0x5648a806ab65 - core::panicking::panic_fmt::ha6effc2775a0749 
    at /rustc/25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04/library/core/src/panicking.rs:72
2: 0x5648a802fc98 - std::io::stdio::print_to::hec970441a5e8c603 
    at /rustc/25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04/library/std/src/io/stdio.rs:1030
- std::io::stdio::_print::h289ecbd691b224da
    at /rustc/25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04/library/std/src/io/stdio.rs:1106
3: 0x5648a4f1b966 - nu::test_bins::cococo::hb38ee0f9c07a0471
    at /home/windsoilder/projects/nushell/src/test_bins.rs:82
4: 0x5648a4f0ad13 - nu::main::hc234e957e379aef3
    at /home/windsoilder/projects/nushell/src/main.rs:316
5: 0x5648a4f2c14b - core::ops::function::FnOnce::call_once::hcc040c3051d4cb6d
   at /rustc/25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04/library/core/src/ops/function.rs:250

Metadata

Metadata

Assignees

No one assigned

    Labels

    category:regressionSomething that worked does not work anymore.panictestsissues to add tests or fix tests

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions