Just wanted to share an experience I had to see if anyone came across such issue, if they found the cause and more importantly how they fixed it.
只是想分享一个经验,我必须看到是否有人遇到过这样的问题,如果他们找到原因,更重要的是他们如何修复它。
The problem is pretty simple: while debugging native code on a Nexus 6, which as the Adreno 420 GPU, eglSwapBuffer could crash under certain circumstances when using Android 5.1 (5.0 worked perfectly). Since I could not repro it I am unable to tell you what went wrong. According to the documentation, elgSwapBuffer calls internally glFlush; and so if I call glFlush before calling eglSwapBuffer all of a sudden it works perfectly. My guess is that the driver does not flush properly thus crashing when swaping the buffers.
问题非常简单:在Nexus 6上调试本机代码时,作为Adreno 420 GPU,eglSwapBuffer在使用Android 5.1(5.0完美运行)的某些情况下可能会崩溃。由于我无法重复它,我无法告诉你出了什么问题。根据文档,elgSwapBuffer内部调用glFlush;因此,如果我在调用eglSwapBuffer之前调用glFlush,它会突然工作。我的猜测是驱动程序没有正确刷新,因此在交换缓冲区时会崩溃。
Any comments on this?
对此有何评论?
Cheers, D
干杯,D
2 个解决方案
#1
1
I'm having the same problem and I can reproduce it. It happens obviously because it runs out of stack memory due to deep nested loops in the rendering process.
我有同样的问题,我可以重现它。它显然是因为由于渲染过程中的深嵌套循环而耗尽堆栈内存。
Android Lollipop 5.1:致命信号11(SIGSEGV),代码2,故障地址0x9e985ff8 in tid 4093(RenderThread)/当使用大量9个补丁图形时
I've already reported it to the google issue tracker:
我已经向谷歌问题跟踪器报告了它:
https://code.google.com/p/android/issues/detail?id=163100
https://code.google.com/p/android/issues/detail?id=163100
Update: Meanwhile I found a way to work around this issue. It's definitely not a long time solution, but for the moment, it's just the best available to stop my apps from crashing.
更新:同时我找到了解决此问题的方法。这绝对不是一个长期的解决方案,但目前,这是阻止我的应用程序崩溃的最佳方案。
I disabled GPU rendering for particular graphic layers. It slows the drawing down a bit, but not significant.
我禁用了特定图形图层的GPU渲染。它减慢了一点,但不显着。
So the nightmare is over for now, but I still think, this issue must be fixed on the driver itself. It cannot be that something that worked perfect with 5.0.2 and below, immediately stops to work with 5.1.
所以现在噩梦已经结束了,但我仍然认为,这个问题必须在驱动程序本身上修复。不能用5.0.2及以下版本完美的东西立即停止使用5.1。
#2
0
I have seen some weird behavior on the N6 as well, and while I cannot rule out app bugs, it looks to me like the Adreno driver is to blame.
我在N6上也看到了一些奇怪的行为,虽然我不能排除app bug,但我认为Adreno驱动程序应该受到责备。
Specifically, in landscape mode, our GLSurfaceView only renders one half of it's content, but occasionally flickers all of it. And with certain scenes being rendered there is intermittent flickering. In a case of extra weirdness, I have seen one half of the screen completely freeze, stuck on app content, even after returning to the launcher via the home button. It appears kind of like it would if it used multi stream transport and one of the streams was getting lost.
具体来说,在横向模式下,我们的GLSurfaceView仅渲染其中一半的内容,但偶尔会闪烁所有内容。并且在渲染某些场景时会出现间歇性闪烁。在一个额外的怪异的情况下,我已经看到屏幕的一半完全冻结,卡在app内容上,即使在通过主页按钮返回启动器之后。它似乎有点像它使用多流传输而其中一个流丢失。
#1
1
I'm having the same problem and I can reproduce it. It happens obviously because it runs out of stack memory due to deep nested loops in the rendering process.
我有同样的问题,我可以重现它。它显然是因为由于渲染过程中的深嵌套循环而耗尽堆栈内存。
Android Lollipop 5.1:致命信号11(SIGSEGV),代码2,故障地址0x9e985ff8 in tid 4093(RenderThread)/当使用大量9个补丁图形时
I've already reported it to the google issue tracker:
我已经向谷歌问题跟踪器报告了它:
https://code.google.com/p/android/issues/detail?id=163100
https://code.google.com/p/android/issues/detail?id=163100
Update: Meanwhile I found a way to work around this issue. It's definitely not a long time solution, but for the moment, it's just the best available to stop my apps from crashing.
更新:同时我找到了解决此问题的方法。这绝对不是一个长期的解决方案,但目前,这是阻止我的应用程序崩溃的最佳方案。
I disabled GPU rendering for particular graphic layers. It slows the drawing down a bit, but not significant.
我禁用了特定图形图层的GPU渲染。它减慢了一点,但不显着。
So the nightmare is over for now, but I still think, this issue must be fixed on the driver itself. It cannot be that something that worked perfect with 5.0.2 and below, immediately stops to work with 5.1.
所以现在噩梦已经结束了,但我仍然认为,这个问题必须在驱动程序本身上修复。不能用5.0.2及以下版本完美的东西立即停止使用5.1。
#2
0
I have seen some weird behavior on the N6 as well, and while I cannot rule out app bugs, it looks to me like the Adreno driver is to blame.
我在N6上也看到了一些奇怪的行为,虽然我不能排除app bug,但我认为Adreno驱动程序应该受到责备。
Specifically, in landscape mode, our GLSurfaceView only renders one half of it's content, but occasionally flickers all of it. And with certain scenes being rendered there is intermittent flickering. In a case of extra weirdness, I have seen one half of the screen completely freeze, stuck on app content, even after returning to the launcher via the home button. It appears kind of like it would if it used multi stream transport and one of the streams was getting lost.
具体来说,在横向模式下,我们的GLSurfaceView仅渲染其中一半的内容,但偶尔会闪烁所有内容。并且在渲染某些场景时会出现间歇性闪烁。在一个额外的怪异的情况下,我已经看到屏幕的一半完全冻结,卡在app内容上,即使在通过主页按钮返回启动器之后。它似乎有点像它使用多流传输而其中一个流丢失。