Android 活动冻结,需要帮助解释日志

发布于 2024-11-01 07:49:57 字数 2876 浏览 4 评论 0原文

已与调用 mSurfaceHolder.unlockCanvasAndPost(canvas); 链接起来

这些事件最近 正常返回,而其他人只是崩溃(有时确实使手机崩溃,让我重新启动)。它大约每 1/5 次尝试就会发生一次,而且由于某种原因,我实际上很难用 DDMS 捕获它,因为当我尝试记录/分析它时它根本不会出现故障。

此后,我使用 DDMS 记录了整个冻结期间的以下活动。如果我碰巧遇到我的解决方案,同时我会发回来,对此日志的任何帮助将不胜感激。提前致谢!

04-15 05:14:03.154: WARN/SharedBufferStack(4148): waitForCondition(DequeueCondition) timed out (identity=355, status=0). CPU may be pegged. trying again.
04-15 05:14:04.154: WARN/SharedBufferStack(4148): waitForCondition(DequeueCondition) timed out (identity=355, status=0). CPU may be pegged. trying again.
04-15 05:14:05.154: WARN/SharedBufferStack(4148): waitForCondition(DequeueCondition) timed out (identity=355, status=0). CPU may be pegged. trying again.
04-15 05:14:06.154: WARN/SharedBufferStack(4148): waitForCondition(DequeueCondition) timed out (identity=355, status=0). CPU may be pegged. trying again.
04-15 05:14:07.154: WARN/SharedBufferStack(4148): waitForCondition(DequeueCondition) timed out (identity=355, status=0). CPU may be pegged. trying again.
04-15 05:14:08.123: INFO/ActivityThread(4148): Removing dead content provider: settings
04-15 05:14:08.154: WARN/SharedBufferStack(4148): waitForCondition(DequeueCondition) timed out (identity=355, status=0). CPU may be pegged. trying again.
04-15 05:14:08.186: DEBUG/SensorManager(4148): _sensors_data_poll() failed, we bail out.

还使用加速计、触摸和捕捉按键。所有这些都是在使用 canvasThreadsurfaceView 进行绘图时完成的。所有这些都与 UI 线程“分离”。

一直试图从崩溃中获取堆栈跟踪,但是当我将调试器附加到它时,该死的事情不会在我身上出现故障;然而,它似乎确实以几乎一半的速率从加速度计获取数据?知道这是为什么吗?

[编辑] --- 终于得到了堆栈跟踪

Thread [<9> CanvasThread] (Suspended)   
    **Surface.unlockCanvasAndPost(Canvas) line: not available [native method]** 
    SurfaceView$3.unlockCanvasAndPost(Canvas) line: 804 
    CanvasSurfaceView$CanvasThread.run() line: 233  


Thread [<8> AsyncQueryWorker] (Suspended)   
    **Object.wait(long, int) line: not available [native method]**  
    MessageQueue(Object).wait() line: 288   
    MessageQueue.next() line: 146   
    Looper.loop() line: 123 
    HandlerThread.run() line: 60    


Thread [<7> Binder Thread #2] (Suspended)   
    **NativeStart.run() line: not available [native method]**   


Thread [<6> Binder Thread #1] (Suspended)   
    **NativeStart.run() line: not available [native method]**   

Daemon System Thread [<5> Compiler] (Suspended) 
    NativeStart.run() line: not available [native method]   

Daemon System Thread [<3> Signal Catcher] (Suspended)   
    NativeStart.run() line: not available [native method]   

Daemon System Thread [<2> HeapWorker] (Suspended)   
    NativeStart.run() line: not available [native method]

新信息,在使用 DDMS 时,我尝试在冻结时点击“停止进程”,并且它会杀死应用程序一秒钟,然后它会重新出现并毫不犹豫地继续......奇怪

These events have recently been linked to the call mSurfaceHolder.unlockCanvasAndPost(canvas);

Hey guys, been working on this app for a while now and every now-and-then it will simply freeze on me, sometimes returning normally and others simply crashing out (sometimes literally crashing the phone, making me reboot). It only happens roughly every 1/5 attempts, and it was actually hard for me to catch with DDMS for some reason because it simply wouldn't glitch while I was trying to log/profile it.

I've since logged the activity below throughout the freeze with DDMS. Any help with this log would be much appreciated, if I happen to come across my solution in the mean time I'll post back. Thanks in advance!

04-15 05:14:03.154: WARN/SharedBufferStack(4148): waitForCondition(DequeueCondition) timed out (identity=355, status=0). CPU may be pegged. trying again.
04-15 05:14:04.154: WARN/SharedBufferStack(4148): waitForCondition(DequeueCondition) timed out (identity=355, status=0). CPU may be pegged. trying again.
04-15 05:14:05.154: WARN/SharedBufferStack(4148): waitForCondition(DequeueCondition) timed out (identity=355, status=0). CPU may be pegged. trying again.
04-15 05:14:06.154: WARN/SharedBufferStack(4148): waitForCondition(DequeueCondition) timed out (identity=355, status=0). CPU may be pegged. trying again.
04-15 05:14:07.154: WARN/SharedBufferStack(4148): waitForCondition(DequeueCondition) timed out (identity=355, status=0). CPU may be pegged. trying again.
04-15 05:14:08.123: INFO/ActivityThread(4148): Removing dead content provider: settings
04-15 05:14:08.154: WARN/SharedBufferStack(4148): waitForCondition(DequeueCondition) timed out (identity=355, status=0). CPU may be pegged. trying again.
04-15 05:14:08.186: DEBUG/SensorManager(4148): _sensors_data_poll() failed, we bail out.

Using accelerometer, touch, and capturing keys as well. All of this while using a canvasThread to do my drawing from a surfaceView. All of which is "separated" from the UI thread.

Have been trying to get a stack trace off the crash, but when I attach the debugger to it the darn thing won't glitch on me; it does however seem to get data from the accelerometer at almost half the rate? Any idea why this is?

[EDIT] --- Finally got a stack trace

Thread [<9> CanvasThread] (Suspended)   
    **Surface.unlockCanvasAndPost(Canvas) line: not available [native method]** 
    SurfaceView$3.unlockCanvasAndPost(Canvas) line: 804 
    CanvasSurfaceView$CanvasThread.run() line: 233  


Thread [<8> AsyncQueryWorker] (Suspended)   
    **Object.wait(long, int) line: not available [native method]**  
    MessageQueue(Object).wait() line: 288   
    MessageQueue.next() line: 146   
    Looper.loop() line: 123 
    HandlerThread.run() line: 60    


Thread [<7> Binder Thread #2] (Suspended)   
    **NativeStart.run() line: not available [native method]**   


Thread [<6> Binder Thread #1] (Suspended)   
    **NativeStart.run() line: not available [native method]**   

Daemon System Thread [<5> Compiler] (Suspended) 
    NativeStart.run() line: not available [native method]   

Daemon System Thread [<3> Signal Catcher] (Suspended)   
    NativeStart.run() line: not available [native method]   

Daemon System Thread [<2> HeapWorker] (Suspended)   
    NativeStart.run() line: not available [native method]

New information, while using DDMS I tried hitting "Stop Process" when it freezes, and it kills the app for a second after which it reappears and continues without hesitation... wierd

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文