Print stack trace

135 views
Skip to first unread message

di...@dasher.im

unread,
May 14, 2015, 5:34:38 PM5/14/15
to v8-u...@googlegroups.com
I have a node.js server that periodically spikes to 100% CPU usage in production. I would like to be able to send it a signal which causes a stack trace, to see where the problem is. So I want to build a custom version of node that listens for a signal and calls v8 to print the current stack. It looks like the function I need is
v8::internal::Isolate::Current()->PrintStack(stdout);

My c++ skills are pretty rusty, however if I understand correctly, because this is in the internal namespace I'm not able to access it:

../src/node.cc:3767:21: error: incomplete type 'v8::internal::Isolate' named in nested name specifier

      v8::internal::Isolate::Current()->PrintStack(stdout);

      ~~~~~~~~~~~~~~^~~~~~~~~

../deps/v8/include/v8.h:130:7: note: forward declaration of 'v8::internal::Isolate'

class Isolate;

      ^

1 error generated.


Is there some other way to cause v8 to print a stack trace?
Thanks,
Dirk

di...@dasher.im

unread,
May 23, 2015, 8:10:35 PM5/23/15
to v8-u...@googlegroups.com
I was able to get a stack trace by compiling my own version of node and v8:
https://github.com/joyent/node/issues/25263
Reply all
Reply to author
Forward
0 new messages