0

I am trying to set up an emulated android device to debug some native code using Google's sanitizers. Upon using the asan_device_setup script required to prepare the device to run sanitized code, the following is comes up:

OUTPUT:

      Peter Logan@DESKTOP-PLN /cygdrive/c/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin          
      $ sh asan_device_setup 
      >> Remounting /system rw
      remount succeeded
      Target architecture: i686
      >> Copying files from the device
      adb: error: cannot create file/directory '/tmp/tmp.8fXB5R9Db6/old': No such file or directory
      adb: error: cannot create file/directory '/tmp/tmp.8fXB5R9Db6/old': No such file or directory
      adb: error: cannot create file/directory '/tmp/tmp.8fXB5R9Db6/old': No such file or directory
      adb: error: cannot create file/directory '/tmp/tmp.8fXB5R9Db6/old': No such file or directory
      >> New installation
      >> Generating wrappers
      Only in new/: app_process.wrap
      Only in new/: asanwrapper
      Only in new/: libclang_rt.asan-i686-android.so
      >> Pushing files to the device
      Installing /system/lib/libclang_rt.asan-i686-android.so 644
      adb: error: cannot stat '/tmp/tmp.8fXB5R9Db6/new/libclang_rt.asan-i686-android.so': No such file or directory

The code that is run by the script for the first set of errors is:

      adb_pull /system/lib/"$ASAN_RT" "$TMPDIROLD" || true
      adb_pull /system/bin/app_process32 "$TMPDIROLD" || true
      adb_pull /system/bin/app_process.wrap "$TMPDIROLD" || true
      adb_pull /system/bin/asanwrapper "$TMPDIROLD" || true      

I checked and both the source files and "$TMPDIROLD" folder exist contrary to what the error message would suggest.

Any help to figure out what the cause of this is will be greatly appreciated.

Terminal: Cygwin

Emulator: Android API21, Rooted

Peter Logan
  • 11
  • 1
  • 5
  • It looks like you are using Cygwin, but whatever is trying to access those files is not going to use Cygwin paths. You are going to have to make sure that native paths are passed to some executables. –  Nov 21 '17 at 17:54
  • Thanks! I ran the script from Linux and it worked – Peter Logan Nov 22 '17 at 13:18
  • I did the same using MacOS, but is there a way to install ASAN libs from Windows at all? Thanks. – RRR Mar 25 '19 at 19:13

0 Answers0