I am using Linux Mint 21 and had to compile some programs from source, so I manually updated MANPATH to include their man pages. However when I try to view them, I get the following line at the bottom of the pager (see screenshot):
gzip: stdout: Permission denied
The man page opens without any problem, but I would nevertheless like to fix this issue.
I have verified that the path from which the man page is opening is the path I set in MANPATH.
$ man --path xdotool
/home/<path-to-files>/xdotool/man/man1/xdotool.1
It is also not specific to the above man page, the same issue is in all the man pages I have added locally through setting MANPATH.
This isn't a solution to the problem but does show the reason for it. I followed @Charles Duffy 's advice and looked through the strace logs using the following command
Then I searched among the files for
denied(i.e. the process whichexecve'd gzip and gave this error), which gives me the pid where thewritecall failed. Inside there I traced back the lastdup2call, which gave me the fd 4 (dup2ed and closed). I verified that this itself wasn'tduped before in this process and began checking the parent process log for this fd.In the parent process, the last
open/openatcall that created fd 4 beforeclonewas called to spawn the child process was:I verified this wasn't closed before
clone. Ahead of this I can't figure out whygzipisn't invoked at all when the terminal is resized, or why it is unable to write to that file.