[PATCH] Print more error messages
Dmitry V. Levin
ldv at altlinux.org
Thu Aug 20 18:12:27 UTC 2020
On Thu, Aug 20, 2020 at 07:54:34PM +0200, Ákos Uzonyi wrote:
> On Thu, 20 Aug 2020 at 18:57, Dmitry V. Levin <ldv at altlinux.org> wrote:
> > On Thu, Aug 20, 2020 at 06:39:30PM +0200, Ákos Uzonyi wrote:
[...]
> > > @@ -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
>
> Nice, thanks.
>
> Then I think we should modify this line a bit in is_proc_ours:
>
> - cached_val = get_id_list(0, NULL, PT_TID) == 1;
> + cached_val = get_id_list(0, NULL, PT_TID) <= 1;
>
> So in case get_id_list returns 0, we consider /proc to be ours, as
> this most probably means there is no PID namespace support in the
> kernel.
Yes, makes sense.
--
ldv
More information about the Strace-devel
mailing list