[Toybox] Moving ps name fields around.

Rob Landley rob at landley.net
Tue Jun 14 13:50:23 PDT 2016


On 06/13/2016 07:29 PM, enh wrote:
> AOSP is now using this, and ps lgtm.

Yay!

> i also think NAME and CMD now gives me what i need for top, so i'll
> take another look at getting that switched over this week.

Let me know if I need to change anything else.

> (why did it take me 3 days to run 'ps'? my laptop died last week, and
> on Friday i left my development N9 in the bootloader -- where the
> screen eats more power than USB can supply, and there's no screensaver
> -- so by the time i had a working laptop again on Sunday, the device
> on my desk on the other end of the ssh connection was dead.)

Ouch.

This week all the j-core devs are here in Austin having an Engineering
Thing for four days, so I was in meetings all day monday, and all day
today, and have meetings all day through thursday. My brain filled up
about noon yesterday.

I have giant todo list of doom and no time this week to chip away at it...

One thing I am doing is git bisecting the glibc repo to see where the
original grep bug got introduced. It reproduces with 2.15, and 2.14
build breaks with ubuntu 14.04's glibc because an always_inline fails to
inline. I'm currently git bisecting between .14 and .15 to see where
that got fixed, but it's one of this "git bisect good means it has the
bug, git bisect bad means the bug was fixed" because bisect thinks bugs
are introduced, never fixed, so bad must always be before good, which is
STUPID and I keep doing a bisect in the middle wrong and having to back up.

If I manage to do my git reimplementation, bad and good will bisect
between whichever darn endpoints you feed it. Grrr...

>> COMMAND is COMM without stripping the path.
>>
>> I note that in CMDLINE I could quote each argument, and put
>> backslashes before quote characters and backslashes. That's
>> _the_ simplest escaping mechanism.

I took a look at what would be involved in giving the security guys the
interface they wanted, and it turns out to be hard.

The current design is that the string fields are preprocessed when the
data is read, and then output verbatim. This means the 260 byte output
buffer length limitation doesn't apply to security label or command line
(instead the ~3500 byte shared buffer limit does).

But unquoted args and quoted cmdline printing from the same buffer...
would suck. I'd have to copy it to the temp output buffer, limiting
length to 260 bytes. Changing the design to malloc and free data
involves tracking object lifetimes and makes nommu really unhappy, it's
possible but intrusive.

Rob



More information about the Toybox mailing list