Discussion:
NDK 17 malloc debug wrap shell
Memo Rodriguez
2018-06-01 18:05:49 UTC
Permalink
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?

thx
Memo
--
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 android-***@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.
'Dan Albert' via android-ndk
2018-06-01 18:42:53 UTC
Permalink
+cferris

What does your wrap.sh look like? Is your APK debuggable?
Post by Memo Rodriguez
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?
thx
Memo
--
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
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
<https://groups.google.com/d/msgid/android-ndk/65e537a0-2e28-4291-8267-ca8983e15e2e%40googlegroups.com?utm_medium=email&utm_source=footer>
.
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 android-***@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.
For more options, visit https://groups.google.com/d/optout.
Memo Rodriguez
2018-06-01 18:46:53 UTC
Permalink
hi Dan

These are the contents of my wrap.sh

#!/system/bin/sh

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"




On Fri, Jun 1, 2018 at 11:42 AM, 'Dan Albert' via android-ndk <
Post by 'Dan Albert' via android-ndk
+cferris
What does your wrap.sh look like? Is your APK debuggable?
Post by Memo Rodriguez
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?
thx
Memo
--
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
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
<https://groups.google.com/d/msgid/android-ndk/65e537a0-2e28-4291-8267-ca8983e15e2e%40googlegroups.com?utm_medium=email&utm_source=footer>
.
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
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
<https://groups.google.com/d/msgid/android-ndk/CAFVaGhvUYzuPzzR_2nAXOSA%2Bvc5dZybYFppeGQsAE8gNWs14Tw%40mail.gmail.com?utm_medium=email&utm_source=footer>
.
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 android-***@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.
'Dan Albert' via android-ndk
2018-06-01 19:03:45 UTC
Permalink
It may be that malloc debug didn't work on unrooted devices until P. I'm
not very familiar with malloc debug, but I've CC'd the guy that is.
Post by Memo Rodriguez
hi Dan
These are the contents of my wrap.sh
#!/system/bin/sh
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:supportsRtl="true"
android:debuggable="true"
On Fri, Jun 1, 2018 at 11:42 AM, 'Dan Albert' via android-ndk <
Post by 'Dan Albert' via android-ndk
+cferris
What does your wrap.sh look like? Is your APK debuggable?
Post by Memo Rodriguez
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?
thx
Memo
--
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
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
<https://groups.google.com/d/msgid/android-ndk/65e537a0-2e28-4291-8267-ca8983e15e2e%40googlegroups.com?utm_medium=email&utm_source=footer>
.
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
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
<https://groups.google.com/d/msgid/android-ndk/CAFVaGhvUYzuPzzR_2nAXOSA%2Bvc5dZybYFppeGQsAE8gNWs14Tw%40mail.gmail.com?utm_medium=email&utm_source=footer>
.
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
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
<https://groups.google.com/d/msgid/android-ndk/CANRwJTHvExD7DO8yWrnjBt9yBcxp1pK%3DG6siT6tabEA%2BU3S3iA%40mail.gmail.com?utm_medium=email&utm_source=footer>
.
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 android-***@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.
For more options, visit https://groups.google.com/d/optout.
Memo Rodriguez
2018-06-01 19:13:54 UTC
Permalink
hi Dan

thx, I guess I can try running the same code on my emulator running P.

Memo

On Fri, Jun 1, 2018 at 12:03 PM, 'Dan Albert' via android-ndk <
Post by 'Dan Albert' via android-ndk
It may be that malloc debug didn't work on unrooted devices until P. I'm
not very familiar with malloc debug, but I've CC'd the guy that is.
Post by Memo Rodriguez
hi Dan
These are the contents of my wrap.sh
#!/system/bin/sh
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:supportsRtl="true"
android:debuggable="true"
On Fri, Jun 1, 2018 at 11:42 AM, 'Dan Albert' via android-ndk <
Post by 'Dan Albert' via android-ndk
+cferris
What does your wrap.sh look like? Is your APK debuggable?
Post by Memo Rodriguez
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?
thx
Memo
--
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
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
<https://groups.google.com/d/msgid/android-ndk/65e537a0-2e28-4291-8267-ca8983e15e2e%40googlegroups.com?utm_medium=email&utm_source=footer>
.
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
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
<https://groups.google.com/d/msgid/android-ndk/CAFVaGhvUYzuPzzR_2nAXOSA%2Bvc5dZybYFppeGQsAE8gNWs14Tw%40mail.gmail.com?utm_medium=email&utm_source=footer>
.
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
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/CANRwJTHvExD7DO8yWrnjBt9yBcxp1
pK%3DG6siT6tabEA%2BU3S3iA%40mail.gmail.com
<https://groups.google.com/d/msgid/android-ndk/CANRwJTHvExD7DO8yWrnjBt9yBcxp1pK%3DG6siT6tabEA%2BU3S3iA%40mail.gmail.com?utm_medium=email&utm_source=footer>
.
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
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
<https://groups.google.com/d/msgid/android-ndk/CAFVaGhupDj2NJu1NZ5Fe%2BU8nh%3DJmq_RKS0PVF7-fJOCwK8b8Ag%40mail.gmail.com?utm_medium=email&utm_source=footer>
.
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 android-***@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/CANRwJTFBL5_KAir6NCpjJRrBm%2BB2Lr1TXLJceFB86tEa8wvvZA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Memo Rodriguez
2018-06-01 21:06:20 UTC
Permalink
Hi Christopher

I made the changes that you mentioned in your previous email but
unfortunately I don't see the "malloc debug enabled" msg in logcat. I tried
with both options "backtrace leak_track" and with each of them individually.

Do you have any other ideas?

thx
Memo
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.
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.
Christopher
Post by Memo Rodriguez
hi Dan
thx, I guess I can try running the same code on my emulator running P.
Memo
On Fri, Jun 1, 2018 at 12:03 PM, 'Dan Albert' via android-ndk <
Post by 'Dan Albert' via android-ndk
It may be that malloc debug didn't work on unrooted devices until P. I'm
not very familiar with malloc debug, but I've CC'd the guy that is.
Post by Memo Rodriguez
hi Dan
These are the contents of my wrap.sh
#!/system/bin/sh
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:supportsRtl="true"
android:debuggable="true"
On Fri, Jun 1, 2018 at 11:42 AM, 'Dan Albert' via android-ndk <
Post by 'Dan Albert' via android-ndk
+cferris
What does your wrap.sh look like? Is your APK debuggable?
Post by Memo Rodriguez
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?
thx
Memo
--
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,
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
<https://groups.google.com/d/msgid/android-ndk/65e537a0-2e28-4291-8267-ca8983e15e2e%40googlegroups.com?utm_medium=email&utm_source=footer>
.
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
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
<https://groups.google.com/d/msgid/android-ndk/CAFVaGhvUYzuPzzR_2nAXOSA%2Bvc5dZybYFppeGQsAE8gNWs14Tw%40mail.gmail.com?utm_medium=email&utm_source=footer>
.
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
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/CANRwJTHvExD7DO8yWrnjBt9yBcxp1
pK%3DG6siT6tabEA%2BU3S3iA%40mail.gmail.com
<https://groups.google.com/d/msgid/android-ndk/CANRwJTHvExD7DO8yWrnjBt9yBcxp1pK%3DG6siT6tabEA%2BU3S3iA%40mail.gmail.com?utm_medium=email&utm_source=footer>
.
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
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
<https://groups.google.com/d/msgid/android-ndk/CAFVaGhupDj2NJu1NZ5Fe%2BU8nh%3DJmq_RKS0PVF7-fJOCwK8b8Ag%40mail.gmail.com?utm_medium=email&utm_source=footer>
.
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 android-***@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/CANRwJTHoRMSEpqFjBOdHv-r8x9%2BCQE%2BSzTQBWFC30Nwhdu-cjw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
'Christopher Ferris' via android-ndk
2018-06-01 21:37:30 UTC
Permalink
I verified that on a Pixel 2 device running a user 8.1 build, I was able to
set the environment variable at the shell level and enable malloc debug.
Therefore, I think something is going on with the usage of wrap.sh.

Here are a couple of things to check:

- Is wrap.sh executable?
- Where is the script located? It should be in lib/<arch>/wrap.sh, if your
app is 64 bit, then lib/arm64/wrap.sh. To be thorough, you could add it in
lib/arm/ too.

Here's the official documentation on wrap.sh, in case you didn't find it:

https://developer.android.com/ndk/guides/wrap-script

If that doesn't work, I don't think I have any other ideas.

Christopher
Post by Memo Rodriguez
Hi Christopher
I made the changes that you mentioned in your previous email but
unfortunately I don't see the "malloc debug enabled" msg in logcat. I tried
with both options "backtrace leak_track" and with each of them individually.
Do you have any other ideas?
thx
Memo
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.
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.
Christopher
Post by Memo Rodriguez
hi Dan
thx, I guess I can try running the same code on my emulator running P.
Memo
On Fri, Jun 1, 2018 at 12:03 PM, 'Dan Albert' via android-ndk <
Post by 'Dan Albert' via android-ndk
It may be that malloc debug didn't work on unrooted devices until P.
I'm not very familiar with malloc debug, but I've CC'd the guy that is.
Post by Memo Rodriguez
hi Dan
These are the contents of my wrap.sh
#!/system/bin/sh
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:supportsRtl="true"
android:debuggable="true"
On Fri, Jun 1, 2018 at 11:42 AM, 'Dan Albert' via android-ndk <
Post by 'Dan Albert' via android-ndk
+cferris
What does your wrap.sh look like? Is your APK debuggable?
Post by Memo Rodriguez
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?
thx
Memo
--
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,
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
<https://groups.google.com/d/msgid/android-ndk/65e537a0-2e28-4291-8267-ca8983e15e2e%40googlegroups.com?utm_medium=email&utm_source=footer>
.
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,
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
<https://groups.google.com/d/msgid/android-ndk/CAFVaGhvUYzuPzzR_2nAXOSA%2Bvc5dZybYFppeGQsAE8gNWs14Tw%40mail.gmail.com?utm_medium=email&utm_source=footer>
.
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
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
<https://groups.google.com/d/msgid/android-ndk/CANRwJTHvExD7DO8yWrnjBt9yBcxp1pK%3DG6siT6tabEA%2BU3S3iA%40mail.gmail.com?utm_medium=email&utm_source=footer>
.
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
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
<https://groups.google.com/d/msgid/android-ndk/CAFVaGhupDj2NJu1NZ5Fe%2BU8nh%3DJmq_RKS0PVF7-fJOCwK8b8Ag%40mail.gmail.com?utm_medium=email&utm_source=footer>
.
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 android-***@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/CANtHk4%3Dn%3Dut601meK0tPS8mMFSEs-GHnOQFt_MYcuKYrYSDCDQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Loading...