[Toybox] Android O: XARGS - bad system call

darken darken at darken.eu
Thu Apr 13 14:13:03 PDT 2017


I'm not sure how to use strace, how do I get a strace binary into the
Android O image?

Can't reproduce it on the X86 Android O emulator image.
But can reproduce it on my Pixel running Android O.
Tried the latest toybox build too but it's not the build, and when running
it as shell user (adb) it works:

> sailfish:/data/local/tmp $ ./toybox_new find '/data/local/tmp' -maxdepth
0  -print0 | ./toybox_new xargs -0 echo
> /data/local/tmp
> sailfish:/data/local/tmp $ ./toybox_old find '/data/local/tmp' -maxdepth
0  -print0 | ./toybox_old xargs -0 echo
> /data/local/tmp
> sailfish:/data/local/tmp $ ./toybox_new --version
> toybox 0.7.3-37-g04940678c81a
> sailfish:/data/local/tmp $ ./toybox_old --version
> toybox 0.7.2-37-g109a28b8a749

So it works as shell user, but not as app user.
But it also works if the app runs the native toybox from /system.
Is this some kind of SELinux issue?
Preventing xargs from forking processes or something like that?

Why would it work on the emulator though...

2017-04-13 18:29 GMT+02:00 enh <enh at google.com>:

> works fine for me with the toybox that's actually part of O. strace?
>
> On Thu, Apr 13, 2017 at 6:39 AM, darken <darken at darken.eu> wrote:
>
>> On a Pixel device running Android O, xarg doesn't seem to work.
>> The commands were run from an normal user (non-system app) without root.
>>
>> V/Shell:Interactive: Input : SDMBOX=/data/user/0/eu.thedark
>>> en.sdm/files/toybox_sdm
>>>
>>
>> Toybox build i used: https://github.com/d4rken/toybox
>>
>> Just running the FIND applet works:
>>
>> V/Shell:Interactive: Input : $SDMBOX find '/data/user/0/eu.thedarken.sdm
>>> /files'
>>>
>> V/Shell:Interactive: Output: /data/user/0/eu.thedarken.sdm/files
>>>
>> V/Shell:Interactive: Output: /data/user/0/eu.thedarken.sdm/
>>> files/uuid-token
>>>
>> V/Shell:Interactive: Output: /data/user/0/eu.thedarken.sdm/
>>> files/toybox_sdm
>>>
>> D/Shell:Interactive: runCommand(...): Command.Result(exitcode=0)
>>>
>>
>> With XARGS it doesn't work:
>>
>> V/Shell:Interactive: Input : $SDMBOX find '/data/user/0/eu.thedarken.sdm/files'
>>> -maxdepth 0  -print0 | $SDMBOX xargs -0 $SDMBOX echo
>>>
>> V/Shell:Interactive: Error : Bad system call
>>>
>> D/Shell:Interactive: runCommand(...): Command.Result(exitcode=159)
>>>
>>
>> Any idea why? Or how I could find out why?
>>
>> ~Matthias
>>
>> _______________________________________________
>> Toybox mailing list
>> Toybox at lists.landley.net
>> http://lists.landley.net/listinfo.cgi/toybox-landley.net
>>
>>
>
>
> --
> Elliott Hughes - http://who/enh - http://jessies.org/~enh/
> Android native code/tools questions? Mail me/drop by/add me as a reviewer.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20170413/bf684434/attachment-0002.htm>


More information about the Toybox mailing list