node js script crashes: Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)

10,922

The exit code (139) means a segmentation fault occurred (128 + 11 (for segfault)).

You can use the segfault-handler module to debug the segmentation fault. You can use it like so:

var SegfaultHandler = require('segfault-handler');

SegfaultHandler.registerHandler("crash.log"); // With no argument, SegfaultHandler will generate a generic log file name

// Write the cause that causes the segmentation fault here

You should see a stack trace that you can now debug using tools like objdump -dS module.node.

objdump displays information about one or more object files.

Share:
10,922
Tree
Author by

Tree

Updated on June 04, 2022

Comments

  • Tree
    Tree almost 2 years

    My script crashes and debugger is unable to catch the error. I even tried to try catch some functions but it didnt work.

    Any suggestion how to narrow down where the problem could be?

    The script is a testing script for a game. It works good for previous games, but for new game there are some new cases. Unfortunately I cannot know where is the error. Probably when unique case object is received from server.

    The script is testing against the server and writing output to either console or file. In both cases error happens.

    Error: Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)

    edit:

    here is SegfaultHandler output:

    PID 2645 received SIGSEGV for address: 0x0 0 segfault-handler.node 0x00000001034ae1c8 _ZL16segfault_handleriP9__siginfoPv + 280 1 libsystem_platform.dylib 0x00007fff9364b52a _sigtramp + 26 2 ??? 0x0000000000000010 0x0 + 16 3 node 0x000000010067bbdc _ZN2v88internal23Runtime_GetFrameDetailsEiPPNS0_6ObjectEPNS0_7IsolateE + 2364 4 ??? 0x00000a107710961b 0x0 + 11065833330203 5 ??? 0x00000a107795c134 0x0 + 11065842057524

  • Tree
    Tree over 7 years
    can you help on how to use obj dump?
  • gnerkus
    gnerkus over 7 years
    I could. Do you have any stacktrace?
  • Tree
    Tree over 7 years
    I have edited my question to include stack trace. The thing is I dont know what to run objdump against?
  • Tree
    Tree over 7 years
    should I make another question on how to use objdump?
  • gnerkus
    gnerkus over 7 years
    I'd suggest you look it up first. If you don't see any question on objdump and node, you can create yours. I'll looking it up as well. I'm also looking to see how to use objdump.
  • Tree
    Tree over 7 years
  • Venryx
    Venryx over 2 years
    This module currently fails to install with the Node Alpine base image, but there appear to be workarounds. Info here: github.com/ddopson/node-segfault-handler/issues/70