ddopson / node-segfault-handler

Tool for debugging native Node.js modules and getting stack traces when things go wrong.
BSD 3-Clause "New" or "Revised" License
319 stars 74 forks source link

question: requiring this module fixes my segfault problem. What am I doing? :-D #55

Open ericblade opened 6 years ago

ericblade commented 6 years ago

Leaving this here where maybe people with some experience debugging node native modules might suggest some ideas.

I'm having a problem with a native node module crashing. That module is here: https://github.com/webosose/nodejs-module-webos-sysbus

While trying to track down the point of the crash, I discovered node-segfault-handler. I built that for the target system, and I require it as the very first thing in my source. The crashing has stopped completely (well , at least for the first 500 attempts . . it was a random problem, but it was happening at least 1 in 10 times before)

Any ideas what might cause something like that?

I'm using nodejs 6.11.2 on the target environment, but that doesn't seem to make any difference.

Matt-Esch commented 5 years ago

https://nodejs.org/dist/v8.9.3/docs/api/cli.html#cli_abort_on_uncaught_exception

If you can cause the process to segfault and dump core it can be inspected with gdb. You need to ensure that the correct ulimit is set to allow dumping core files (ulimit -c unlimited).