New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problems instrumenting Android applications #6
Comments
Thanks for your tests and reports @edermi ! |
So, I tried again today. I made a complete fresh build of Valgrind with latest NDK (r11b), this is the logcat when starting the app:
After that, those errors repeat but the app seems to work. The trace is still not usable. I also tried with vim touch from F-Droid which throws the same errors when filtering on |
Today I tried the native activity example, compiled with latest stable Android Studio (1.5.1) and NDK 11 using default settings (I shortened the package name in order to attach valgrind, but apart from that the code can be found 1:1 on github). The example works but the same errors occur. I'm still on a Nexus 6 with rooted Stock Android 6. |
thanks! didn't have the time to follow up yet, sorry |
No problem! It seems that some binaries of the system are affected as well. The simplest way to reproduce it and get a clean output seems to be running dex2oat:
classes.dex may be obtained by simply unzipping any Android apk and pushing it to the device. Filters may be set appropriate du get something in the trace. This gives the following output:
|
I tested everything on different devices and older Android versions. |
There was recently an update of valgrind with the version 3.12. It might be interesting to retest the tracer with this version. |
Currently I'm trying to trace Android applications on a real device (Nexus 6, rooted, Stock ROM Android 6).
I'm running the valgrind build from the wiki page which works fine on preinstalled binaries and busybox, but when it comes to real android applications there are some problems.
Instrumenting an android application works roughly like described here: http://stackoverflow.com/questions/13531496/cant-run-a-java-android-program-with-valgrind/19235439#19235439
I've got this /data/local/start_valgrind.sh:
To actually run the application with valgrind attached to foo.so, it's required to disable SELinux via
setenforce 0
because valgrind and SELinux do not seem to be best friends on Android 6.After that, setting
PACKAGE="foo.bar.baz"
andsetprop wrap.$PACKAGE "logwrapper /data/local/start_valgrind.sh"
, starting the app on the phone brings up valgrind, too.In logcat, I can see logs like those:
The recovered trace can not be decoded by text-/sqlitetrace, I'm getting errors like:
The app I'm testing is proprietary from Google Play Store. I noticed this behaviour on different apps but if you require the name of this specific app I'm going to send you an E-Mail.
As I said, regular binaries work fine.
BTW, feel free to add the steps above to the wiki article's TODO-section :)
The text was updated successfully, but these errors were encountered: