Re: three for newlib

Craig Small <[email protected]> Sat, 18 Dec 2021 08:50:04 +1100
Newsgroups gmane.linux.procps.devel
Message-ID <CALy8Cw5VkEWtWOZZDnJsXJvkQLZi4h+xdk+J=7OmS_dJ5gqs3w@mail.gmail.com>
Hi Jim,
 That patch is pushed, makes top a little bare now but that's all the
information it is given that's all it can show.

The configure flag was --enable-harden-flags it shows some
format-truncation errors.

So one of the interesting failure modes with the library is for certain
fields that need system fields.
An example is pgrep with --older. It needs the PIDS field TIME_ELAPSED.
That is calculated with the processes start_time (which it can get) and the
system seconds since boot (which it cannot). The library checks to see if
the boot happens before the process started and if so subtracts them
otherwise return zero.
For a subset=pid system, it returns zero. Is this the correct answer or
should it return an error?

There's probably a bunch of other fields like this.

 - Craig


On Fri, 17 Dec 2021 at 06:28, Jim Warner <[email protected]> wrote:

> On 12/16/21 3:48 AM, Craig Small wrote:
> > At first I was, well they won't work and for oldlib it probably would
> > be too difficult. With newlib I've think we have a chance to get some of
> > these working.
> > It puts the library into an interesting state too.
>
> Hi Craig,
>
> Attached is my attempt at a top subset=pid response.
>
> I think we're approaching this from the correct direction.  Namely, this
> issue shouldn't involve the library at all.  Rather, each application
> must decide if and how it responds to an otherwise fatal error.
>
> And I also agree that oldlib should be ignored.
>
> Any feedback would be welcomed.
>
> Regards,
>
> Jim
>
> p.s. I made no effort to update NEWS - thought it best to wait 'til the
> dust settles.
>