6

I'm seeing this crash now and am not familiar enough with the node fiber infrastructure to know where to begin interpreting the error or instrumenting the code...

Meteor server running on: http://localhost:3000/
W202407-10:06:05.740(-8)? (STDERR) /Users/dauser/.meteor/tools/0b2f28e18b/lib/node_modules/fibers/future.js:173
W202407-10:06:07.363(-8)? (STDERR)                      throw(ex);
W202407-10:06:07.363(-8)? (STDERR)                            ^
W202407-10:06:07.363(-8)? (STDERR) RangeError: Maximum call stack size exceeded
=> Exited with code: 8
=> Meteor server restarted

As I understand it, something is recurring a little too enthusiastically, the server stack blows up, and it crashes. Unfortunately, I have no real idea where this offending function is--I looked at the my Deps.autorun call (just one at the moment) and it does not seem to be the trouble. None of my code is implemented with explicit recursion, and I don't have any reason to suspect large objects are being passed around. Obviously, I'm not really sure, of course.

I'm really just looking for advice on how to instrument the code to show me where things are getting out of hand. Since Meteor's doing a whole lot behind the scenes, it would be really useful if anyone could give me a few pointers as to where to look.

Just coming back to this, and am still pretty lost as to where to be looking. this suggested updating to node 0.11.x would give me more info, but doing that doesn't seem to have added any more detail when it crashes.

The crash happens after any page interaction--that is, the server starts up and is functioning ok, but if I reload in the browser or interact with the page itself, BOOM!

By popular demand, here is the server code:

isAuthorized = () ->
    console.log "checking authorization"
    this.userId == Assets.getText('authorizedUsers')

Meteor.methods(
    isAuthorized : isAuthorized
    filePickerKey : () -> 
        # TODO: properly abstract this, rather than copy/paste...       
        if this.userId == Assets.getText('authorizedUsers')
            Assets.getText('fpKey')
        else
            Meteor.Error 403, 'Error 403: Forbidden')

uncommenting line 172 of future.js did not provide more details:

I2041-15:52:07.363(-8)? Resolve cb threw Maximum call stack size exceeded

And, here's the trouble I run into while trying to use node-inspector. I have been playing with this for the past half hour, so I'm likely just making some fundamental error, but: I installed node-inspector via npm (npm install -g node-inspector).

then, I try

$ node-inspector &
[1] 3408
$ Node Inspector v0.6.2
  info  - socket.io started
Visit http://127.0.0.1:8080/debug?port=5858 to start debugging.

$ meteor &
[2] 3413
$ [[[[[ ~/Projects/indefinite-ways ]]]]]

=> Meteor server running on: http://localhost:3000/

$ kill -s USR1 3413
Hit SIGUSR1 - starting debugger agent.
debugger listening on port 5858

so far, so good. At this point, the client side is not open in my browser (i.e. no tab pointing at localhost:3000). I open up a Chrome tab pointing to localhost:5858, and see the source for meteor.js I set a breakpoint on line 6 of meteor.js

var Fiber = require('fibers');

and then open the meteor client tab (localhost:3000) and the aforementioned stack overflow pops up again. The debugger does not halt on line 6, or in any other way indicate that it has noticed. Same is true if I set a breakpoint at line 3.

4

3 回答 3

4

试试node-inspector,它允许检查调用堆栈。这是一个如何使用它的视频演示,在视觉上它看起来像 chrome 调试器(它是相同的基本源)。

于 2013-12-11T00:17:13.650 回答
2

稍微更有帮助的答案来自非官方的 Meteor 常见问题解答

$ node-inspector &
$ NODE_OPTIONS='--debug-brk' mrt run &

这将在后台启动节点检查器进程,然后启动流星的节点容器并设置正确的调试标志进行侦听。打开 Chrome 选项卡http://127.0.0.1:8080/debug?port=5858让我逐步完成。

此外,严格来说不是问题的答案,但上面代码中的违规行似乎是Meteor.Error在服务器代码中调用。我仍然很乐意接受一个可以确定这一点的答案。我猜 Meteor.Error 根本不是 EJSONable,在尝试解析它时,堆栈会爆炸。

于 2013-12-17T02:04:39.673 回答
1

future.js 的第 173 行将异常转发给下一个侦听器。在您的情况下,下一个侦听器似乎是实例本身,从而导致堆栈崩溃循环。

编辑您的future.js 文件(在OP 中引用的路径)并取消注释它上面的console.log 行......然后您应该会看到正在发生的事情的更详细说明。如果 console.log 输出对解决没有帮助,请在此处发布以进行进一步诊断。

我的猜测是,根据这个线程,它与丢失的包有关。

于 2013-12-12T23:18:25.147 回答