Skip to content
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

Memory allocation of x bytes failed error🐛 #1018

Closed
2 tasks
saumyajyoti opened this issue Mar 18, 2022 · 17 comments
Closed
2 tasks

Memory allocation of x bytes failed error🐛 #1018

saumyajyoti opened this issue Mar 18, 2022 · 17 comments

Comments

@saumyajyoti
Copy link

  • Please include the raw text output from git, so that we can reproduce the problem.
    (You can use git --no-pager to produce the raw text output.)
  • A screenshot of Delta's output is often helpful also.

Thanks for filing a Delta bug report!
Any DELTA command fails with above error on Windows 11 latest insider build.

@oliverralbertini
Copy link

Also seeing this on macOS Monterey (12.3)

@lalitmee
Copy link

Also seeing this on Pop OS 22.10.

@dandavison
Copy link
Owner

Hi all, is it this that you're hitting? #878 (comment)

If it's different from #878, can you provide

  • Paste / screenshot of the exact error message that you're getting
  • How did you install delta
  • The output of delta --version
  • Your OS

@saumyajyoti
Copy link
Author

saumyajyoti commented Mar 21, 2022

I tried different installation options. scoop, downloading zip etc.
Always getting same error.
Below output is captured when trying to get version:


D:\Apps\delta-0.12.1-x86_64-pc-windows-msvc>.\delta.exe -V
memory allocation of 6567900115468379765 bytes failed


image

@dandavison
Copy link
Owner

@saumyajyoti do you see the same problem with previous delta versions?

Can you try

bat cache --clear
bat cache --build

I do think that this sounds similar to #878 so please take a look at discussion in that issue and the linked syntect issue.

FWIW I've tested installing 0.12.1 on MacOS Intel 11.6.4 (BigSur) via Homebrew and that did not have this problem.

@saumyajyoti
Copy link
Author

@saumyajyoti do you see the same problem with previous delta versions?

Can you try

bat cache --clear
bat cache --build

I do think that this sounds similar to #878 so please take a look at discussion in that issue and the linked syntect issue.

FWIW I've tested installing 0.12.1 on MacOS Intel 11.6.4 (BigSur) via Homebrew and that did not have this problem.

Thanks. This step resolved the issue. :)

@lalitmee
Copy link

@dandavison, for me it doesn't resolve the issue.

❯ delta                                                                                                                                                                                                                                                                    
memory allocation of 324400560136122233 bytes failed
[1]    495569 IOT instruction (core dumped)  delta

I have tried bat method but nothing happened. I have installed it using the .deb package from github-releases.

@dandavison
Copy link
Owner

Hi @lalitmee. OK, if you have time to investigate this further, perhaps you could try uninstalling the version you installed and installing a previous delta version and determining which versions it is reproducible on?

@lalitmee
Copy link

@dandavison, for me 0.12.0 is working.

@awerlang
Copy link

This worked 🚀

bat cache --clear

This is the step that causes delta to fail 💥

bat cache --build

@dandavison can this issue be re-opened until a proper fix is available? Probably not sharing bat's cache.

@awerlang
Copy link

Downloaded bat v0.20.0 from GH, rebuilding cache with this version doesn't cause issues to delta.

System's bat does complain about the cache:

$ bat whatever
[bat error]: The binary caches for the user-customized syntaxes and themes in '/home/user/.cache/bat' are not compatible with this version of bat (0.18.2). To solve this, either rebuild the cache (bat cache --build) or remove the custom syntaxes/themes (bat cache --clear).

@dandavison
Copy link
Owner

dandavison commented Mar 26, 2022

Thanks very much @awerlang -- I think with what you've said we have an understanding of this problem: I believe that delta docs need to say something like:

If you are using bat, then you need to ensure that bat and delta are both on compatible versions. Currently, this means either

  • delta >= 0.12.1, bat >= 0.19.0, OR
  • delta <= 0.12.0, bat <= 0.18.3

For Delta users, after changing bat & delta version, please run

bat cache --clear
bat cache --build

I believe those bat versions are correct but not 100% sure.

@lalitmee would you be able to move your system into a state that conforms with the above?

@dandavison can this issue be re-opened until a proper fix is available? Probably not sharing bat's cache.

I'm hoping not to have to do that right now. With bat v0.20.0 delta is now using bat as a library so should always be able to keep up with any backward-incompatible changes that bat makes simply by incrementing the bat library version. Users of delta and bat would have to upgrade both together, but I believe that such backward-incompatible changes are rare (the recent one was the first one we've seen in the 2 years or so that delta's been alive; I believe it's due to the lazy theme loading introduced in https://github.com/sharkdp/bat/releases/tag/v0.19.0)

System's bat does complain about the cache:

Just to make it clear for anyone else reading this -- our advice would be not to run two bat versions on your system for this reason.

@awerlang
Copy link

(snip) Users of delta and bat would have to upgrade both together, but I believe that such backward-incompatible changes are rare (the recent one was the first one we've seen in the 2 years or so that delta's been alive; I believe it's due to the lazy theme loading introduced in https://github.com/sharkdp/bat/releases/tag/v0.19.0)

Packagers will need to be aware of this relationship. Vendoring makes this a bit harder to manage though.

System's bat does complain about the cache:

Just to make it clear for anyone else reading this -- our advice would be not to run two bat versions on your system for this reason.

Somewhat related I proposed this on bat's side sharkdp/bat#2085 (comment)
That said bat/delta runs fine without a cache (IIRC at some version there would be warnings) so that works better for me.

@Enselic
Copy link

Enselic commented Mar 27, 2022

I believe that such backward-incompatible changes are rare (the recent one was the first one we've seen in the 2 years or so that delta's been alive; I believe it's due to the lazy theme loading introduced in https://github.com/sharkdp/bat/releases/tag/v0.19.0)

I just wanted to give a heads-up that an upcoming release of bat will begin to also lazy-load syntaxes, which will constitute another breaking change in the same way that lazy-loading of themes did.

Essentially, bat makes no guarantees about backwards compatibility between 0.x.0 releases. But in practice we try to be somewhat nice about backwards compatibility even between 0.x.0 releases.

@aperum
Copy link

aperum commented May 17, 2022

This is still an issue with current versions:

$ delta --version
delta 0.13.0
$ bat --version
bat 0.20.0 (0655ecf2)

$ pacman -Qi git-delta bat | grep Version
Version         : 0.13.0-1
Version         : 0.20.0-2

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

This is on Arch with the repo versions.
Clearing the cache gets itgoing again but as soon as i rebuild the cache the error is back. And i really like to use my theme ;)

@dandavison
Copy link
Owner

Hi @aperum, can you try upgrading to the latest bat (v0.21.0) and rebuilding your cache?

@aperum
Copy link

aperum commented May 17, 2022

With 0.21.0 it works. Should have checked for a newer version upstream, sorry for the noise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants