Issue 379 in address-sanitizer: Leak sanitizer support for Android on arm64

254 views
Skip to first unread message

address-...@googlecode.com

unread,
Mar 6, 2015, 6:47:38 PM3/6/15
to address-...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 379 by vairav...@gmail.com: Leak sanitizer support for Android on
arm64
https://code.google.com/p/address-sanitizer/issues/detail?id=379

This is for porting leak sanitizer for Android with arm64. It seems 32bit
arm had issues documented at
https://code.google.com/p/address-sanitizer/issues/detail?id=294&can=1&q=leak%20sanitizer&colspec=ID%20Type%20Status%20Priority%20OpSys%20Owner%20Summary.

But is there any plan to port for arm64, now that there are 64 bit
processors running Android.

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

address-...@googlecode.com

unread,
Mar 6, 2015, 6:57:19 PM3/6/15
to address-...@googlegroups.com
Updates:
Cc: renato.g...@linaro.org

Comment #1 on issue 379 by konstant...@gmail.com: Leak sanitizer support
(No comment was entered for this change.)

address-...@googlecode.com

unread,
Mar 6, 2015, 7:52:37 PM3/6/15
to address-...@googlegroups.com

Comment #2 on issue 379 by rengo...@gmail.com: Leak sanitizer support for
We don't have plans yet, but it's in our radar. We need to make ARM stable
runtime first.

address-...@googlecode.com

unread,
Mar 6, 2015, 9:45:52 PM3/6/15
to address-...@googlegroups.com

Comment #3 on issue 379 by vairav...@gmail.com: Leak sanitizer support for
Thanks for the update. Do you have any recommendations in the short term? I
have tried using Valgrind for Android but the applications are practically
slow that its hard to execute any use case.

address-...@googlecode.com

unread,
Mar 6, 2015, 9:52:56 PM3/6/15
to address-...@googlegroups.com

Comment #4 on issue 379 by konstant...@gmail.com: Leak sanitizer support
There are several problems here, actually.
1. Make lsan work on AArch64 Linux. I don't know the status of this, but it
should be easy to accomplish.
2. Make lsan work on Android, x86_64 and AArch64.

>> Do you have any recommendations in the short term?
Nope. Unless of course you want to help us with the development. :( / :)

address-...@googlecode.com

unread,
Mar 6, 2015, 10:45:54 PM3/6/15
to address-...@googlegroups.com

Comment #5 on issue 379 by vairav...@gmail.com: Leak sanitizer support for
Sure, i can give it a shot. Btw, android apps don't really have an exit
unlike a typical c program with a main. In c terms, android apps have a
kind of an infinite loop which doesn't quit. Would leak sanitizer still
work in such cases?

address-...@googlecode.com

unread,
Mar 7, 2015, 12:36:34 AM3/7/15
to address-...@googlegroups.com
Updates:
Cc: euge...@google.com earth...@google.com

Comment #6 on issue 379 by konstant...@gmail.com: Leak sanitizer support
Right now we can call leak checking only once per process,
but this does not necessary has to be done at the very end.

From lsan_interface.h:
// Calling this function makes LSan enter the leak checking phase
immediately.
// Use this if normal end-of-process leak checking happens too late (e.g.
if
// you have intentional memory leaks in your shutdown code). Calling this
// function overrides end-of-process leak checking; it must be called at
// most once per process. This function will terminate the process if
there
// are memory leaks and the exit_code flag is non-zero.
void __lsan_do_leak_check();

address-...@googlecode.com

unread,
May 22, 2015, 11:20:56 AM5/22/15
to address-...@googlegroups.com

Comment #7 on issue 379 by earth...@google.com: Leak sanitizer support for
For the record, I've recently added a new interface function which allows
multiple leak checks:

// Check for leaks now. Returns zero if no leaks have been found or if
leak
// detection is disabled, non-zero otherwise.
// This function may be called repeatedly, e.g. to periodically check a
// long-running process. It prints a leak report if appropriate, but does
not
// terminate the process. It does not affect the behavior of
// __lsan_do_leak_check() or the end-of-process leak check, and is not
// affected by them.
int __lsan_do_recoverable_leak_check();

> 1. Make lsan work on AArch64 Linux. I don't know the status of this, but
> it should be easy to accomplish.

Recently this was done for MIPS. I invite you (vairavans) to take a look at
those patches to get an idea of the scope of work. Basically you will have
to:
- port stoptheworld (reimplementing internal_clone() will probably be the
bulk of this),
- port the TLS discovery code,
- pick up a few platform-dependent bits and pieces in lsan_common.
Reply all
Reply to author
Forward
0 new messages