With asan_device_setup, app_process runs without /system/lib/asan and therefore without any instrumented libraries. To run other system services, you can use asanwrapper (add LD_LIBRARY_PATH to the place where asan_device_setup generates it).
On Wed, Jul 23, 2014 at 8:44 PM, ji wang <mason.wan...@gmail.com> wrote: > That's remind me of something, With the solution you offered in your first > reply: > > >>Build both instrumented and >>non-instrumented versions of libhwui.so, place first in >>/system/lib/asan and the second in /system/lib. Add >>LD_LIBRARY_PATH=/system/lib/ >>asan to asan_wrapper. This way anything >>started with asan_wrapper will prefer instrumented versions of >>libraries in /system/lib/asan, and zygote will use the normal version >>in /system/lib. > > a little confused ,that when we use asan_device_setup script for java apps > Asan using, this LD_LIBRARY_PATH setting will not helpful for the mem cost > problem, because we don't use asanwapper in this situation. > And Of cource, I've read the asan_device_setup script, we changed the > app_process to a script and use it to exec the real app_process, I think > maybe we can add LD_LIBRARY_PATH to the app_process script we added, but > still not helpful at all,all forked process will use instrumented versions > of libraries in /system/lib/asan, and consume all my memory. Am I right? > In other way said, we must use asanwapper instead of asan_device_setup > script for java apps, we must setprop.Right? > > > > > 在 2014年7月23日星期三UTC+8下午7时23分38秒,Evgeniy Stepanov写道: >> >> Well, setprop approach is deprecated. With the new asan_device_setup >> script, everything should work automatically, because asan runtime is >> already loaded into zygote, and only activated when an instrumented >> application is started. >> >> Modifying init.rc is really not that hard. There is an idea that I >> always wanted to implement for ASan applications to re-exec themselves >> if they are run with asanwrapper (i.e. without ASan runtime library in >> LD_PRELOAD list). In that case ASan would add itself to LD_PRELOAD and >> call exec() on itself. It would require changing ASan code. I would >> not have time for this in the coming months. >> >> >> On Thu, Jul 17, 2014 at 6:34 PM, ji wang <mason....@gmail.com> wrote: >> > Hi, Evgeniy >> > Thanks for your reply. And yes, the OOM issue happed with instrumented >> > libhwui.so. I understood why this memory consume so huge now. >> > And with the solution u offred, not all process using the instrumented >> > libhwui.so, just the process u want to check using asan, this is useful >> > for >> > Problem Two, but we still have Problem One:we must preload >> > libasan_preload.so to the process first, the app process way to achive >> > this >> > is "setprop wrap.com.android.appname "logwrapper asanwrapper"", the >> > native >> > procecess way to achive this is modify the init.rc file. and besides >> > the >> > property way for app will not work after reboot, must set it again. Not >> > easy >> > to use. Does we have any solutions for this? Thank u very much. >> > >> > 在 2014年7月16日星期三UTC+8下午6时48分41秒,Evgeniy Stepanov写道: >> >> >> >> Does this out-of-memory issue happen with instrumented libhwui.so? >> >> This has an easy explanation. ASan activates all of its >> >> memory-consuming logic when the first instrumented library is loaded >> >> into the process. If such library is loaded into zygote pre-fork, all >> >> java apps are running with ASan enabled, and consume all your memory. >> >> >> >> There is something you can try. Build both instrumented and >> >> non-instrumented versions of libhwui.so, place first in >> >> /system/lib/asan and the second in /system/lib. Add >> >> LD_LIBRARY_PATH=/system/lib/asan to asan_wrapper. This way anything >> >> started with asan_wrapper will prefer instrumented versions of >> >> libraries in /system/lib/asan, and zygote will use the normal version >> >> in /system/lib. >> >> >> >> >> >> On Wed, Jul 16, 2014 at 2:00 PM, ji wang <mason....@gmail.com> wrote: >> >> > Hi, >> >> > We now want use LLVM Asan to check some android libs like libhwui.so, >> >> > but >> >> > found out is not very easy to use. Is there any way to solve this? Or >> >> > I >> >> > use >> >> > it the wrong way? >> >> > The problem is we must preload libasan_preload.so before those >> >> > checking >> >> > lib >> >> > initlized or used in some processes. For example, when we want check >> >> > libhwui.so,we must modify init.rc to use asanwrapper to load >> >> > mediaserver >> >> > process in order to preload libasan_preload.so , (and the same to >> >> > app_process,of cource the asan_device_setup.sh already done the >> >> > app_process >> >> > part,) otherwise without this step android device will got boot error >> >> > failure.This will ask us have to know how many processes use this >> >> > checking >> >> > lib and what those processes are exactly! wow.. >> >> > Besides, there is one more problem, when we use LLVM asan, after use >> >> > asan_device_setup.sh to install asan to our device, we didnot add any >> >> > libs >> >> > or binary for check, but still got a huge memory cost after the >> >> > device >> >> > bootup, and for 1G ram android devices, we got boot failure, becauce >> >> > of >> >> > the >> >> > LMK kill launcher and some other app process for no memory lost! >> >> > >> >> > >> >> > -- >> >> > You received this message because you are subscribed to the Google >> >> > Groups >> >> > "address-sanitizer" group. >> >> > To unsubscribe from this group and stop receiving emails from it, >> >> > send >> >> > an >> >> > email to address-saniti...@googlegroups.com. >> >> > For more options, visit https://groups.google.com/d/optout. >> > >> > -- >> > You received this message because you are subscribed to the Google >> > Groups >> > "address-sanitizer" group. >> > To unsubscribe from this group and stop receiving emails from it, send >> > an >> > email to address-saniti...@googlegroups.com. >> > For more options, visit https://groups.google.com/d/optout. > > -- > You received this message because you are subscribed to the Google Groups > "address-sanitizer" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to address-sanitizer+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "address-sanitizer" group. To unsubscribe from this group and stop receiving emails from it, send an email to address-sanitizer+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.