dandavison / delta

A syntax-highlighting pager for git, diff, grep, and blame output
https://dandavison.github.io/delta/
MIT License
21.32k stars 358 forks source link

🐛 Memory allocation error for non root user #1712

Open rljohnsn opened 1 month ago

rljohnsn commented 1 month ago

After install a non root user gets a memory error. Running as root works fine.

❯ sudo delta
[sudo] password for lance:
The main way to use delta is to configure it as the pager for git: see https://github.com/dandavison/delta#get-started. You can also use delta to diff two files: `delta file_A file_B`.
❯ ls -laF /usr/bin/delta
-rwxr-xr-x 1 root root 7059472 Mar 16 07:28 /usr/bin/delta*
❯ ldd /usr/bin/delta
        linux-vdso.so.1 (0x00007ffc8659b000)
        libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f9701de0000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f9701dc0000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f9701cd9000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f9701ab0000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f97024c2000)
❯ delta
memory allocation of 1970324836974592 bytes failed
[1]    11340 IOT instruction  delta
❯ sudo delta
The main way to use delta is to configure it as the pager for git: see https://github.com/dandavison/delta#get-started. You can also use delta to diff two files: `delta file_A file_B`.
❯ uname -a
Linux DESKTOP-UE7J8VS 5.15.146.1-microsoft-standard-WSL2 #1 SMP Thu Jan 11 04:09:03 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
❯ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.4 LTS
Release:        22.04
Codename:       jammy

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

dandavison commented 1 month ago

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

bat cache --clear
bat cache --build