GithubHelp home page GithubHelp logo

`nhi` doesn't record commands about nhi HOT 18 CLOSED

crides avatar crides commented on May 25, 2024
`nhi` doesn't record commands

from nhi.

Comments (18)

crides avatar crides commented on May 25, 2024 1

Yep that works with tmux + my .zshrc for saving command outputs, but doesn't seem to catch the finish of the sessions (that won't matter to me much, but may be something for you to look into).

Thanks for the help!

from nhi.

strang1ato avatar strang1ato commented on May 25, 2024

@crides
Can you show me the content of /tmp/nhi.log file (this file is created if error occurs, if it doesn't exist that's okay. You need root access to access that file).

and can you run this command and send me the output:

getent group tty

And check if source /etc/nhi/nhi.bash is added to the end of .bashrc or source /etc/nhi/nhi.zsh to the end of .zshrc, accordingly to your shell of choice

from nhi.

crides avatar crides commented on May 25, 2024

Contents of /tmp/nhi.log:

2021-11-13 22:28:52 | process_vm_readv failed at get_shell_environ
2021-11-13 22:28:52 | no such table: 0
2021-11-13 22:28:53 | process_vm_readv failed at get_shell_environ
2021-11-13 22:28:53 | no such table: 0
2021-11-13 22:28:57 | process_vm_readv failed at get_shell_environ
2021-11-13 22:28:57 | no such table: 0
2021-11-13 22:29:02 | process_vm_readv failed at get_shell_environ
2021-11-13 22:29:02 | no such table: 0
2021-11-13 22:29:05 | process_vm_readv failed at get_shell_environ
2021-11-13 22:29:05 | no such table: 0
2021-11-13 22:29:08 | process_vm_readv failed at get_shell_environ
2021-11-13 22:29:08 | no such table: 0
2021-11-13 22:29:12 | process_vm_readv failed at get_shell_environ
2021-11-13 22:29:12 | no such table: 0
2021-11-13 22:29:16 | process_vm_readv failed at get_shell_environ
2021-11-13 22:29:16 | no such table: 0
2021-11-13 22:54:52 | process_vm_readv failed at get_shell_environ
2021-11-13 22:54:52 | no such table: 0
2021-11-13 22:55:00 | process_vm_readv failed at get_shell_environ
2021-11-13 22:55:00 | no such table: 0
2021-11-13 22:55:02 | process_vm_readv failed at get_shell_environ
2021-11-13 22:55:02 | no such table: 0
2021-11-13 22:56:31 | process_vm_readv failed at get_shell_environ
2021-11-13 22:56:31 | no such table: 0
2021-11-13 22:58:12 | process_vm_readv failed at get_shell_environ
2021-11-13 22:58:12 | no such table: 0
2021-11-13 22:58:13 | process_vm_readv failed at get_shell_environ
2021-11-13 22:58:13 | no such table: 0
2021-11-13 22:59:56 | process_vm_readv failed at get_shell_environ
2021-11-13 22:59:56 | no such table: 0
2021-11-13 23:00:38 | process_vm_readv failed at get_shell_environ
2021-11-13 23:00:38 | no such table: 0
$getent group tty
tty:x:5:brltty

And yes, I do have source /etc/nhi/nhi.zsh in .zshrc

from nhi.

strang1ato avatar strang1ato commented on May 25, 2024

Can you execute one last command: objdump -T $(which zsh) | awk -v sym=environ ' $NF == sym && $4 == ".bss" { print $1; exit }' and also post here the output

from nhi.

crides avatar crides commented on May 25, 2024

Output is: 00000000000d4da0

from nhi.

strang1ato avatar strang1ato commented on May 25, 2024

I think that I need to replicate this bug myself, what distro are you using?

from nhi.

crides avatar crides commented on May 25, 2024

Arch. And just in case terminal matters for some reason, it's Alacritty

Thanks for the fast responses by the way.

from nhi.

strang1ato avatar strang1ato commented on May 25, 2024

I will install Alacritty on my arch device and will let you know how it went.

Also, can you temporarly comment out everything besides source /etc/nhi/nhi.zsh from you .zshrc and restart your terminal and see if nhi works?

from nhi.

crides avatar crides commented on May 25, 2024

Hmm it does, but only outside of tmux.

And I might bisect the .zshrc later, but it's here if you want to see it. I do have some local changes not yet commited but those are just aliases and functions.

from nhi.

strang1ato avatar strang1ato commented on May 25, 2024

So without tmux everything works fine? Keep in mind that some shell builtins are not being traced yet, however everything else is traced.

from nhi.

crides avatar crides commented on May 25, 2024

Without tmux and without my .zshrc that is. And I'm testing using the finish time in nhi log

from nhi.

strang1ato avatar strang1ato commented on May 25, 2024

But does without tmux and with your zshrc everything works?

from nhi.

crides avatar crides commented on May 25, 2024

No

from nhi.

strang1ato avatar strang1ato commented on May 25, 2024

@crides
Okay I found why nhi wasn't working with your .zshrc and how to fix that. For now I found only "dirty fix", but it works. I will try to fix and patch repository in a few days. (You will need to replace current nhid binary (and maybe nhi.bpf.o file) with new/future one)

(I did not test it on tmux though)

from nhi.

crides avatar crides commented on May 25, 2024

Thanks! I'll checkout the commit later (after it happens)

from nhi.

strang1ato avatar strang1ato commented on May 25, 2024

@crides I will let you know when it will be done, in this issue, and create a new release with the patch

from nhi.

strang1ato avatar strang1ato commented on May 25, 2024

@crides
Should be fixed 👍 in your case download nhid only (from v0.2.2 release) and replace it in the place of old nhid in /usr/bin and give 755 permission to the new nhid and restart your computer.

from nhi.

strang1ato avatar strang1ato commented on May 25, 2024

tmux may break some stuff, but if it works that's good. For now I make sure that nhi supports bash and zsh (without multiplexers and stuff like that).

from nhi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.