[Toybox] top -H segfault
Rob Landley
rob at landley.net
Thu May 26 11:19:43 PDT 2016
On 05/25/2016 04:35 PM, enh wrote:
> On Wed, May 25, 2016 at 1:59 PM, enh <enh at google.com> wrote:
>> On Tue, May 24, 2016 at 2:23 PM, Rob Landley <rob at landley.net> wrote:
>>> Null dereference on *otb and *ntb because now you traverse the tree in
>>> order and keep each node that has a non-null ->extra field.
>>>
>>> Try now?
>>
>> (sorry, was too busy to get back to this until now...)
>>
>> yes, works for me now, and i probably wouldn't have found that myself
>> in a reasonable amount of time anyway!
>>
>> "toybox top -b -n 1 -o
>> pid,tid,user,pr,ni,%cpu,s,vsz,rss,pcy,command,name -s 6" now looks
>> close enough to what dumpstate wants for bug reports that i can give
>> it a go...
>
> actually, no, -o COMMAND isn't giving me what i thought. (previously
> i'd only tested on the desktop.) on Android everything shows up as
> /system/bin/app_process64 --- it's the first word of
> readlink('/proc/pid/exe').
Yes, that's what I implemented. I see that the ps help text is wrong though.
> (when the zygote forks it sets argv[0] to
> the package name of the app it's about to run, so you can see things
> like "com.android.inputmethod.latin" here.)
Sigh, figuring out the right thing to do is always the hard part.
Ok, so you need a -o that gives you thread parent argv[0]. Hmmm. The
reason I did exe is it's hard to distinguish argv[0] from argv[1-n] if
both come from /proc/$$/cmdline.
Probably the best thing to do is rename the current COMMAND behavior to
EXE and then implement a new COMMAND that does what you need with a
selective copy. Right, gimme a couple hours for that...
Rob
More information about the Toybox
mailing list