ramosian-glider / address-sanitizer

Automatically exported from code.google.com/p/address-sanitizer
0 stars 0 forks source link

Asan support for Chrome on Android #324

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

Followed the http://www.chromium.org/developers/testing/addresssanitizer
AddressSanitizer (ASAN)  --> Building on Android.
Followed the below steps :

1) gclient sync --nohooks
2) . build/android/envsetup.sh
3) GYP_DEFINES="OS=android asan=1 component=shared_library" gclient runhooks.

4) ninja -C out/Release chrome_shell_apk 

5) adb install -r out/Release/apk/ChromeShell.apk  ==> SUCCESFULLY installed

6) tools/android/asan/asan_device_setup.sh
            ASAN_RT_PATH: /system/lib
            ASAN_RT: libclang_rt.asan-arm-android.so
            ASan runtime library not found
            >> Remounting /system rw
            adbd is already running as root
            remount succeeded
            >> Copying files from the device
            116 KB/s (9560 bytes in 0.080s)
            remote object '/system/bin/app_process.real' does not exist
            127 KB/s (5408 bytes in 0.041s)
            2329 KB/s (1747340 bytes in 0.732s)
            app_process.real missing, new installation
            >> Generating wrappers
            Files old/app_process and new/app_process differ
            Only in new/: app_process.real
            Files old/asanwrapper and new/asanwrapper differ
            >> Pushing files to the device
            3063 KB/s (1747340 bytes in 0.557s)
            2 KB/s (160 bytes in 0.054s)
            216 KB/s (9560 bytes in 0.043s)
            1 KB/s (71 bytes in 0.053s)
            >> Restarting shell (asynchronous)
            >> Please wait until the device restarts

I'm able to build  and install the chromeshell.apk and contentshell.apk, but 
unable to launch the application  
its crashing at  while launching the  chromeshell.

Error :
    "Shadow memory range interleaves with an existing memory mapping. ASan cannot proceed correctly. ABORTING"

What is the expected output? What do you see instead?
Application should launch without crash able to run the test cases properly.

What version of the product are you using? On what operating system?
version : 37.0.2062.0
OS  : ANDROID
Device Android version  : 4.4.2

Please provide any additional information below.

D/dalvikvm(15162): Trying to load lib 
/data/app-lib/org.chromium.chrome.shell-1/libchromium_android_linker.cr.so 
0x45b54240
D/dalvikvm(15162): Added shared lib 
/data/app-lib/org.chromium.chrome.shell-1/libchromium_android_linker.cr.so 
0x45b54240
I/LibraryLoader(15162): Loading: stlport_shared
I/LibraryLoader(15162): Loading: icuuc.cr
I/        (15162): ==15162==Shadow memory range interleaves with an existing 
memory mapping. ASan cannot proceed correctly. ABORTING.
D/SSRMv2:mDNIeOnOff(11823): call updatemDNIe with delay 163

Please find dump :
--------------------------------------------------------------------------------
----------------------------------------------------
I/BrowserStartupController(15162): Initializing chromium process, renderers=9
E/File    (15142): fail readDirectory() errno=2
D/dalvikvm(15162): Trying to load lib 
/data/app-lib/org.chromium.chrome.shell-1/libchromium_android_linker.cr.so 
0x45b54240
D/dalvikvm(15162): Added shared lib 
/data/app-lib/org.chromium.chrome.shell-1/libchromium_android_linker.cr.so 
0x45b54240
I/LibraryLoader(15162): Loading: stlport_shared
I/LibraryLoader(15162): Loading: icuuc.cr
I/        (15162): ==15162==Shadow memory range interleaves with an existing 
memory mapping. ASan cannot proceed correctly. ABORTING.
D/SSRMv2:mDNIeOnOff(11823): call updatemDNIe with delay 163
I/        (15162): ==15162==Process memory map follows:
I/        (15162):  0x00040000-0x03000000   
I/        (15162):  0x03000000-0x18000000   
I/        (15162):  0x400fd000-0x400ff000   /system/bin/app_process.real
I/        (15162):  0x400ff000-0x40100000   /system/bin/app_process.real
I/        (15162):  0x40100000-0x40101000   
I/        (15162):  0x40101000-0x40110000   /system/bin/linker
I/        (15162):  0x40110000-0x40111000   /system/bin/linker
I/        (15162):  0x40111000-0x40112000   /system/bin/linker
I/        (15162):  0x40112000-0x40113000   
I/        (15162):  0x40113000-0x40114000   [sigpage]
I/        (15162):  0x40114000-0x40116000   
I/        (15162):  0x40116000-0x40117000   
I/        (15162):  0x40117000-0x40118000   
I/        (15162): 
    0x40118000-0x401cf000   /system/lib/libclang_rt.asan-arm-android.so
I/        (15162): 
    0x401cf000-0x401d0000   /system/lib/libclang_rt.asan-arm-android.so
I/        (15162): 
    0x401d0000-0x401d2000   /system/lib/libclang_rt.asan-arm-android.so
I/        (15162):  0x401d2000-0x4062a000   
I/        (15162):  0x4062a000-0x40642000   /system/lib/libm.so
I/        (15162):  0x40642000-0x40643000   
I/        (15162):  0x40643000-0x40644000   /system/lib/libm.so
I/        (15162): 
    0x7a909000-0x7a967000   /data/app/org.chromium.chrome.shell-1.apk
I/        (15162):  0x7a967000-0x7a99d000   /dev/ashmem/dalvik-aux-structure 
(deleted)
I/        (15162): 
    0x7a99d000-0x7a9b7000   /data/app-lib/org.chromium.chrome.shell-1/libchromium_and
roid_linker.cr.so
I/        (15162): 
    0x7a9b7000-0x7a9b8000   /data/app-lib/org.chromium.chrome.shell-1/libchromium_and
roid_linker.cr.so
I/        (15162): 
    0x7a9b8000-0x7a9b9000   /data/app-lib/org.chromium.chrome.shell-1/libchromium_and
roid_linker.cr.so
I/        (15162): 
    0x7abff000-0x7ac32000   /system/vendor/lib/egl/libGLESv2_adreno.so
I/        (15162): 
    0x7b227000-0x7b515000   /data/dalvik-cache/data@app@org.chromium.chrome.shell-1.a
pk@classes.dex
I/        (15162): 
    0x7b76e000-0x7b7c6000   /data/app-lib/org.chromium.chrome.shell-1/libstlport_shar
ed.so
I/        (15162): 
    0x7b7c6000-0x7b7cb000   /data/app-lib/org.chromium.chrome.shell-1/libstlport_shar
ed.so
I/        (15162): 
    0x7b7cb000-0x7ba2b000   /data/app-lib/org.chromium.chrome.shell-1/libicuuc.cr.so
I/        (15162): 
    0x7ba2c000-0x7ba36000   /data/app-lib/org.chromium.chrome.shell-1/libicuuc.cr.so
I/        (15162): 
    0x7ba3a000-0x7baf1000   /system/lib/libclang_rt.asan-arm-android.so
I/        (15162): 
    0x7baf1000-0x7baf4000   /system/lib/libclang_rt.asan-arm-android.so
I/        (15162):  0xbecf6000-0xbed17000   [stack]
I/        (15162):  0xffff0000-0xffff1000   [vectors]
I/        (15162): ==15162==End of process memory map.
I/ActivityManager(11823): Process org.chromium.chrome.shell (pid 15162) (adj 0) 
has died.
E/cutils  (  263): Failed to mkdirat(/storage/extSdCard/Android): Read-only 
file system
W/ContextImpl(15142): Failed to ensure directory: 
/storage/extSdCard/Android/data/com.iloen.melon/cache
W/Vold    (  263): Returning OperationFailed - no handler for errno 30
I/SELinux (15188): Function: selinux_android_load_priority [0], There is no 
sepolicy file.
I/SELinux (15188):  
I/SELinux (15188): Function: selinux_android_load_priority [1], There is no 
sepolicy version file.
I/SELinux (15188):  
I/SELinux (15188): Function: selinux_android_load_priority , priority version 
is VE=SEPF_SM-N900S_4.4.2_0018
I/SELinux (15188):  
I/SELinux (15188):  
I/SELinux (15188): selinux_android_seapp_context_reload: seapp_contexts file is 
loaded from /seapp_contexts
E/dalvikvm(15188): >>>>> Normal User
E/dalvikvm(15188): >>>>> org.chromium.chrome.shell [ userId:0 | appId:10273 ]
D/Zygote  (11598): Process 15162 exited cleanly (1)
D/KeyguardUpdateMonitor(12173): sendKeyguardVisibilityChanged(true)
D/KeyguardUpdateMonitor(12173): handleKeyguardVisibilityChanged(1)
I/SurfaceFlinger(11550): id=17 Removed Mauncher (7/13)
D/KeyguardUpdateMonitor(12173): sendKeyguardVisibilityChanged(true)
D/KeyguardUpdateMonitor(12173): handleKeyguardVisibilityChanged(1)
---------------------------------------------------------

Original issue reported on code.google.com by kulkarni...@gmail.com on 7 Jul 2014 at 11:49

GoogleCodeExporter commented 9 years ago
    ASan runtime library not found
    >> Remounting /system rw

This is impossible: there is "exit 1" immediately after the second line.

    I/        (15162):  0x40118000-0x401cf000   /system/lib/libclang_rt.asan-arm-android.so
    I/        (15162):  0x7ba3a000-0x7baf1000   /system/lib/libclang_rt.asan-arm-android.so

You've got two instances of the same library loaded in one process. Interesting!
Are you using normal, stock android image? Did it ever work before?

I think libchromium_android_linker.cr.so may be doing something weird with 
shared libraries. For some reason it is not loaded at all on our bot:

http://build.chromium.org/p/chromium.fyi/builders/Android%20Asan%20Builder%20Tes
ts%20%28dbg%29/builds/4132

Original comment by euge...@google.com on 7 Jul 2014 at 12:21

GoogleCodeExporter commented 9 years ago

Original comment by ramosian.glider@gmail.com on 30 Jul 2015 at 9:05

GoogleCodeExporter commented 9 years ago
Adding Project:AddressSanitizer as part of GitHub migration.

Original comment by ramosian.glider@gmail.com on 30 Jul 2015 at 9:06