Skip to content

Shift+p in Normal mode causes thread panic #11256

@LucasTavaresA

Description

@LucasTavaresA

i pressed Shift+p by mistake and triggered this thing, i tried compiling the latest (git commit) fish and placing "exit 0" in the beginning of my config, it still triggers this thread panic.

this is the message:

thread 'main' panicked at src/reader.rs:2941:76:
attempt to subtract with overflow
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
fish crashed, please report a bug. Debug PID 15111 or press Enter to exit

im not a gdb magician but i think i did this right, this is the gdb backtrace:

#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
#1  0x00007ffff7c2368f in __pthread_kill_internal (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78
#2  0x00007ffff7bd4822 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#3  0x00007ffff7bbd4af in __GI_abort () at ./stdlib/abort.c:79
#4  0x000055555587605a in std::sys::pal::unix::abort_internal ()
#5  0x0000555555608a89 in std::process::abort ()
#6  0x0000555555866655 in fish::panic::panic_handler::{closure#0}<fn() -> i32> (panic_info=<optimized out>) at src/panic.rs:56
#7  0x00005555558a9c59 in std::panicking::rust_panic_with_hook ()
#8  0x00005555558a9a35 in std::panicking::begin_panic_handler::{{closure}} ()
#9  0x00005555558a99c9 in std::sys::backtrace::__rust_end_short_backtrace ()
#10 0x00005555558a99bc in rust_begin_unwind ()
#11 0x00005555555fb32f in core::panicking::panic_fmt ()
#12 0x00005555555fba16 in core::panicking::panic_const::panic_const_sub_overflow ()
#13 0x0000555555676c8c in fish::reader::Reader::handle_readline_command (self=0x7fffffffaf28, c=<optimized out>) at src/reader.rs:2941
#14 0x000055555566e78f in fish::reader::Reader::handle_char_event (self=<optimized out>, injected_event=...) at src/reader.rs:2484
#15 0x000055555566b4bc in fish::reader::Reader::readline (self=<optimized out>, nchars=...) at src/reader.rs:2250
#16 0x00005555556676d5 in fish::reader::read_i (parser=0x7fffffffd490) at src/reader.rs:683
#17 fish::reader::reader_read (parser=0x7fffffffd490, fd=<optimized out>, io=<optimized out>) at src/reader.rs:646
#18 0x0000555555612db1 in fish::throwing_main () at src/bin/fish.rs:914
#19 0x00005555558660f7 in core::ops::function::FnOnce::call_once<fn() -> i32, ()> ()
    at /builddir/rust-1.84.1/library/core/src/ops/function.rs:250
#20 fish::panic::panic_handler<fn() -> i32> (main=<optimized out>) at src/panic.rs:59
#21 0x000055555560c733 in fish::main () at src/bin/fish.rs:713

self.update_buff_pos(self.active_edit_line_tag(), Some(el.position() - 1));
this seems to be it, theres a - 1 in there

Metadata

Metadata

Assignees

No one assigned

    Labels

    regressionSomething that used to work, but was broken, especially between releases

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions