<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div class="gmail_quote">Hi Matthias,</div><div class="gmail_quote"><br></div><div class="gmail_quote">On Thu, Apr 13, 2017 at 2:13 PM, darken <span dir="ltr"><<a href="mailto:darken@darken.eu" target="_blank">darken@darken.eu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="auto"><div>I'm not sure how to use strace, how do I get a strace binary into the Android O image?<br></div><div dir="ltr"><br>Can't reproduce it on the X86 Android O emulator image.<br>But can reproduce it on my Pixel running Android O.<br></div></div><div>Tried the latest toybox build too but it's not the build, and when running it as shell user (adb) it works:<br></div><div class="gmail_extra"><div dir="ltr"><br>> sailfish:/data/local/tmp $ ./toybox_new find '/data/local/tmp' -maxdepth 0  -print0 | ./toybox_new xargs -0 echo<br>> /data/local/tmp<br>> sailfish:/data/local/tmp $ ./toybox_old find '/data/local/tmp' -maxdepth 0  -print0 | ./toybox_old xargs -0 echo<br>> /data/local/tmp<br>> sailfish:/data/local/tmp $ ./toybox_new --version<br>> toybox 0.7.3-37-g04940678c81a<br>> sailfish:/data/local/tmp $ ./toybox_old --version<br>> toybox 0.7.2-37-g109a28b8a749<br><br></div><div>So it works as shell user, but not as app user.<br>But it also works if the app runs the native toybox from /system.<br>Is this some kind of SELinux issue? <br>Preventing xargs from forking processes or something like that?<br><br></div>Why would it work on the emulator though...<br></div></div></blockquote><div><br></div><div>This sounds like it may be seccomp, a Linux kernel facility for restricting the set of system calls a process may make. It is enforced at the zygote level so would affect attempts from apps but presumably not the shell. It is configured with the list of system calls in bionic (SYSCALLS.TXT) as well as a whitelist (SECCOMP_WHITELIST.TXT):</div><div><br></div><div><a href="https://android.googlesource.com/platform/bionic/+/o-preview/libc/">https://android.googlesource.com/platform/bionic/+/o-preview/libc/</a><br></div><div><br></div><div>These lists are architecture specific. This is where seccomp was enforced at the zygote level:</div><div><br></div><div><a href="https://android.googlesource.com/platform/system/core/+/c4af05f8a3d67b9a4288a2b37c7fc16755497f6b">https://android.googlesource.com/platform/system/core/+/c4af05f8a3d67b9a4288a2b37c7fc16755497f6b</a></div><div><br></div><div>You could try disabling seccomp in Zygote:</div><div><a href="https://android.googlesource.com/platform/frameworks/base/+/o-preview/core/java/com/android/internal/os/ZygoteInit.java#696">https://android.googlesource.com/platform/frameworks/base/+/o-preview/core/java/com/android/internal/os/ZygoteInit.java#696</a><br></div><div><br></div><div>cheers,</div><div>Steve</div><div><br></div><div><br></div></div></div></div></div>