使用Espresso测试应用程序时的“本机崩溃”

时间:2016-11-03 10:17:54

标签: android crash emulation native android-espresso

我在Android-x86上使用Espresso通过Virtualbox模拟器测试Android应用时随机出现“本机崩溃”。 我相信它与记忆有关,但我不确定。有人知道吗?感谢。

以下是来自logcat的日志:

11-03 10:59:42.430 2337-2337/com.myApp.mobile I/ViewInteraction: Performing 'single click' action on view with id: com.myApp.mobile:id/radio_PN
11-03 10:59:42.510 2337-2337/com.myApp.mobile A/libc: Fatal signal 11 (SIGSEGV) at 0x8bb55ffc (code=2), thread 2337 (ile.mobile)
11-03 10:59:42.620 932-932/? I/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
11-03 10:59:42.620 932-932/? I/DEBUG: Build fingerprint: 'Android-x86/android_x86/x86:4.3/JSS15J/eng.cwhuang.20130725.203820:userdebug/test-keys'
11-03 10:59:42.620 932-932/? I/DEBUG: Revision: '0'
11-03 10:59:42.620 932-932/? I/DEBUG: pid: 2337, tid: 2337, name: ile.medicineapp  >>> com.myApp.mobile <<<
11-03 10:59:42.620 932-932/? I/DEBUG: signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 8bb55ffc
11-03 10:59:42.780 932-932/? I/DEBUG:     eax 8bb55000  ebx b6d55c90  ecx 00000400  edx 001d4c00
11-03 10:59:42.780 932-932/? I/DEBUG:     esi 8a64dffc  edi 8bb55ffc
11-03 10:59:42.780 932-932/? I/DEBUG:     xcs 00000073  xds 0000007b  xes 0000007b  xfs 00000000  xss 0000007b
11-03 10:59:42.780 932-932/? I/DEBUG:     eip b764b60d  ebp 8a64d000  esp bffac604  flags 00210686
11-03 10:59:42.780 932-932/? I/DEBUG: backtrace:
11-03 10:59:42.780 932-932/? I/DEBUG:     #00  pc 0002f60d  /system/lib/libc.so
11-03 10:59:42.780 932-932/? I/DEBUG:     #01  pc 00024fff  /dev/ashmem/dalvik-jit-code-cache (deleted)
11-03 10:59:42.780 932-932/? I/DEBUG: stack:
11-03 10:59:42.780 932-932/? I/DEBUG:          bffac5c4  00000320  
11-03 10:59:42.780 932-932/? I/DEBUG:          bffac5c8  00000480  
11-03 10:59:42.780 932-932/? I/DEBUG:          bffac5cc  bffac6ac  [stack]
11-03 10:59:42.780 932-932/? I/DEBUG:          bffac5d0  b8b3a080  [heap]
11-03 10:59:42.780 932-932/? I/DEBUG:          bffac5d4  b8b3a090  [heap]
11-03 10:59:42.780 932-932/? I/DEBUG:          bffac5d8  b75f0608  /system/lib/libutils.so
11-03 10:59:42.780 932-932/? I/DEBUG:          bffac5dc  00000000  
11-03 10:59:42.780 932-932/? I/DEBUG:          bffac5e0  00000000  
11-03 10:59:42.780 932-932/? I/DEBUG:          bffac5e4  00000320  
11-03 10:59:42.780 932-932/? I/DEBUG:          bffac5e8  00000480  
11-03 10:59:42.780 932-932/? I/DEBUG:          bffac5ec  00000480  
11-03 10:59:42.780 932-932/? I/DEBUG:          bffac5f0  bffac698  [stack]
11-03 10:59:42.780 932-932/? I/DEBUG:          bffac5f4  bffac774  [stack]
11-03 10:59:42.780 932-932/? I/DEBUG:          bffac5f8  b6d6de29  /system/lib/libui.so (android::Region::subtract(android::Region const&) const+9)
11-03 10:59:42.780 932-932/? I/DEBUG:          bffac5fc  b6d55c90  /system/lib/libgui.so
11-03 10:59:42.780 932-932/? I/DEBUG:          bffac600  46505845  
11-03 10:59:42.780 932-932/? I/DEBUG:     #00  bffac604  8bb55000  /dev/ashmem/gralloc-buffer (deleted)
11-03 10:59:42.780 932-932/? I/DEBUG:          bffac608  00000000  
11-03 10:59:42.780 932-932/? I/DEBUG:          bffac60c  b6d32ef7  /system/lib/libgui.so (_ZN7android7Surface4lockEP20ANativeWindow_BufferP5ARect.part.8+1687)
11-03 10:59:42.780 932-932/? I/DEBUG:          bffac610  8bb55000  /dev/ashmem/gralloc-buffer (deleted)
11-03 10:59:42.780 932-932/? I/DEBUG:          bffac614  8a64d000  /dev/ashmem/gralloc-buffer (deleted)
11-03 10:59:42.780 932-932/? I/DEBUG:          bffac618  001d4c00  
11-03 10:59:42.780 932-932/? I/DEBUG:          bffac61c  bffac674  [stack]
11-03 10:59:42.780 932-932/? I/DEBUG:          bffac620  005fd110  
11-03 10:59:42.780 932-932/? I/DEBUG:          bffac624  b85ff220  [heap]
11-03 10:59:42.780 932-932/? I/DEBUG:          bffac628  b76b5568  
11-03 10:59:42.780 932-932/? I/DEBUG:          bffac62c  00000000  
11-03 10:59:42.780 932-932/? I/DEBUG:          bffac630  b8ad4780  [heap]
11-03 10:59:42.780 932-932/? I/DEBUG:          bffac634  001d4c00  
11-03 10:59:42.780 932-932/? I/DEBUG:          bffac638  bffac6ac  [stack]
11-03 10:59:42.780 932-932/? I/DEBUG:          bffac63c  b8b257f0  [heap]
11-03 10:59:42.780 932-932/? I/DEBUG:          bffac640  00000c80  
11-03 10:59:42.780 932-932/? I/DEBUG: memory map around fault addr 8bb55ffc:
11-03 10:59:42.780 932-932/? I/DEBUG:     8bb30000-8bb55000 r-x /dev/ashmem/dalvik-jit-code-cache (deleted)
11-03 10:59:42.780 932-932/? I/DEBUG:     8bb55000-8bb56000 r-x /dev/ashmem/gralloc-buffer (deleted)
11-03 10:59:42.780 932-932/? I/DEBUG:     8bb56000-8bed9000 rw- /dev/ashmem/gralloc-buffer (deleted)
11-03 10:59:42.810 1068-2415/system_process W/ActivityManager: Error in app com.myApp.mobile running instrumentation ComponentInfo{com.myApp.mobile.androidTest/android.support.test.runner.AndroidJUnitRunner}:
11-03 10:59:42.810 1068-2415/system_process W/ActivityManager:   Native crash

1 个答案:

答案 0 :(得分:0)

你认为这是与内存相关的崩溃是正确的。我曾经在AVD上遇到同样的问题。

我尝试增加内存但没有帮助,所以我最终使用了Genymotion模拟器。

在你走这条路之前,我还建议你检查一下是否使用了正确的.apk文件。我被提供了armeabi.apk和x86.apk,我使用了错误的.apk,这也给我造成了一些崩溃。