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

Issue on arch #23

Open
3isenHeiM opened this issue Jul 3, 2024 · 4 comments
Open

Issue on arch #23

3isenHeiM opened this issue Jul 3, 2024 · 4 comments

Comments

@3isenHeiM
Copy link

I'm running ZSH on Arch, I've installed nhi but I have errors in the logs.

2024-07-03 16:22:13 | process_vm_readv failed at get_shell_environ
2024-07-03 16:22:13 | no such table: 0
2024-07-03 16:22:18 | process_vm_readv failed at get_shell_environ
2024-07-03 16:22:18 | no such table: 0
2024-07-03 16:22:24 | process_vm_readv failed at get_shell_environ
2024-07-03 16:22:24 | no such table: 0
2024-07-03 16:22:50 | process_vm_readv failed at get_shell_environ
2024-07-03 16:22:50 | no such table: 0
2024-07-03 16:22:52 | process_vm_readv failed at get_shell_environ
2024-07-03 16:22:52 | no such table: 0
  1. Install gave me this output :

    $ sudo -E bash ./install
    wal

    I don't know why it spit this "wal" string.

  2. Here is the result of getent group tty : tty:x:5:

I've looked into the get_shell_environ code, and these 2 function do not return anything :

objdump -T $(which bash) | awk -v sym=environ ' $NF == sym && $4 == ".bss"  { print $1; exit }'
objdump -T $(which zsh) | awk -v sym=environ ' $NF == sym && $4 ==".bss"  { print $1; exit }'

Digging deeper, there is indeed no match :

$ objdump -T $(which bash) | grep environ
0000000000000000      DO *UND*  0000000000000000 (GLIBC_2.2.5) environ
0000000000000000      DO *UND*  0000000000000000 (GLIBC_2.2.5) __environ
000000000010ff40 g    DO .bss   0000000000000008  Base        shell_environment
000000000010fe2c g    DO .bss   0000000000000004  Base        subshell_environment
0000000000111660 g    DO .bss   0000000000000004  Base        assigning_in_environment
$ objdump -T $(which zsh) | grep environ
0000000000000000      DO *UND*  0000000000000000 (GLIBC_2.2.5) environ
0000000000000000      DO *UND*  0000000000000000 (GLIBC_2.2.5) __environ

How can I solve this ?

Thanks :)

@strang1ato
Copy link
Owner

It looks like bash and zsh is stripped on arch. Have you installed bash and zsh from pacman?
If you compile bash or zsh in default way (aka without stripping), then the tool should work.

@strang1ato
Copy link
Owner

strang1ato commented Jul 3, 2024

It looks like some distros for some reason insist on stripping their sofrware in their default package manager, so it might be good to consider to somehow add support for the unstripped versions of bash and zsh as well

@3isenHeiM
Copy link
Author

Yeah I installed zsh with pacman

@strang1ato
Copy link
Owner

strang1ato commented Jul 4, 2024

@3isenHeiM So if you want an immediate solution, then you should compile shell without stripping. If you are willing to hack around you can try to add support for stripped shells (this link might be useful: https://shankaraman.wordpress.com/tag/finding-environment-variable-address-using-gdb/)

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

2 participants