[PATCH] Print more error messages
Dmitry V. Levin
ldv at altlinux.org
Thu Aug 20 16:57:13 UTC 2020
On Thu, Aug 20, 2020 at 06:39:30PM +0200, Ákos Uzonyi wrote:
> ---
>
> Could you please run the dup-y test again with this patch applied?
> Hopefully we'll see where the problem comes from.
>
> pidns.c | 15 ++++++++++++---
> 1 file changed, 12 insertions(+), 3 deletions(-)
>
> diff --git a/pidns.c b/pidns.c
> index 9d8695da..7e7d8212 100644
> --- a/pidns.c
> +++ b/pidns.c
> @@ -168,14 +168,18 @@ get_ns_hierarchy(int proc_pid, unsigned int *ns_buf, size_t ns_buf_size)
> xsprintf(path, "/proc/%s/ns/pid", pid_to_str(proc_pid));
>
> int fd = open_file(path, O_RDONLY);
> - if (fd < 0)
> + if (fd < 0) {
> + perror_func_msg("opening %s", path);
> return 0;
> + }
There are quite a few of these, e.g.
get_ns_hierarchy: opening /proc/1/ns/pid: Permission denied
but they are harmless.
> @@ -248,6 +254,9 @@ get_id_list(int proc_pid, int *id_buf, enum pid_type type)
> }
> }
>
> + if (!p)
> + error_func_msg("no line found starting with %s", ns_str);
Yes, that was it, it prints "no line found starting with NSpid:".
On that system I also see the following:
$ grep -c ^NS /proc/self/status
0
--
ldv
More information about the Strace-devel
mailing list