Repository navigation
Closed
Milestone
Description
Platform - OSX 10.11.2
Device - Samsung Galaxy S3, Rooted
- Modify asan_device_setup to work on OSX
- TMPDIRBASE=$(mktemp -d -t template)
- TMPDIRBASE=$(mktemp -d)
2) Run ./asan_device_setup --use-su
- TMPDIRBASE=$(mktemp -d)
>> Remounting /system rw
Remounting /dev/block/platform/msm_sdcc.1/by-name/system at /system
Target architecture: arm
>> Pre-L device detected. Setting up app_process symlink.
>> Copying files from the device
>> New installation
>> Generating wrappers
Only in new/: app_process.wrap
Only in new/: asanwrapper
Only in new/: libclang_rt.asan-arm-android.so
>> Pushing files to the device
Installing /system/lib/libclang_rt.asan-arm-android.so 644
4574 KB/s (691152 bytes in 0.147s)
/system/bin/sh: can't create "/system/lib/libclang_rt.asan-arm-android.so/libclang_rt.asan-arm-android.so": No such file or directory
Unable to open /system/lib/libclang_rt.asan-arm-android.so: No such file or directory
Unable to open /system/lib/libclang_rt.asan-arm-android.so: No such file or directory
Installing /system/bin/app_process.wrap 755 u:object_r:system_file:s0
16 KB/s (279 bytes in 0.016s)
/system/bin/sh: can't create "/system/bin/app_process.wrap/app_process.wrap": No such file or directory
Unable to open /system/bin/app_process.wrap: No such file or directory
Unable to open /system/bin/app_process.wrap: No such file or directory
chcon: Could not label /system/bin/app_process.wrap with u:object_r:system_file:s0: No such file or directory
Installing /system/bin/asanwrapper 755 u:object_r:system_file:s0
3 KB/s (71 bytes in 0.020s)
/system/bin/sh: can't create "/system/bin/asanwrapper/asanwrapper": No such file or directory
Unable to open /system/bin/asanwrapper: No such file or directory
Unable to open /system/bin/asanwrapper: No such file or directory
chcon: Could not label /system/bin/asanwrapper with u:object_r:system_file:s0: No such file or directory
>> Restarting shell (asynchronous)
>> Please wait until the device restarts
The device no longer boots. I imagine it's because of the errors in the system/lib paths. The file name is repeated mistakenly.
Activity
eugenis commentedon Mar 10, 2016
Couldyou provide some more info?
Does it help to do asan_device_setup --revert ?
DanAlbert commentedon Mar 10, 2016
Yikes.
We don't actually modify
asan_device_setupat all, it's direct from the ASAN repository, so I've opened a bug over there. Should move discussion to that bug, but I'll leave this open to track that we don't have the fix yet.CNugteren commentedon Mar 11, 2016
Saw a similar problem today with NDK 11 and the
--use-suoption. Even after I fixed the indicated issues such as/system/bin/sh: can't create "/system/lib/libclang_rt.asan-arm-android.so/libclang_rt.asan-arm-android.so": No such file or directoryfor my device, the script would still brick the device. I didn't try the revert option.I've tested this on Android 4.4.4 on a Sony Z1C and subsequently with a custom ROM (also Android 4.4.4). The old script (without the useful
--use-suoption) of the NDK 10e still works on this device. This is on ADB version 1.0.32.edkimmel commentedon Mar 11, 2016
I was using NDK 11 as well.
Device was a Samsung Galaxy S3, android version 4.4.2
I didn't know that I had to do anything extra while rooted to get ADB working in recovery mode, so I'm not able to even try to revert option. Reflashing does nothing, Samsung kies fails. Guess I have a nice looking paperweight.
It's honestly silly that we need a rooted device to access a lot of useful debugging tools, but there's no official support for rooting. I'd even settle for bringing back rooted dev only phones.
DanAlbert commentedon Mar 11, 2016
Does this only happen with
--use-su? I'm going to see if I can brick a Nexus 5 really quick...I'm not quite sure how this script could make a device unrecoverable even after reflashing... All it does is modify the system and data partitions.
DanAlbert commentedon Mar 12, 2016
So, I was able to render a Nexus 5 (KTU84P) unbootable, but I was also able to recover it. By reflashing.
Looks like this isn't unique to
--use-su. It repros on a userdebug KTU84P hammerhead just fine. Still not sure what's going on yet though.DanAlbert commentedon Mar 14, 2016
Looks like this was actually fixed by llvm-mirror/compiler-rt@bd58cbc
The version of clang we shipped was a couple months before that CL.
So, this will be fixed in r12, but given that this is pretty damn harmful I'm going to see if I can rig our build to include a newer
asan_device_setup...DanAlbert commentedon Mar 15, 2016
Okay, a fix is checked in for r11b.
DanAlbert commentedon Mar 17, 2016
r11b is live with the fix: http://developer.android.com/ndk/downloads/index.html#download