Open olivergondza opened 6 months ago
It happens without --display inline
as well for me. I was using with git config as below
[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) Fedora release 39
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 git diff
with difftastic, I'm getting the following stack trace (after outputting the correct diffs for all of the previous files)
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:
thread 'main' panicked at ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/difftastic-0.58.0/src/display/side_by_side.rs:509:34:
index out of bounds: the len is 206 but the index is 206
stack backtrace:
0: 0x5fb5130301cf - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hffecb437d922f988
1: 0x5fb512df546c - core::fmt::write::hd9a8d7d029f9ea1a
2: 0x5fb51302ad93 - std::io::Write::write_fmt::h0e1226b2b8d973fe
3: 0x5fb51302ff54 - std::sys_common::backtrace::print::he907f6ad7eee41cb
4: 0x5fb513031878 - std::panicking::default_hook::{{closure}}::h3926193b61c9ca9b
5: 0x5fb51303155c - std::panicking::default_hook::h25ba2457dea68e65
6: 0x5fb513031d7e - std::panicking::rust_panic_with_hook::h0ad14d90dcf5224f
7: 0x5fb513031c72 - std::panicking::begin_panic_handler::{{closure}}::h4a1838a06f542647
8: 0x5fb513030696 - std::sys_common::backtrace::__rust_end_short_backtrace::h77cc4dc3567ca904
9: 0x5fb5130319b4 - rust_begin_unwind
10: 0x5fb512d498f5 - core::panicking::panic_fmt::h940d4fd01a4b4fd1
11: 0x5fb512d49ad2 - core::panicking::panic_bounds_check::h9bb22f08a42e1ac8
12: 0x5fb512e75d39 - difft::display::side_by_side::print::h1ea6837b816653ab
13: 0x5fb512e2c558 - difft::print_diff_result::h02866f52f12db36f
14: 0x5fb512e270f9 - difft::main::h22a23a0f9dc9ab90
15: 0x5fb512e76743 - std::sys_common::backtrace::__rust_begin_short_backtrace::hde79b91d194773f7
16: 0x5fb512e6d789 - std::rt::lang_start::{{closure}}::h2fed08fe717f2596
17: 0x5fb513023295 - std::rt::lang_start_internal::h103c42a9c4e95084
18: 0x5fb512e2c975 - main
19: 0x75f408637d6e - <unknown>
20: 0x75f408637e2a - __libc_start_main
21: 0x5fb512d6b225 - _start
22: 0x0 - <unknown>
fatal: external diff died, stopping at tests/loader.test.cpp
Difftastic 0.58.0 (built with rustc 1.78.0)
Not using inline, just via hooked git diff
.
@autolyticus Seems like this is the issue we have? https://github.com/Wilfred/difftastic/issues/688 It's closed though?
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 (f52ca706f 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