CTS问题分析15

CTS/GTS 问题分析15

一个安全补丁不再维护造成的case升级的fail问题

问题分析

测试命令:

run cts -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.CorruptApkTests#testSafeInstallOfCorruptAPK_b71360999 -a arm64-v8a

fail host log:

02-25 11:16:13 W/AndroidNativeDevice: InstallException ( cause: ShellCommandUnresponsiveException) when attempting install /tmp/corruptapk1230584624101881124.apk on device 7ac4c90e
02-25 11:16:13 I/AndroidNativeDevice: Attempting recovery on 7ac4c90e
02-25 11:16:13 I/WaitDeviceRecovery: Pausing for 5000 for 7ac4c90e to recover
02-25 11:16:18 I/AndroidNativeDeviceStateMonitor: Device 7ac4c90e is already ONLINE
02-25 11:16:18 I/AndroidNativeDeviceStateMonitor: Waiting 30000 ms for device 7ac4c90e shell to be responsive
02-25 11:16:18 I/AndroidNativeDeviceStateMonitor: Device 7ac4c90e is already ONLINE
02-25 11:16:18 I/AndroidNativeDeviceStateMonitor: Waiting 239999 ms for device 7ac4c90e boot complete
02-25 11:16:18 I/DeviceStateMonitor: Waiting 239945 ms for device 7ac4c90e package manager
02-25 11:16:19 I/AndroidNativeDeviceStateMonitor: Waiting 238695 ms for device 7ac4c90e external store
02-25 11:16:20 I/AndroidNativeDeviceStateMonitor: Device 7ac4c90e is already ONLINE
02-25 11:16:20 I/AndroidNativeDevice: root is required for encryption
02-25 11:16:20 I/AndroidNativeDevice: adb is already running as root on 7ac4c90e
02-25 11:16:20 I/TestDevice: Attempting to disable keyguard on 7ac4c90e using input keyevent 82
02-25 11:16:20 I/AndroidNativeDevice: Recovery successful for 7ac4c90e

这种一般有两种情况: 1.adb异常 2.测试过程中手机异常重启

再看device log:

02-24 20:12:11.451 19176 19297 W ResourceType: No package identifier when getting name for resource number 0x00000000
02-24 20:12:11.453 19176 19297 W ResourceType: ResStringPool_header header size 0x0001 is too small.
02-24 20:12:11.453 19176 19297 F ResourceType: Bad string block: malformed block dimensions
02-24 20:12:11.458 19176 19297 F libc : Fatal signal 6 (SIGABRT), code -6 in tid 19297 (PackageInstalle)
02-24 20:12:11.459 18902 18902 W : debuggerd: handling request: pid=19176 uid=1000 gid=1000 tid=19297
02-24 20:12:11.460 18902 18902 I MIUINDBG_HOOK: hook hook_sigtimedwait
02-24 20:12:11.610 22839 22839 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
02-24 20:12:11.611 22839 22839 F DEBUG : Build fingerprint: 'Xiaomi/hydrogen/hydrogen:7.0/NRD90M/9.2.14:user/release-keys'
02-24 20:12:11.611 22839 22839 F DEBUG : Revision: '0'
02-24 20:12:11.611 22839 22839 F DEBUG : ABI: 'arm64'
02-24 20:12:11.611 22839 22839 F DEBUG : pid: 19176, tid: 19297, name: PackageInstalle >>> system_server <<<
02-24 20:12:11.611 22839 22839 F DEBUG : signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
02-24 20:12:11.626 22839 22839 F DEBUG : Abort message: 'Bad string block: malformed block dimensions'
02-24 20:12:11.626 22839 22839 F DEBUG : x0 0000000000000000 x1 0000000000004b61 x2 0000000000000006 x3 0000000000000008
02-24 20:12:11.626 22839 22839 F DEBUG : x4 203a70616d646900 x5 0000000000000000 x6 0000007f9a0ad000 x7 0000000000000000
02-24 20:12:11.627 22839 22839 F DEBUG : x8 0000000000000083 x9 ffffffffffffffdf x10 0000000000000000 x11 0000000000000001
02-24 20:12:11.627 22839 22839 F DEBUG : x12 ffffffffffffffff x13 0000000000000000 x14 0000000000000000 x15 001b09f143bf2dc1
02-24 20:12:11.627 22839 22839 F DEBUG : x16 0000007f9680bed8 x17 0000007f967b94d0 x18 0000000000000000 x19 0000007f7c1054f8
02-24 20:12:11.627 22839 22839 F DEBUG : x20 0000000000000006 x21 0000007f7c105450 x22 0000000000000002 x23 0000000000000000
02-24 20:12:11.627 22839 22839 F DEBUG : x24 0000007f7b3dc918 x25 0000007f7b3dc900 x26 bd013719673bf5f7 x27 00000000ffffffed
02-24 20:12:11.627 22839 22839 F DEBUG : x28 000000000000007f x29 0000007f7c103f10 x30 0000007f967b6960
02-24 20:12:11.627 22839 22839 F DEBUG : sp 0000007f7c103ef0 pc 0000007f967b94d8 pstate 0000000060000000
02-24 20:12:12.155 22839 22839 F DEBUG : 
02-24 20:12:12.155 22839 22839 F DEBUG : backtrace:
02-24 20:12:12.155 22839 22839 F DEBUG : #00 pc 000000000006b4d8 /system/lib64/[libc.so](http://libc.so/) (tgkill+8)
02-24 20:12:12.155 22839 22839 F DEBUG : #01 pc 000000000006895c /system/lib64/[libc.so](http://libc.so/) (pthread_kill+64)
02-24 20:12:12.155 22839 22839 F DEBUG : #02 pc 0000000000023ea8 /system/lib64/[libc.so](http://libc.so/) (raise+24)
02-24 20:12:12.155 22839 22839 F DEBUG : #03 pc 000000000001c92c /system/lib64/[libc.so](http://libc.so/) (abort+52)
02-24 20:12:12.155 22839 22839 F DEBUG : #04 pc 0000000000010d60 /system/lib64/[libcutils.so](http://libcutils.so/) (__android_log_assert+232)
02-24 20:12:12.155 22839 22839 F DEBUG : #05 pc 000000000001eea0 /system/lib64/[libandroidfw.so](http://libandroidfw.so/) (_ZN7android13ResStringPool5setToEPKvmb+848)
02-24 20:12:12.155 22839 22839 F DEBUG : #06 pc 00000000000259e8 /system/lib64/[libandroidfw.so](http://libandroidfw.so/)(_ZN7android8ResTable12parsePackageEPKNS_16ResTable_packageEPKNS0_6HeaderEbb+628)
02-24 20:12:12.155 22839 22839 F DEBUG : #07 pc 0000000000024b00 /system/lib64/[libandroidfw.so](http://libandroidfw.so/)(_ZN7android8ResTable11addInternalEPKvmS2_mbibb+708)
02-24 20:12:12.155 22839 22839 F DEBUG : #08 pc 0000000000024fdc /system/lib64/[libandroidfw.so](http://libandroidfw.so/)(_ZN7android8ResTable3addEPNS_5AssetES2_ibbb+228)
02-24 20:12:12.155 22839 22839 F DEBUG : #09 pc 000000000001788c /system/lib64/[libandroidfw.so](http://libandroidfw.so/)(_ZNK7android12AssetManager20appendPathToResTableERKNS0_10asset_pathEb+660)
02-24 20:12:12.155 22839 22839 F DEBUG : #10 pc 00000000000174bc /system/lib64/[libandroidfw.so](http://libandroidfw.so/)(_ZN7android12AssetManager12addAssetPathERKNS_7String8EPibb+644)
02-24 20:12:12.155 22839 22839 F DEBUG : #11 pc 00000000000f5728 /system/lib64/[libandroid_runtime.so](http://libandroid_runtime.so/)
02-24 20:12:12.155 22839 22839 F DEBUG : #12 pc 0000000001cf5544 /system/framework/arm64/boot-framework.oat (offset 0x196e000) (android.content.res.AssetManager.addAssetPathNative+160)
02-24 20:12:12.155 22839 22839 F DEBUG : #13 pc 0000000001cf5400 /system/framework/arm64/boot-framework.oat (offset 0x196e000) (android.content.res.AssetManager.addAssetPathInternal+92)
02-24 20:12:12.155 22839 22839 F DEBUG : #14 pc 0000000001cf7ab8 /system/framework/arm64/boot-framework.oat (offset 0x196e000) (android.content.res.AssetManager.addAssetPath+52)
02-24 20:12:12.156 22839 22839 F DEBUG : #15 pc 0000000001cce910 /system/framework/arm64/boot-framework.oat (offset 0x196e000) ([android.content.pm](http://android.content.pm/).PackageParser.parseApkLite+332)
02-24 20:12:12.156 22839 22839 F DEBUG : #16 pc 00000000017fc974 /system/framework/oat/arm64/services.odex (offset 0xf4d000)

那么,system_server重启了导致case中断

失败原因

这个很明显发生了NE,且又能复现,这个就非常方便了,直接抓coredump看一下

#0 tgkill () at bionic/libc/arch-arm64/syscalls/tgkill.S:9
#1 0x0000007f7fb0b960 in pthread_kill (t=<optimized out>, sig=6) at bionic/libc/bionic/pthread_kill.cpp:45
#2 0x0000007f7fac6eac in raise (sig=2625) at bionic/libc/bionic/raise.cpp:34
#3 0x0000007f7fabf930 in abort () at bionic/libc/bionic/abort.cpp:47
#4 0x0000007f80ff4d64 in __android_log_assert (cond=<optimized out>, tag=0x7f7df5ef7c "ResourceType", fmt=<optimized out>) at system/core/liblog/logger_write.c:489
#5 0x0000007f7df48ea4 in android::ResStringPool::setTo (this=0x7f702f8358, data=0x7f4d0bf1a4, size=164480, copyData=false) at frameworks/base/libs/androidfw/ResourceTypes.cpp:478
#6 0x0000007f7df4f9ec in android::ResTable::parsePackage (this=0x7f703a3400, pkg=0x7f4d0bf084, header=0x7f62f7d860, appAsLib=<optimized out>, isSystemAsset=false) at frameworks/base/libs/androidfw/ResourceTypes.cpp:6269
#7 0x0000007f7df4eb04 in android::ResTable::addInternal (this=<optimized out>, data=<optimized out>, dataSize=<optimized out>, idmapData=<optimized out>, idmapDataSize=<optimized out>, appAsLib=<optimized out>, 
cookie=<optimized out>, copyData=<optimized out>, isSystemAsset=<optimized out>) at frameworks/base/libs/androidfw/ResourceTypes.cpp:3932
#8 0x0000007f7df4efe0 in android::ResTable::add (this=0x7f703a3400, asset=0x7f62ab2400, idmapAsset=<optimized out>, cookie=5, copyData=false, appAsLib=false, isSystemAsset=false)
at frameworks/base/libs/androidfw/ResourceTypes.cpp:3773
#9 0x0000007f7df41890 in android::AssetManager::appendPathToResTable (this=0x7f62f15700, ap=..., appAsLib=<optimized out>) at frameworks/base/libs/androidfw/AssetManager.cpp:670
#10 0x0000007f7df414c0 in android::AssetManager::addAssetPath (this=<optimized out>, this@entry=0x7f62f15700, path=..., cookie=<optimized out>, cookie@entry=0x7f6369794c, appAsLib=<optimized out>, appAsLib@entry=false, 
isSystemAsset=<optimized out>, isSystemAsset@entry=false) at frameworks/base/libs/androidfw/AssetManager.cpp:223
#11 0x0000007f7f7c172c in android::android_content_AssetManager_addAssetPath (env=0x7f70250900, clazz=<optimized out>, path=0x7f63697938, appAsLib=0 '\000') at frameworks/base/core/jni/android_util_AssetManager.cpp:550
---Type <return> to continue, or q <return> to quit---
#12 0x0000000073e00548 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

注意#4,#5两帧,这是发生重启的原因

pc = 0x7f7df48ea4 in android::ResStringPool::setTo (frameworks/base/libs/androidfw/ResourceTypes.cpp:478); saved pc = 0x7f7df4f9ec
called by frame at 0x7f636976a0, caller of frame at 0x7f63697490
source language c++.
Arglist at 0x7f63697490, args: this=0x7f702f8358, data=0x7f4d0bf1a4, size=164480, copyData=false
Locals at 0x7f63697490, Previous frame's sp is 0x7f636974c0
Saved registers:
x19 at 0x7f636974a8, x20 at 0x7f636974a0, x21 at 0x7f63697498, x22 at 0x7f63697490, x29 at 0x7f636974b0, x30 at 0x7f636974b8

第5帧对应

status_t ResStringPool::setTo(const void* data, size_t size, bool copyData)

然后查找这里的安全补丁,果然最近进了一个安全补丁,但因为B3不维护了,导致的case fail

后续

对于不维护安全补丁的机型,如何测CTS,感觉后续可以再商量下;这个看的没什么意义;

©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 204,445评论 6 478
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 85,889评论 2 381
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 151,047评论 0 337
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 54,760评论 1 276
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 63,745评论 5 367
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 48,638评论 1 281
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 38,011评论 3 398
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 36,669评论 0 258
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 40,923评论 1 299
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 35,655评论 2 321
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 37,740评论 1 330
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 33,406评论 4 320
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 38,995评论 3 307
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 29,961评论 0 19
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,197评论 1 260
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 45,023评论 2 350
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 42,483评论 2 342

推荐阅读更多精彩内容