Live debugging a frozen nodejs program

Viewed 159

I have a nodejs process running but after a couple hours it keeps just getting stuck in some infinite loop somewhere, no error message or timeout message right now. So I am trying to live debug the frozen program: On the command line I run $ top to get the process id of my node program, then run these commands to go into the node debug mode:

//my node PID=2599
$ kill -SIGUSR1 2599
$ node inspect -p 2599
debug> pause
break in internal/timers.js:483
 481
 482   function processTimers(now) {
>483     debug('process timer lists %d', now);
 484     nextExpiry = Infinity;
 485
debug> bt
#0 processTimers internal/timers.js:483:4
debug>

The two debug commands I've used so far are bt and pause, and I can see it points to a line in internal/timers.js, but where can I fine the location of this file? I've searched for the filename and code in my project but can't find it anywhere. I am running this version:

$ npm -v
7.12.0
$ node -v
v14.16.1
0 Answers
Related