[PATCH] D31695: Windows asan_device_setup.bat port of linux shell script
Evgenii Stepanov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 28 15:06:54 PDT 2017
eugenis added a comment.
In https://reviews.llvm.org/D31695#824659, @gpx1000 wrote:
> As an aside, I have found a way to use ASan in devices using wrap.sh. So long as the device has the ability to use su or is a eng dev build the following wrap will work:
This is great! Wrap.sh is definitely a better approach for 99% of users. Why are you saying that it needs an eng dev build though? I thought the idea behind wrap.sh is that it works on regular user devices, as long as the app has DEBUGGABLE in the manifest.
> #!/system/bin/sh-from-zygote\n
> ASAN_OPTIONS=start_deactivated=1,malloc_context_size=0
> ASAN_ACTIVATION_OPTIONS=include_if_exists=/data/local/tmp/asan.options.b
> LD_PRELOAD=libclang_rt.asan-${abi}-android.so
> su -c setenforcing 0
> $@
> su -c setenforcing 1
As I mentioned in other comments, this script does not pass the variables to the child environment. It needs to be a one-liner or do explicit "export". Did you test it with actual ASan-instrumented code in the app?
> I'd note that with doing this; I'm not entirely sure there's still a need for this script to exist. I'm creating a blog post / tutorial on how to use ASan using the above wrap implementation; complete with example project. However, I'll make the suggested changes and resubmit.
The only reason for the script to exist is performance - any wrap-based solution would restart the entire VM for every new process, which takes at least a few seconds.
https://reviews.llvm.org/D31695
More information about the llvm-commits
mailing list