Android Lollipop 5.1: Fatal signal 11 (SIGSEGV), code 2, fault addr 0x9e985ff8 in tid 4093 (RenderThread) / when using lot of nine patch graphics

匿名 (未验证) 提交于 2019-12-03 01:20:02

问题:

I'm using quite a large amount of NinePatchDrawables in the app views. The underlying Bitmaps are cached, so there is no memory issue.

While preparing/drawing the screen, the app crashes with the following log entry:

04-03 19:37:42.651: A/libc(4064): Fatal signal 11 (SIGSEGV), code 2, fault addr 0x9e985ff8 in tid 4093 (RenderThread) 

The issue just popped up with the latest Android 5.1 builds (LMY47D, LMY47E, LMY47I). The same views with the same graphics worked well on earlier Android Versions up to 5.0.2 (LRX22C). I'm getting the issue on the Nexus 6, so far I don't had the chance to test it on any other device.

The crash occurs only when using a large amount of NinePatchDrawables, especially when layering them on top of each other. When I load exactly the same graphics (just for testing) as plain png's, it works without problems. Also other views with a smaller amount of NinePatchDrawables work without problems.

The same issue was existing on earlier Android versions (5.0.2 or older), but it just happened with at least three or four times as much NinePatchDrawables per screen.

04-03 19:37:42.651: A/libc(4064): Fatal signal 11 (SIGSEGV), code 2, fault addr 0x9e985ff8 in tid 4093 (RenderThread) 04-03 19:37:42.752: I/DEBUG(354): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 04-03 19:37:42.752: I/DEBUG(354): Build fingerprint: 'google/shamu/shamu:5.1/LMY47D/1743759:user/release-keys' 04-03 19:37:42.752: I/DEBUG(354): Revision: '33696' 04-03 19:37:42.752: I/DEBUG(354): ABI: 'arm' 04-03 19:37:42.752: I/DEBUG(354): pid: 4064, tid: 4093, name: RenderThread  >>> com.xyz.myapp 

Any help would be very much appreciated. Thanks a lot in advance.

回答1:

So far (even in Android M) there's no bug fix for the graphics driver bug (Adreno 420), but I found a way to work around the bug. It's definitely not a long time solution, but for the moment it's just the best available to stop apps from crashing.

I reduced the number of graphics layers to a minimum (flattened many layered graphics)

I disabled GPU rendering for particular graphic layers. It slows the drawing down a bit, but not significant.

view.setLayerType(View.LAYER_TYPE_SOFTWARE, null); 

Within the "software" layers, you can still set particular views to "hardware" rendering, if you need to.

view.setLayerType(View.LAYER_TYPE_HARDWARE, null); 


回答2:

I have a some problem, an I added below code to Android Manifest. It is work fine.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!