Things we can do with the paused node process are additionally limited by absence of many symbols in the debug build. Unfortunately GDB does not know anything about native code that V8 generated from JavaScript source so it can't print stack trace itself: (gdb) bt It will break execution in some random place of your infinite loop: 0x00000bf778c63d5f in ? () How can you get the stacktrace to troubleshoot the issue? First attach GDB debugger to the node process: $ gdb attach $(pidof node) You node process will get stuck if you try to run it $ node test.js & Imagine you have a JavaScript code with an infinite loop $ cat test.js This is a step by step hack to get JavaScript stack trace from a node process that is stuck in the infinite loop. Learn more about bidirectional Unicode characters To review, open the file in an editor that reveals hidden Unicode characters. This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |