libc_malloc_debug_leak.so on Nexus S

531 views
Skip to first unread message

Handyman

unread,
Jul 20, 2011, 4:56:55 PM7/20/11
to android-platform
I've been trying to get malloc debug working on my Nexus S 4G but,
after a few days, I'm more lost than when I started. First, I should
ask for a pointer to any docs for this -- I've been going off of
random 2 year old forum posts scattered across the interwebs.

Second, here's what I've done -- a patchwork of what I could get to
work from the aforementioned forum posts:

* Rooted my phone using http://forum.xda-developers.com/showthread.php?t=970237
(the instructions fail at step 7 but its much easier to ignore them
and copy the zip to the phone as step 1). Despite my changes to their
instructions, this seems to have worked but I had not rooted before.

* Added "native=true" to ddms.cfg.

* As per the forum posts, I've run:

adb shell setprop libc.debug.malloc 1
adb shell stop
adb shell start
adb shell ls

This did nothing unusual but when I do:

adb shell
su
setprop libc.debug.malloc 1
stop
start
ls

then I get this error:
E/libc ( 1519): ls: Missing module /system/lib/
libc_malloc_debug_leak.so required for malloc debug level 1
E/libc ( 1520): getprop: Missing module /system/lib/
libc_malloc_debug_leak.so required for malloc debug level 1

That shared lib mentioned in the error does not exist in /system/lib
(it only has libc.so).

I also get the error if I run the "SuperUser" app on my phone and then
run the first four adb shell commands.

My OS is 2.3.4. My understanding is that the 'ls' command should
simply show a message saying that its running with memory debugging
turned on if all is well.

- David

Handyman

unread,
Jul 21, 2011, 4:44:05 PM7/21/11
to android-platform
Following up:

I have confirmed that libc_malloc_debug.so does not exist on Nexus S
(on an unrooted phone, even). Just libc.so. Also, of course, the
missing library is a problem for libc.debug.malloc as 1, 5 or 10. I
assume that this feature is very experimental and not officially
supported since its not mentioned in any docs but I'm hoping that I
can get my app to be at least almost as stable as the iPhone version.
If malloc-debug has been abandoned, is there another canned option for
memory profiling or should I start the long road to rolling my own?
Or is there some other device that offers debugging?

Thanks,
- David

Jeffrey Brown

unread,
Jul 22, 2011, 6:03:01 AM7/22/11
to android-...@googlegroups.com
It's a development feature. I guess we only include the
libc_malloc_debug_leak.so library in userdebug or eng builds, so it
would be excluded from production (user) builds.

Since you have root on your device, you could make your own userdebug
build and flash it to the phone. Alternately, it might be possible to
build a copy of libc_malloc_debug_leak.so and push it over to the
phone using ADB. Worth a shot. Perhaps someone's already done it.

I was using the malloc leak debugging features just today. So it
works for me at least...

Jeff.

> --
> You received this message because you are subscribed to the Google Groups "android-platform" group.
> To post to this group, send email to android-...@googlegroups.com.
> To unsubscribe from this group, send email to android-platfo...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.
>
>

Handyman

unread,
Jul 25, 2011, 2:06:52 PM7/25/11
to android-platform
OK, worth a shot. I grabbed the binary from the Cyanogen crespo4g
build, put it in /system/lib on the device and gave tribute to the
gods and lo and behold... success! Thanks for the suggestion. Im
sure I could install the Cyanogen build but I'm trying to limit the
changes I make to this device.

Thanks!
- David

"Fry, if I ever see you try something that crazy again, this crew
might just have some new parachute pants!"
Reply all
Reply to author
Forward
0 new messages