解决"waitForCondition(LockCondition) timed out (identity=23, status=0). CPU may be pegged. trying again."问题
2013-11-26 13:35
417 查看
前几天在跑游戏引擎的时候,遇到了一个比较奇怪的问题,logcat不断地打印下面的错误:
waitForCondition(LockCondition) timed out (identity=23, status=0). CPU may be pegged. trying again.
更为奇怪的是,机器完全不能响应,最终重启,而且是可以100%重现的。
测试的机器是Moto ME525(MIUI 2.3.7)。
经过排查,发现与FBO的使用有关,引擎中对FBO使用的大概逻辑是:
问题就出在,在return之前没有恢复到默认的FBO,解决起来也比较简单:
网上也有一些关于此问题的讨论,一部分人说是FBO的问题,一部分人说并非是FBO的问题;但我更相信是FBO的问题,理由如下:
先来看看GLSurfaceView中的一个代码片段
报出错误日志的地方正是上面对swap的调用之处,而swap的功能正是交换前后缓冲区,而FBO显然是影响缓冲区的。
waitForCondition(LockCondition) timed out (identity=23, status=0). CPU may be pegged. trying again.
更为奇怪的是,机器完全不能响应,最终重启,而且是可以100%重现的。
测试的机器是Moto ME525(MIUI 2.3.7)。
经过排查,发现与FBO的使用有关,引擎中对FBO使用的大概逻辑是:
@Override public void onDrawFrame(GL10 gl) { gl.glBindFramebuffer(GL10.GL_FRAMEBUFFER, 0); gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT); // here is some code that use fbo //gl.glBindFramebuffer(GL10.GL_FRAMEBUFFER, fbo); return; }
问题就出在,在return之前没有恢复到默认的FBO,解决起来也比较简单:
@Override public void onDrawFrame(GL10 gl) { gl.glBindFramebuffer(GL10.GL_FRAMEBUFFER, 0); gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT); // here is some code that use fbo //gl.glBindFramebuffer(GL10.GL_FRAMEBUFFER, fbo); // restore to the default fbo gl.glBindFramebuffer(GL10.GL_FRAMEBUFFER, 0); return; }
网上也有一些关于此问题的讨论,一部分人说是FBO的问题,一部分人说并非是FBO的问题;但我更相信是FBO的问题,理由如下:
先来看看GLSurfaceView中的一个代码片段
GLSurfaceView view = mGLSurfaceViewWeakRef.get(); if (view != null) { view.mRenderer.onDrawFrame(gl); } int swapError = mEglHelper.swap();
报出错误日志的地方正是上面对swap的调用之处,而swap的功能正是交换前后缓冲区,而FBO显然是影响缓冲区的。
相关文章推荐
- process launch failed: timed out waiting for app to launch问题解决
- Android-问题-obtainBuffer timed out (is the CPU pegged?)
- hadoop的"mapred.ReduceTask: java.net.ConnectException: Connection timed out"问题解决
- 解决error: failed to launch"/private/var/mobile/Applications/XX"-- timed out waiting for app to launch
- 解决error: failed to launch"/private/var/mobile/Applications/XX"-- timed out waiting for app to launch
- 如何解决 "This function or variable may be unsafe" 的问题
- 解决“Row cannot be located for updating. Some values may have been changed since it was last read.”的问题
- [原]在Oracle SOASUITE 10g Register ESB 报“The exception reported is: "javax.transaction.RollbackException: Timed out”问题的解决办法
- Eclipse中编写servlet时出现"The import javax.servlet cannot be resolved" 问题解决办法
- 不能启动:please use a kernel for your cpu问题解决
- **** cannot be found. please check the location and try again 问题解决
- keystone中Vertify operation出现:No handlers could be found for logger "keystoneclient.httpclient"的问题
- "this class is not key value coding-compliant for the key ..."问题的解决
- 问题解决:INSTRUMENTATION_STATUS: Error=Unable to find instrumentation info for
- upstream timed out (110: Connection timed out) while reading response header from upstream 问题解决
- .NET中使用GridView控件输入数据时出现“ Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index"的问题
- MAVEN导入依赖的Jar包时Index downloads are disabled, search results may be incomplete问题的解决
- 记录解决eclipse的"Resource specification not allowed here for source level below 1.7"问题
- c3p0数据库连接池问题-----不能取到连接An attempt by a client to checkout a Connection has timed out(问题还没有解决)
- Undefined symbols for architecture i386:和"_OBJC_CLASS_$_xx", referenced from:问题解决方法