delta: πŸ› memory allocation of 7881122326526296064 bytes failed

When I run delta in my Xubuntu 21.10 x86_64 system I get this error:

$ delta --help
memory allocation of 7881122326526296064 bytes failed
zsh: IOT instruction (core dumped)  delta

I tried with both the latest version on crates.io, and master branch (50ece4b).

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 6
  • Comments: 15 (6 by maintainers)

Commits related to this issue

Most upvoted comments

Hi @osa1, I think this crash is being caused by something particular to your environment. It looks like it’s crashing while loading the syntax highlighting assets from disk. Delta borrows code from bat to do that. I wonder whether you might have something funny going on with your local bat syntax/theme definitions? Could you try

bat cache --clear

and/or moving ~/.cache/bat and ~/.config/bat out of the way temporarily.

Thanks everyone! I’ll close this now. My understanding is that

  1. People installing via cargo hit a known bug in syntect (https://github.com/trishume/syntect/pull/403#issuecomment-1003940363)
  2. The workaround is cargo install --force --locked git-delta

But please keep the discussion going or re-open if you are encountering this problem and that doesn’t describe it.

Confirmed that adding --locked to the install command (cargo install --force --locked git-delta) fixes the issue.

Backtrace of the error: (generated without debug = true)

(gdb) bt
#0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=140737350377600) at pthread_kill.c:44
#1  __pthread_kill_internal (signo=6, threadid=140737350377600) at pthread_kill.c:80
#2  __GI___pthread_kill (threadid=140737350377600, signo=signo@entry=6) at pthread_kill.c:91
#3  0x00007ffff7cb1476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#4  0x00007ffff7c977b7 in __GI_abort () at abort.c:79
#5  0x0000555555852ea7 in std::sys::unix::abort_internal () at library/std/src/sys/unix/mod.rs:259
#6  0x00005555555b1eb6 in std::process::abort () at library/std/src/process.rs:1975
#7  0x000055555584c60e in std::alloc::rust_oom () at library/std/src/alloc.rs:330
#8  0x0000555555868ef7 in alloc::alloc::__alloc_error_handler::__rg_oom () at library/alloc/src/alloc.rs:397
#9  0x00005555555b2d07 in alloc::alloc::handle_alloc_error () at library/alloc/src/alloc.rs:366
#10 0x00005555555a09f5 in alloc::raw_vec::RawVec<T,A>::reserve::do_reserve_and_handle ()
#11 0x00005555556582dd in <&mut bincode::de::Deserializer<R,O> as serde::de::Deserializer>::deserialize_string ()
#12 0x000055555565b88d in <&mut bincode::de::Deserializer<R,O> as serde::de::Deserializer>::deserialize_struct ()
#13 0x00005555555c7adc in <serde::de::impls::<impl serde::de::Deserialize for alloc::vec::Vec<T>>::deserialize::VecVisitor<T> as serde::de::Visitor>::visit_seq ()
#14 0x000055555565c9d5 in <&mut bincode::de::Deserializer<R,O> as serde::de::Deserializer>::deserialize_struct ()
#15 0x0000555555630458 in syntect::dumps::from_binary ()
#16 0x0000555555629f65 in delta::utils::bat::assets::HighlightingAssets::new ()
#17 0x0000555555612d99 in delta::main ()
#18 0x00005555555dcaf3 in std::sys_common::backtrace::__rust_begin_short_backtrace ()
#19 0x00005555555b7ff9 in std::rt::lang_start::_$u7b$$u7b$closure$u7d$$u7d$::h87d70c75379e17c7 ()
#20 0x000055555584b01b in core::ops::function::impls::{impl#2}::call_once<(), (dyn core::ops::function::Fn<(), Output=i32> + core::marker::Sync + core::panic::unwind_safe::RefUnwindSafe)> () at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/core/src/ops/function.rs:259
#21 std::panicking::try::do_call<&(dyn core::ops::function::Fn<(), Output=i32> + core::marker::Sync + core::panic::unwind_safe::RefUnwindSafe), i32> () at library/std/src/panicking.rs:403
#22 std::panicking::try<i32, &(dyn core::ops::function::Fn<(), Output=i32> + core::marker::Sync + core::panic::unwind_safe::RefUnwindSafe)> ()
    at library/std/src/panicking.rs:367
#23 std::panic::catch_unwind<&(dyn core::ops::function::Fn<(), Output=i32> + core::marker::Sync + core::panic::unwind_safe::RefUnwindSafe), i32>
    () at library/std/src/panic.rs:133
#24 std::rt::lang_start_internal::{closure#2} () at library/std/src/rt.rs:128
#25 std::panicking::try::do_call<std::rt::lang_start_internal::{closure#2}, isize> () at library/std/src/panicking.rs:403
#26 std::panicking::try<isize, std::rt::lang_start_internal::{closure#2}> () at library/std/src/panicking.rs:367
#27 std::panic::catch_unwind<std::rt::lang_start_internal::{closure#2}, isize> () at library/std/src/panic.rs:133
#28 std::rt::lang_start_internal () at library/std/src/rt.rs:128
#29 0x00005555556137d2 in main ()