-
Notifications
You must be signed in to change notification settings - Fork 348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
index out of bounds: the len is X but the index is X', src/display/inline.rs:115:21 #702
Comments
This fixes crash in inline printer, which assumes that hunk lines are within range. I'm not pretty sure if this assumption holds anytime, but myers_diff appears not emitting the last blank line, so I made the fall-back path do the same. This will hopefully fix Wilfred#702.
myers_diff doesn't emit the last blank line, so I made the fall-back path do the same. This was originally intended to fix Wilfred#702, but fixes crash with sample_files/big_text_hunk_?.txt on 0.59.0. It probably fixes Wilfred#739.
myers_diff doesn't emit the last blank line, so I made the fall-back path do the same. This was originally intended to fix Wilfred#702, but fixes crash with sample_files/big_text_hunk_?.txt on 0.59.0. It probably fixes Wilfred#739.
It happens without [diff]
external = difft
algorithm = histogram
submodule = log rust backtrace RUST_BACKTRACE=full git diff general.sh
thread 'main' panicked at /home/linuxbrew/.cache/Homebrew/cargo_cache/registry/src/index.crates.io-6f17d22bba15001f/line-numbers-0.3.0/src/lib.rs:105:13:
Offset 3785 is out of bounds for a string of length 3784
stack backtrace:
0: 0x55a7d0635bb5 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h8509e56aa833bca9
1: 0x55a7d0483e1b - core::fmt::write::hf5c910d03bc8dbf1
2: 0x55a7d0658d2f - std::io::Write::write_fmt::hf7a7b10682047123
3: 0x55a7d063590e - std::sys_common::backtrace::print::h24e73ad26ef9381c
4: 0x55a7d06470fd - std::panicking::default_hook::{{closure}}::h15e916a5730b3716
5: 0x55a7d0646d73 - std::panicking::default_hook::h782a92d1deb58d3a
6: 0x55a7d06474e6 - std::panicking::rust_panic_with_hook::hbc7722faf2b1f3d1
7: 0x55a7d0635fa4 - std::panicking::begin_panic_handler::{{closure}}::h50d571706df74b03
8: 0x55a7d0635dd9 - std::sys_common::backtrace::__rust_end_short_backtrace::h136840a4e5b47d6e
9: 0x55a7d0647217 - rust_begin_unwind
10: 0x55a7d03df713 - core::panicking::panic_fmt::h6e32fa4169cba42b
11: 0x55a7d0562c93 - line_numbers::LinePositions::from_offset::h71b2c9a90f0285e1
12: 0x55a7d0562ce4 - line_numbers::LinePositions::from_region::h9402a4d149d61917
13: 0x55a7d04a3b59 - difft::line_parser::change_positions::h91c59ea0f95273a2
14: 0x55a7d04b0d9a - difft::diff_file_content::hcc13e8418cfa8f01
15: 0x55a7d04af181 - difft::diff_file::h8f46ca05c3b39472
16: 0x55a7d04ae1eb - difft::main::h6ca2ddd277b1b6ad
17: 0x55a7d04cfbb3 - std::sys_common::backtrace::__rust_begin_short_backtrace::h9329a7648fc3fff0
18: 0x55a7d04fa939 - std::rt::lang_start::{{closure}}::h6ad521249c937cd4
19: 0x55a7d06220b9 - std::rt::lang_start_internal::h6ce3a22367cf13b2
20: 0x55a7d04b2d55 - main
21: 0x7fbcaf84614a - __libc_start_call_main
22: 0x7fbcaf84620b - __libc_start_main_alias_2
23: 0x55a7d03fef15 - _start
24: 0x0 - <unknown>
fatal: external diff died, stopping at general.sh git diff of the same diff --git a/general.sh b/general.sh
index 336b28a..6d9a0c2 100644
--- a/general.sh
+++ b/general.sh
@@ -48,8 +48,8 @@ function fnm_install(){
}
function nodejs_install() {
- fnm install v18
- fnm default v18
+ fnm install v20
+ fnm default v20
}
function pnpm_install(){
@@ -59,8 +59,9 @@ function pnpm_install(){
function python_install() {
curl -L https://pyenv.run | zsh
- pyenv install 3.11
- pyenv global 3.11
+ # install build deps https://github.com/pyenv/pyenv/wiki#suggested-build-environment
+ pyenv install 3.12
+ pyenv global 3.12
}
function poetry_install() {
@@ -98,11 +99,12 @@ function brew_install_packages() {
zoxide \
atuin \
fzf \
- teaxyz/pkgs/pkgx
+ pkgxdev/made/pkgx \
+ pipx
}
function install_tlp_ui() {
- flatpak install flathub tlpui discord
+ flatpak install flathub tlpui com.discordapp.Discord im.riot.Riot md.obsidian.Obsidian
}
function nvchad_config() {
@@ -111,11 +113,32 @@ function nvchad_config() {
}
function kitty_install() {
- curl -L https://sw.kovidgoyal.net/kitty/installer.sh | sh /dev/stdin
- ln -sf ~/.local/kitty.app/bin/kitty ~/.local/kitty.app/bin/kitten ~/.local/bin/\
- cp ~/.local/kitty.app/share/applications/kitty.desktop ~/.local/share/applications/\
- cp ~/.local/kitty.app/share/applications/kitty-open.desktop ~/.local/share/applications/\
- sed -i "s|Icon=kitty|Icon=/home/$USER/.local/kitty.app/share/icons/hicolor/256x256/apps/kitty.png|g" ~/.local/share/applications/kitty*.desktop\
- sed -i "s|Exec=kitty|Exec=/home/$USER/.local/kitty.app/bin/kitty|g" ~/.local/share/applications/kitty*.desktop
+ # Create symbolic links to add kitty and kitten to PATH (assuming ~/.local/bin is install_tlp_ui
+ # your system-wide PATH)
+ ln -sf ~/.local/kitty.app/bin/kitty ~/.local/kitty.app/bin/kitten ~/.local/bin/
+ # Place the kitty.desktop file somewhere it can be found by the OS
+ cp ~/.local/kitty.app/share/applications/kitty.desktop ~/.local/share/applications/
+ # Update the paths to the kitty and its icon in the kitty desktop file(s)
+ sed -i "s|Icon=kitty|Icon=$(readlink -f ~)/.local/kitty.app/share/icons/hicolor/256x256/apps/kitty.png|g" ~/.local/share/applications/kitty*.desktop
+ sed -i "s|Exec=kitty|Exec=$(readlink -f ~)/.local/kitty.app/bin/kitty|g" ~/.local/share/applications/kitty*.desktop
+ # Make xdg-terminal-exec (and hence desktop environments that support it use kitty)
+ echo 'kitty.desktop' > ~/.config/xdg-terminals.list
cp ~/projects/dotrc/config/kitty ~/.config/kitty
}
+
+function zed_install() {
+ curl -f https://zed.dev/install.sh | sh
+}
+
+function udev_rules() {
+ sudo curl https://raw.githubusercontent.com/LedgerHQ/udev-rules/master/20-hw1.rules -o /etc/udev/rules.d/20-hw1.rules
+ sudo curl https://raw.githubusercontent.com/trezor/trezor-common/master/udev/51-trezor.rules -o /etc/udev/rules.d/51-trezor.rules
+ sudo curl https://raw.githubusercontent.com/Yubico/libfido2/main/udev/70-u2f.rules -o /etc/udev/rules.d/70-u2f.rules
+}
+
+function docker_access() {
+ sudo groupadd docker;
+ sudo usermod -aG docker $USER;
+ newgrp docker
+ sudo enable --now docker.service containerd.service
+}
able --now docker.service containerd.service
+} Difftastic 0.60.0 (built with rustc 1.79.0) |
Same here on Arch Linux with difftastic 0.60.0-1. Only started happening today, until yesterday everything was fine. |
I have the same issue with Difftastic 0.60.0 for a specific commit, but the issue disappears if I use Difftastic 0.56.1. I haven't tested with other versions than those two. |
I'm not sure if this is related but seems quite related so I wanted to check before opening a new issue. When running thread 'main' panicked at src/display/side_by_side.rs:505:34:
index out of bounds: the len is 5 but the index is 5
stack backtrace:
0: 0x1042aeb30 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::ha0d87d7183fc688b
1: 0x104143b84 - core::fmt::write::hfc4517b0c144e631
2: 0x1042ae11c - std::io::Write::write_fmt::hafc3b61cd4bc7432
3: 0x1042ae924 - std::sys_common::backtrace::print::he20b5aebd2593e81
4: 0x1042c17f0 - std::panicking::default_hook::{{closure}}::ha825d0a487396873
5: 0x1042c14d4 - std::panicking::default_hook::h858a154b2eadcc95
6: 0x1042c1dc8 - std::panicking::rust_panic_with_hook::ha327ded1962e21fe
7: 0x1042aef1c - std::panicking::begin_panic_handler::{{closure}}::h8a13411fce720f32
8: 0x1042aed74 - std::sys_common::backtrace::__rust_end_short_backtrace::ha2879a5d7250b73a
9: 0x1042c19dc - _rust_begin_unwind
10: 0x104a8f3c0 - core::panicking::panic_fmt::he04eea5e05cf1928
11: 0x104a8f518 - core::panicking::panic_bounds_check::h53b8ed5b86751bd3
12: 0x1041688bc - difft::display::side_by_side::print::h166c355c399ee29f
13: 0x104198dcc - difft::print_diff_result::h2a348a73b9072882
14: 0x104195a1c - difft::main::h6c160af24648ddaa
15: 0x104173d60 - std::sys_common::backtrace::__rust_begin_short_backtrace::hdd961866bfe6f6ad
16: 0x10418b9dc - std::rt::lang_start::{{closure}}::h5320221d8cf77115
17: 0x1042c18e4 - std::panicking::try::h1215cc29895b473a
18: 0x1042a46d0 - std::rt::lang_start_internal::hcaa2353a52dd5e56
19: 0x10419912c - _main
fatal: external diff died, stopping at src/stream2energy.bib |
Same:
|
@autolyticus Seems like this is the issue we have? #688 It's closed though? |
I see this in 0.61.0: The strange part is that I can't reproduce it outside of |
Giving this interesting tool a try as an external git diff tool, I have stumbled upon thich crash.
Note this only happen with
difft --display inline
, works fine withdifft
.A description of the issue. A screenshot is often helpful too.
Diffing staged changes with file removal (private code and repo):
The version of difftastic you're using (see
difft --version
) and your operating system.Difftastic 0.58.0 (f52ca70 2024-04-09, built with rustc 1.65.0)
Linux arch 6.8.4-arch1-1 #1 SMP PREEMPT_DYNAMIC Fri, 05 Apr 2024 00:14:23 +0000 x86_64 GNU/Linux
The text was updated successfully, but these errors were encountered: