extern "C"
JNIEXPORT jstring
JNICALL
Java_android_apple_com_memorydebuggingtest_MainActivity_stringFromJNI(
JNIEnv *env,
jobject /* this */) {
std::string hello = "Hello from C++";
char* ptr = (char*) malloc(1024 * 1024 * sizeof(char*));
ptr = nullptr;
return env->NewStringUTF(hello.c_str());
}
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/65e537a0-2e28-4291-8267-ca8983e15e2e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
LIBC_DEBUG_MALLOC_OPTIONS=backtrace logwrapper leak_track $@Yes, my apk is debugable<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="android.apple.com.memorydebuggingtest">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:debuggable="true"
+cferrisWhat does your wrap.sh look like? Is your APK debuggable?
On Fri, Jun 1, 2018, 11:14 Memo Rodriguez <memo...@gmail.com> wrote:
hi--I want to start using the new memory debugging tools that were introduced with the ndk toolchain. I've been looking into how to use the malloc debug in combination with the wrap shell script. I've created a simple toy example that allocates 1MB without freeing the memory but unfortunately I haven't been able to see the leak being reported in my adb logs.extern "C"
JNIEXPORT jstring
JNICALL
Java_android_apple_com_memorydebuggingtest_MainActivity_stringFromJNI(
JNIEnv *env,
jobject /* this */) {
std::string hello = "Hello from C++";
char* ptr = (char*) malloc(1024 * 1024 * sizeof(char*));
ptr = nullptr;
return env->NewStringUTF(hello.c_str());
}I'm using a non-rooted pixel 2 with android 8.1, the documentation doesn't mentioned that the device should be rooted. Can you guys confirm?, do you guys have any toy examples that could enforce and report a leak?thxMemo
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk+unsubscribe@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/65e537a0-2e28-4291-8267-ca8983e15e2e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk+unsubscribe@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/CAFVaGhvUYzuPzzR_2nAXOSA%2Bvc5dZybYFppeGQsAE8gNWs14Tw%40mail.gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/65e537a0-2e28-4291-8267-ca8983e15e2e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/CAFVaGhvUYzuPzzR_2nAXOSA%2Bvc5dZybYFppeGQsAE8gNWs14Tw%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/CANRwJTHvExD7DO8yWrnjBt9yBcxp1pK%3DG6siT6tabEA%2BU3S3iA%40mail.gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk+unsubscribe@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/65e537a0-2e28-4291-8267-ca8983e15e2e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk+unsubscribe@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/CAFVaGhvUYzuPzzR_2nAXOSA%2Bvc5dZybYFppeGQsAE8gNWs14Tw%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk+unsubscribe@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/CANRwJTHvExD7DO8yWrnjBt9yBcxp1pK%3DG6siT6tabEA%2BU3S3iA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk+unsubscribe@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/CAFVaGhupDj2NJu1NZ5Fe%2BU8nh%3DJmq_RKS0PVF7-fJOCwK8b8Ag%40mail.gmail.com.
I think this should work on a non-rooted phone. If you have the ability to see the logcat output, you should see a message something with a "malloc debug enabled" message.However, looking at your wrap.sh, I believe the environment variable is a bit off.This should be:LIBC_DEBUG_MALLOC_OPTIONS=backtrace logwrapper leak_track $@You can also try just leak_track if you suspect that even that's not working properly, but I think this should be good to go. I think we should probably add some extra documentation showing how to use multiple options since it can be tricky.LIBC_DEBUG_MALLOC_OPTIONS="backtrace leak_track" logwrapper $@Christopher
This should be:LIBC_DEBUG_MALLOC_OPTIONS=backtrace logwrapper leak_track $@
You can also try just leak_track if you suspect that even that's not working properly, but I think this should be good to go. I think we should probably add some extra documentation showing how to use multiple options since it can be tricky.LIBC_DEBUG_MALLOC_OPTIONS="backtrace leak_track" logwrapper $@
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/65e537a0-2e28-4291-8267-ca8983e15e2e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/CAFVaGhvUYzuPzzR_2nAXOSA%2Bvc5dZybYFppeGQsAE8gNWs14Tw%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/CANRwJTHvExD7DO8yWrnjBt9yBcxp1pK%3DG6siT6tabEA%2BU3S3iA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/65e537a0-2e28-4291-8267-ca8983e15e2e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/CAFVaGhvUYzuPzzR_2nAXOSA%2Bvc5dZybYFppeGQsAE8gNWs14Tw%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/CANRwJTHvExD7DO8yWrnjBt9yBcxp1pK%3DG6siT6tabEA%2BU3S3iA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To unsubscribe from this group and stop receiving emails from it, send an email to andro...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/65e537a0-2e28-4291-8267-ca8983e15e2e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to andro...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/CAFVaGhvUYzuPzzR_2nAXOSA%2Bvc5dZybYFppeGQsAE8gNWs14Tw%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to andro...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/CANRwJTHvExD7DO8yWrnjBt9yBcxp1pK%3DG6siT6tabEA%2BU3S3iA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to andro...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
Hi, I am trying to set malloc_debug property to backtrace in PIE but i am not able to do so.Can anyone help??
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/b48c5535-d1a3-416b-b2d9-d4f3e9fa6b31%40googlegroups.com.