调试“超过最大调用堆栈大小” [英] Debugging "Maximum call stack size exceeded"

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

问题描述

我有一个服务器可以导致以下输出:

I have a server that I can cause to die with the following output:

events.js:38
EventEmitter.prototype.emit = function(type) {
                                  ^
RangeError: Maximum call stack size exceeded

但是,没有堆栈转储或跟踪,我无法找到这是无限递归还是只是一个稍大的链,更不用说问题功能在哪里了。

However, without a stack dump or trace, I have no way of finding whether this is infinite recursion or just a slightly-too-large chain, let alone where the problem function is.

运行节点与 - 跟踪选项导致我的测试不仅运行缓慢(按预期),但不重现这个问题。

Running Node with the --trace option caused my tests to not only run slow (as one would expect), but to not reproduce the problem.

任何人都有任何解决方案或技巧来达到这个目的?

Anybody have any solutions or tips for getting to the bottom of this?

推荐答案

目前看来答案是:请坐紧,等待Node.js更新到较新的V8版本,或使用这个Chromium项目bug代码的补丁ort

It seems the answer is currently: sit tight and wait for Node.js to update to a newer V8 version, or build your own with the patch from this Chromium project bug report.

v8-dev邮件列表中的这个存档的线程显示了一个讨论,其中

This archived thread from the v8-dev mailing list shows a discussion in which


  • 戴维·史密斯提出了这个问题,并提出了一个补丁

  • Chromium项目的杨果讨论了这个问题,并提出了一个针对该问题的Chromium错误,并应用了另一个修正

  • Dave指出,Node(当时为0.8)正在使用V8 3.11,并要求关于返回补丁。杨回答说补丁可能会在V8 3.15中登陆,不会被回覆。

请注意,Node.js v0.8使用V8 3.11 Node.js 0.10目前正在使用V8 3.14。因此,对于这个问题,Chromium接受的补丁在Node方面仍然是将来。

Note that Node.js v0.8 used V8 3.11; Node.js 0.10 is currently using V8 3.14. So the patch accepted by Chromium for this issue is still "in the future" as far as Node is concerned.

(这个答案归结于@Coderoshi,因为它是由从他的答案的线索,我学到了所有这一切。)

(This answer owes thanks to @Coderos since it's by following the thread from his answer that I learned all this.)

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

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