Closed
Description
In the function call InitializeAsanCommonInterceptors(), the following check failed:
"((__interception::real_memcpy)) != (0)"
NDK version is r16b with gnustl-static, Android 8.0, using wrap.sh approach.
getenforce shows "PERMISSIVE"
After update to NDK r18b, with -DANDROID_STL=c++_static, the crashed stack changed:
__cxa_atexit
unknown>
unknown>
__dl__ZL13call_functionPKcPFviPPcS2_ES0
_dl__ZL10call_arrayIPFviPPcS1_EEvPKcPT_jbS5
__dl__ZN6soinfo17call_constructorsEV
__dl__ZN6soinfo17call_constructorsEV
__dl__Z9do_dlopenPKciPK17android_dlextinfoPKv
__dl__ZL10dlopen_extPKciPK17android_dlextinfoPKv
android_dlopen_ext
android::OpenNativeLibrary
Any idea? thank you
Activity
eugenis commentedon Nov 20, 2018
alek314 commentedon Nov 21, 2018
Eugenis, you are right.
I am using Android Studio for development, and I manually put the wrap.sh script right next to asan-arm-android.so, in the jniLibs/armeabi-v7a folder. But wrap.sh did not made it's way to the APK.
alek314 commentedon Nov 21, 2018
In order to work with AndroidStudio, wrap.sh should be put into folder app/resources/lib/armeabi-v7a, then wrap.sh is properly packaged along side asan.so.
When the app start, the following error occured:
wrap.sh : executing /data/app/com.dy3d-MRYVTaN0O7_J5V3ARv77hA==/lib/arm/wrap.sh failed: No such file or directory
logwrapper: executing /data/app/com.dy3d-MRYVTaN0O7_J5V3ARv77hA==/lib/arm/wrap.sh failed: No such file or directory
It turns out the problem is the line ending of wrap.sh is CRLF, which should be LF instead.
https://unix.stackexchange.com/questions/27054/bin-bash-no-such-file-or-directory
Hope this would help someone.