[Toybox] ps crashes

Rob Landley rob at landley.net
Thu Jun 15 14:51:22 PDT 2017


On 06/15/2017 04:27 PM, enh wrote:
> a new report today (from a build from yesterday that does have the `if
> (new->child == DIRTREE_ABORTVAL) new->child = 0;` patch):

Sigh.

> pid: 16725, tid: 16725, name: ps  >>> ps <<<
> signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x10
> x0   0000000000000000  x1   0000000000000000  x2   0000000000000000
> x3   0000007fc05036e8
> x4   0000007ccc157174  x5   0000007ccc01d08b  x6   7365636f72702e64
> x7   616964656d2e7373
> x8   0000000000000000  x9   0000000000000001  x10  0000000000004001
> x11  0000000000000000
> x12  000000000000000f  x13  0000007ccc790c94  x14  0000007ccc790938
> x15  0000000000000001
> x16  0000007ccc7ae2c0  x17  0000007ccc74d80c  x18  000000000000000d
> x19  0000007ccc0350c0
> x20  0000000000000000  x21  000000556e5bf790  x22  000000556e5bc768
> x23  0000000000000654
> x24  0000000000000040  x25  0000007ccc035010  x26  0000000000000000
> x27  0000000000000000
> x28  0000000000000000  x29  0000007fc0503ee0  x30  000000556e593470
> sp   0000007fc0503eb0  pc   000000556e593478  pstate 0000000080000000
> 
> Stack Trace:
>   RELADDR           FUNCTION                     FILE:LINE
>   0000000000034478  get_threads+228
> external/toybox/toys/posix/ps.c:917 (discriminator 1)

Line 917 is while (dt->child)... any chance _that_ got set to
DIRTREE_ABORTVAL?

Grrr.

The problem with the help plumbing is is collates hunks with matching
"usage: cmdname" lines and the common blocks in ps are trying to do
"usage: *" and have the "depends on" info specify which block to
collate, but config2help.c isn't actually using the depends on info.
(It's collecting it and putting it in the structures, but nothing's
using it.)

So I switched it the ps hunks to say "usage: top|iotop" and taught the
plumbing to iterate through those and match the currently active name
against any of them.

The problem is it's iterating through the hunks BACKWARDS (and the
collating code is depending on that to get the text chunks in the right
order), so grabs "top|iotop" as the name to _match_ so the extra
iteration I added is in the wrong place.

Working on it. Lemme finish the help thing, cut the release, then I have
pending pings from Josh Gao and Ilya Kuzmich, and then this is next on
the list.

(Mostly through the cold though. that was an unpleasant couple of weeks.)

Rob



More information about the Toybox mailing list