fig icon indicating copy to clipboard operation
fig copied to clipboard

bug: Eclipse terminal consistently does "thread 'main' panicked at 'index out of bounds:"

Open jonahgraham opened this issue 2 years ago • 3 comments

Checks

  • [X] I have searched github.com/withfig/fig/issues and there are no duplicates of my issue
  • [X] I have run fig doctor in the affected terminal session
  • [X] I have run fig restart and replicated the issue again

Operating system

macOS Ventura 13.4

Expected behaviour

Fig to start in my integrated terminal in Eclipse IDE

Actual behaviour

I get the following error when opening my terminal:

thread 'main' panicked at 'index out of bounds: the len is 0 but the index is 18446744073709551615', /Users/distiller/project/desktop/lib/alacritty_terminal/src/grid/mod.rs:489:14
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

With RUST_BACKTRACE=full:

thread 'main' panicked at 'index out of bounds: the len is 0 but the index is 18446744073709551615', /Users/distiller/project/desktop/lib/alacritty_terminal/src/grid/mod.rs:489:14
stack backtrace:
0:        0x1049b3384 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h105074e3d85f800b
1:        0x1042bcc54 - core::fmt::write::h34766cf8fff7af1e
2:        0x1049b00b0 - std::io::Write::write_fmt::hd64c4cf6e7adea59
3:        0x1049b31a4 - std::sys_common::backtrace::print::h2a6828a537036cf9
4:        0x1049b7600 - std::panicking::default_hook::{{closure}}::h4e82ce6ccef941b2
5:        0x1049b737c - std::panicking::default_hook::h29f62f8795c5cb00
6:        0x1049b7bc0 - std::panicking::rust_panic_with_hook::h19862cbd0fbda7ba
7:        0x1049b79c4 - std::panicking::begin_panic_handler::{{closure}}::h3f3626935e1669fe
8:        0x1049b5c6c - std::sys_common::backtrace::__rust_end_short_backtrace::h5054ef52bd507d0a
9:        0x1049b7768 - _rust_begin_unwind
10:        0x104bcd990 - core::panicking::panic_fmt::h7e47e10600a90221
11:        0x104bcda8c - core::panicking::panic_bounds_check::hde809934b70194da
12:        0x104509c00 - <alacritty_terminal::term::Term<T> as alacritty_terminal::ansi::Handler>::input::hd7fc3a79c7de5966
13:        0x1043d6ec8 - vte::Parser::perform_action::h79fb93dd46f9390d
14:        0x10441bd68 - figterm::figterm_main::{{closure}}::h0f061aca8f6329fc
15:        0x1043f188c - tokio::runtime::park::CachedParkThread::block_on::hcc5ddd169e02b6f8
16:        0x1044edd48 - tokio::runtime::scheduler::multi_thread::MultiThread::block_on::h3740b08b5464193f
17:        0x104574608 - tokio::runtime::runtime::Runtime::block_on::h8ed9132fe7a4b961
18:        0x10447e7b4 - figterm::main::hedd1a7a857866569
19:        0x104567f3c - std::sys_common::backtrace::__rust_begin_short_backtrace::hd5590e5cc819b355
20:        0x10448a0a0 - std::rt::lang_start::{{closure}}::hae5787277eb2c97b
21:        0x1049aa1a8 - std::rt::lang_start_internal::h91996717d3eb1d2a
22:        0x10448304c - _main

Steps to reproduce

  • Install and setup fig
  • Download and run Eclipse IDE for Java Developers
  • Open a new terminal - press this button in main toolbar Screenshot 2023-06-20 at 2 23 22 PM
  • Choose terminal Local Terminal and press OK to open the terminal view.
  • The above stack trace should be shown

Additional notes:

  • I cannot run fig doctor and fig restart in the problematic terminal as it crashes on startup, but in the normal Apple terminal it works fine.
  • I had alacritty installed, but removed it to see if that was causing the problem. Same error message after removing it. However since the error mentions alacritty, perhaps there is some remnant of alacritty on my machine that fig sees.
  • If I remove the fig integration from the startup scripts so I can open the shell and then run env -i SHELL=/bin/bash '/Users/jonahgraham/.fig/bin/bash (figterm)' in the shell I get the same error.

Environment

fig-details:
  - 2.16.0
hardware-info:
  - model: 
  - model-id: 
  - chip-id: Apple M1
  - cores: 8
  - mem: 16.00 GB
os-info:
  - macOS 13.4.0 (22F66)
environment:
  - shell: /bin/zsh
  - terminal: terminal
  - cwd: /Users/jonahgraham
  - exe-path: /opt/homebrew/bin/fig
  - install-method: brew
  - env-vars:
    - FIGTERM_SESSION_ID: df65cf63-4172-485a-a1e4-498d637d9333
    - FIG_SET_PARENT_CHECK: 1
    - FIG_TERM: 2.16.0
    - PATH: /opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Users/jonahgraham/.fig/bin:/Users/jonahgraham/.local/bin
    - SHELL: /bin/zsh
    - TERM: xterm-256color
    - __CFBundleIdentifier: com.apple.Terminal
    - FIG_PID: 64644
    - FIG_SET_PARENT: df65cf63-4172-485a-a1e4-498d637d9333

jonahgraham avatar Jun 20 '23 18:06 jonahgraham

Some additional useful info:

  • I am the current maintainer of the Eclipse TM Terminal, the terminal integrated into Eclipse IDE. The Terminal attempts to look like a standard xterm and sets TERM=xterm. However there are certainly a few places where it may not respond as expected. If you can share what fig was trying to do at the time of the crash and I can fix it in the Eclipse code that would be great.
  • I was able to reproduce this issue that was initially reported by a user https://github.com/eclipse-cdt/cdt/issues/429
  • #1570 seems to be a similar issue

jonahgraham avatar Jun 20 '23 18:06 jonahgraham

Hey @jonahgraham! Thanks for opening this issue (and sorry for the slow follow up on our end).

We use Alacritty rust for our terminal parsing logic and it looks like this may be an issue upstream. Any thoughts on this @grant0417?

mschrage avatar Jul 17 '23 22:07 mschrage

Did you manage do solve this?

aberenshtein avatar Dec 04 '23 13:12 aberenshtein