From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin-patches@cygwin.com
Subject: Re: /proc/<pid>/{cwd, root} links to <defunct> for cygrunsrv, daemons, and shells
Date: Tue, 9 Apr 2024 15:08:26 +0200 [thread overview]
Message-ID: <ZhU9yqAGCtJzcNGn@calimero.vinschen.de> (raw)
In-Reply-To: <0df79ac3-02ea-4180-8177-375407dee2a1@SystematicSW.ab.ca>
On Apr 7 13:34, Brian Inglis wrote:
> ISTM anomalous that for cygrunsrv, daemons, cron processes, and shells
> /proc/<pid>/{cwd,root} have bad symlinks to "<defunct>", normally a process
> or exe status:
>
> /proc/732/exe -> /usr/bin/cygrunsrv
> /proc/732/root -> <defunct>
> /proc/732/cwd -> <defunct>
> | /proc/733/exe -> /usr/sbin/cygserver
> ->/proc/733/root -> <defunct>
> /proc/733/cwd -> <defunct>
> /proc/740/exe -> /usr/bin/cygrunsrv
> /proc/740/root -> <defunct>
> /proc/740/cwd -> <defunct>
> | /proc/741/exe -> /usr/sbin/syslog-ng
> ->/proc/741/root -> <defunct>
> /proc/741/cwd -> <defunct>
> /proc/748/exe -> /usr/bin/cygrunsrv
> /proc/748/root -> <defunct>
> /proc/748/cwd -> <defunct>
> | /proc/749/exe -> /usr/sbin/cron
> ->/proc/749/root -> <defunct>
> /proc/749/cwd -> <defunct>
> | /proc/2080/exe -> /usr/sbin/cron
> ->/proc/2080/root -> <defunct>
> /proc/2080/cwd -> <defunct>
> | /proc/2082/exe -> /usr/bin/bash
> ->/proc/2082/root -> <defunct>
> /proc/2082/cwd -> <defunct>
>
> Should we consider changing that to root "/", or nothing, null, or something
> meaningful?
That's typically a permission problem. On Linux you get something like
ls: cannot read symbolic link '/proc/1/cwd': Permission denied
But on Cygwin the content of those links require to open the processes'
signal pipe and send/receive a message containing the information. I
didn't look into the code for a while but it seems we don't check why we
couldn't connect to a process to fetch the info. IIRC the current
fhandler_process framework doesn't have a way to communicate that
info.
If you want to change that, feel free!
Corinna
next prev parent reply other threads:[~2024-04-09 13:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-07 19:34 /proc/<pid>/{cwd,root} " Brian Inglis
2024-04-09 13:08 ` Corinna Vinschen [this message]
2024-04-09 16:38 ` /proc/<pid>/{cwd, root} " Brian Inglis
2024-04-09 21:24 ` Corinna Vinschen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZhU9yqAGCtJzcNGn@calimero.vinschen.de \
--to=corinna-cygwin@cygwin.com \
--cc=cygwin-patches@cygwin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).