-
Notifications
You must be signed in to change notification settings - Fork 408
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 error for non root user #1712
Comments
Hi @rljohnsn, this memory allocation error has come up several times before in delta issues: https://github.com/dandavison/delta/issues?q=is%3Aissue+%22memory+allocation%22 It seems that it's always something to do with stale syntect syntax definitions. Can you try some of the remedies in those threads, such as installing bat and
|
In my situation, re-running This is with bat I do have a custom syntax for LDIF in |
What if you didn't have to guess? :) |
Because I was pretty sure my guess was right. :) This seemed like something you might like (me) to dig into, while I have the conditions set for a reproducible crash, since it appears to be a recurring problem. If your preferred solution is "just update |
Haha, thanks! It would be great to be able to state in the docs which version of bat delta requires. Hopefully it is largely predictable from semver semantics. I haven't checked, but suspect that the code we're using to read these bat assets is supplied by the bat library itself. So hopefully the answer is just that one must use a bat executable version that is, according to semver, compatible with the bat library version used by delta. Of course bat, like, delta, is still <v1 so every minor version may be a breaking change w.r.t. binary asset compat. |
OK, I can confirm that if I have $ curl -s https://raw.githubusercontent.com/dandavison/delta/refs/tags/0.18.1/Cargo.toml | grep ^bat
bat = { version = "0.24.0", default-features = false, features = [
$ type -a bat
bat is /some/path/modules/third-party/rust/1.84.0/CARGO_HOME/bin/bat
bat is /some/other/path/opt/bin/bat
$ bat --version
bat 0.24.0 (b8b8d15-modified)
$ bat cache --clear
Clearing theme set cache ... okay
Clearing syntax set cache ... okay
Clearing metadata file ... okay
$ bat cache --build
No themes were found in '/my/home/.config/bat/themes', using the default set
Writing theme set to /my/home/.cache/bat/themes.bin ... okay
Writing syntax set to /my/home/.cache/bat/syntaxes.bin ... okay
Writing metadata to folder /my/home/.cache/bat ... okay
$ delta --version
delta 0.18.2 So your theory checks out. Thanks! |
@dandavison Would you like a PR to update the docs, and if so, where at? The bottom of "Installation"? I suppose that would help distro packagers, too, assuming they look there. Otherwise I could foresee a situation where Would it be worth it to have delta itself check… somehow… that the |
That sounds good, thanks. If you do it, can you make it clear that bat is not required by delta. Rather it's that if you are using custom bat themes/syntaxes, then you must use a compatible bat version, since delta will automatically find your custom themes/syntaxes. |
It's entirely possible I was just sloppy and forgot a I'll confirm one way or the other with a more careful test, and report on whatever I find in the PR. |
The only connection between delta and bat is that delta uses the binary assets distributed by the bat project, and also some functions from the bat Rust crate related to invoking a pager. delta does not use the bat executable or require that it's installed; the delta executable contains its own copy of all the binary assets. I'm pretty sure that the only point of contact is that, if you've built custom bat assets using the |
I think a possible refinement of this statement would be "if you are using custom bat themes/syntaxes, or have voluntarily created a theme/syntax cache using $ rm -rf ~/.cache/bat
$ bat cache --build
No themes were found in '/home/me/.config/bat/themes', using the default set
No syntaxes were found in '/home/me/config/bat/syntaxes', using the default set.
Writing theme set to /home/me/.cache/bat/themes.bin ... okay
Writing syntax set to /home/me/.cache/bat/syntaxes.bin ... okay
Writing metadata to folder /home/me/.cache/bat ... okay Apart from that, we are in accord! It's not likely anyone will have done this intentionally unless they had custom themes or syntaxes, but the mere presence of a |
Right, agreed, your version is more accurate. |
- make explicit mention of which bat version should be installed in the "Installation" and "Supported languages and themes" sections of the manual - add missing "Tips & tricks" page See dandavison#1712 for context.
Bat at v0.18.3 seems to be where the problems arise. Here's the |
- make explicit mention of which bat version should be installed in the "Installation" and "Supported languages and themes" sections of the manual - add missing "Tips & tricks" page See dandavison#1712 for context.
- make explicit mention of which bat version should be installed in the "Installation" and "Supported languages and themes" sections of the manual - add missing "Tips & tricks" page See #1712 for context.
After install a non root user gets a memory error. Running as root works fine.
Windows 11, WSL2, Ubuntu 22.04
Delta version: https://github.com/dandavison/delta/releases/download/0.17.0/git-delta_0.17.0_amd64.deb
The text was updated successfully, but these errors were encountered: