操作:在微信中给某个好友,发送(2 个数字 + 15 个中文标点符号)
测试机型:Nexus6P(angler-userdebug 7.0 NRD90E 3040393 DEV-keys)
现象:微信卡死,点击会触发 ANR。(不管发送方还是接收方就会被卡死)
恢复:重启微信,删除该 会话。
PS:目测市面多款机型都收到影响,以下是部分 log,微信团队看到请关注:
从抓取的ANR堆栈看,问题是由微信main线程被阻塞导致。
抓取多份log,都是在文本控件绘制前,进行测量时卡死,但是卡死的具体函数不一致。例如:
A:获取文本宽度:getTextWidths
at android.graphics.Paint.nGetTextAdvances(Native method)
at android.graphics.Paint.getTextWidths(Paint.java:2050)
at com.tencent.mm.ui.widget.celltextview.c.d.a(SourceFile:166)
at com.tencent.mm.ui.widget.celltextview.f.b.a(SourceFile:53)
at com.tencent.mm.ui.widget.celltextview.d.a.Cw(SourceFile:466)
at com.tencent.mm.ui.widget.celltextview.d.a.Cp(SourceFile:92)
at com.tencent.mm.ui.widget.celltextview.CellTextView.onMeasure(SourceFile:102)
at android.view.View.measure(View.java:19917)
B:字符串格式转换:format
at libcore.icu.ICU.getCurrencyCode(Native method)
at java.util.Currency.getInstance(Currency.java:138)
at java.text.DecimalFormatSymbols.initialize(DecimalFormatSymbols.java:623)
at java.text.DecimalFormatSymbols.<init>(DecimalFormatSymbols.java:96)
at java.text.DecimalFormatSymbols.getInstance(DecimalFormatSymbols.java:159)
at java.util.Formatter.getZero(Formatter.java:2254)
at java.util.Formatter.<init>(Formatter.java:1880)
at java.util.Formatter.<init>(Formatter.java:1901)
at java.lang.String.format(String.java:2626)
at com.tencent.mm.sdk.platformtools.v.i(SourceFile:256)
at com.tencent.mm.ui.widget.celltextview.f.b.a(SourceFile:76)
at com.tencent.mm.ui.widget.celltextview.d.a.Cw(SourceFile:467)
at com.tencent.mm.ui.widget.celltextview.d.a.Cp(SourceFile:92)
at com.tencent.mm.ui.widget.celltextview.CellTextView.onMeasure(SourceFile:102)
at android.view.View.measure(View.java:19917)
C:微信写Xlog:
at com.tencent.mars.xlog.Xlog.logWrite2(Native method)
at com.tencent.mars.xlog.Xlog.logI(SourceFile:61)
at com.tencent.mm.sdk.platformtools.v.i(SourceFile:260)
at com.tencent.mm.ui.widget.celltextview.f.b.a(SourceFile:76)
at com.tencent.mm.ui.widget.celltextview.d.a.Cw(SourceFile:466)
at com.tencent.mm.ui.widget.celltextview.d.a.Cp(SourceFile:92)
at com.tencent.mm.ui.widget.celltextview.CellTextView.onMeasure(SourceFile:102)
at android.view.View.measure(View.java:19923)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6139)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1489)
at android.widget.LinearLayout.measureHorizontal(LinearLayout.java:1134)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:659)
at android.view.View.measure(View.java:19923)