Google Chrome:如何随机调试“超出最大调用堆栈大小”错误 [英] Google Chrome: How to debug random "Maximum call stack size exceeded" errors

查看:391
本文介绍了Google Chrome:如何随机调试“超出最大调用堆栈大小”错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在一个复杂的JavaScript应用程序(使用jQuery和Ember)中,JavaScript会偶尔随机崩溃,无论是在页面加载期间还是在页面上执行操作时。错误如下(屏幕截图):

未捕获的RangeError:超过最大调用堆栈大小
Class.proto
Class.proto
...

...有几页 Class.proto 堆栈跟踪行,但没有源/行信息无论如何,即使在踪迹的底部。



我知道这指向无限递归,这可能发生在事件系统中,但没有明显的起始点击我。



我只能在Chrome Canary (22.0.1209.0)中重新生成,而不是Chrome稳定版或Firefox。该应用程序不会与任何外部服务通话或发出任何Ajax请求。



由于它偶尔发生,并且没有明显的原因,并且因为没有可用的堆栈跟踪,我无法追查原因。



我的问题:我能做些什么来调试这个问题?

解决方案

在Chrome开发人员工具栏中启用打破例外功能。使用来源选项卡上工具栏页脚中的图标>>图标(有3个州!)

它应该停止你的代码,你可以看到堆栈!

In a complex JavaScript app (with jQuery and Ember), the JavaScript will occasionally crash randomly, either during page load or when I perform an action on the page. The error is as follows (screenshot):

Uncaught RangeError: Maximum call stack size exceeded
  Class.proto
  Class.proto
  ...

... with several pages of Class.proto stack trace lines, but no source/line information whatsoever, even at the bottom of the trace.

I know that this points at infinite recursion, and this could conceivably happen in the event system, but there is no obvious starting point for me.

I've been able to reproduce this only in Chrome Canary (22.0.1209.0), not Chrome stable or Firefox. The app is not talking to any external service or making any Ajax requests.

Since it happens only occasionally, and with no discernible cause, and since there's no usable stack trace, I'm having trouble tracking down the cause.

My question: What can I do to debug this problem?

解决方案

Enable 'Break on exceptions' in the Chrome Developer Toolbar. Use this icon in the footer of the toolbar on the Sources tab (there are 3 states!)

It should stop your code and you can see the stack!

这篇关于Google Chrome:如何随机调试“超出最大调用堆栈大小”错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆