[Aboriginal] [Toybox] 3efd6d9512ac8c9370d62fcaa08d31c28bba1810 broke ps without a tty

enh enh at google.com
Sat Feb 4 11:03:08 PST 2017


On Sat, Feb 4, 2017 at 9:27 AM, Rob Landley <rob at landley.net> wrote:
> On 02/03/2017 07:04 PM, enh wrote:
>> (i've been trying to find time to look at this for days, but it's time
>> to admit to myself that i won't and report what i've found...)
>
> I actually found that yesterday but haven't checked in a fix yet.
>
> The main holdup on cutting the toybox release has been that aboriginal
> linux hasn't been a functional test bed to find obvious regressions like
> this for a while, so I've been banging on
> https://github.com/richfelker/musl-cross-make to get toolchains out of
> that (using the attached build script), then banging on
> https://github.com/landley/mkroot to get it up to speed as a root
> filesystem builder, and now I'm trying to figure out what the kernel
> build script part should look like. (So far I still need 2/3 of the old
> sources/targets from aboriginal, although maybe I can do it as an
> if/else staircase in one script.)
>
> And I got far enough to notice that ps was nuts on a serial console,
> because setting the default width to 99999 _without_ setting FLAG_w
> cause it to try to _pad_ each line out to 99999 with spaces.
>
> Oops.
>
> If the size probe fails I can set the default width to 80 instead of
> 99999, or I can set FLAG_w. Not sure which is better yet. (With 80 the
> columns would at least line up,and you can always export COLUMNS=123 if
> you need a specific different size.

without a tty is the default for Android, where most folks are using
"adb shell ..." or moral equivalent. (similar to running everything
via ssh.) so you can't really tell the difference between "i'm a
programmatic use" and "i'm a human hiding behind something like ssh".

-w would certainly be less disruptive for Android use cases (because
it won't break scripts; traditional Android ps _always_ overflowed).

> In theory the ANSI size probe should go in here somewhere. In practice
> we're not already reading data from stdin so parsing the results isn't a
> natural part of the program flow.
>
> (I note that top is also glitched without a tty. I suspect receipt of
> the ansi probe causes a redraw... which sends out a new ansi probe.)

quitting top if it ran like this is weird too. the escape sequences to
reset the terminal don't make it. i've never mentioned it because i
don't have any suggestion for how we could do better.

> Moral of the story: don't let your main test environment fall too far
> behind or stupid stuff accumulates. I'm working on it...
>
> Rob
>
> P.S. I've spent hours trying to come up with a proper news entry for
> aboriginal that covers why I ended the project and what I'm replacing it
> with, but
> http://lists.landley.net/pipermail/aboriginal-landley.net/2017-January/002594.html
> is the closest I've come up with so far.



-- 
Elliott Hughes - http://who/enh - http://jessies.org/~enh/
Android native code/tools questions? Mail me/drop by/add me as a reviewer.


More information about the Aboriginal mailing list