Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There's a few mechanisms I can suggest to try to track down this problem.</p> <p>First, use <code>strace(1)</code> and <code>ltrace(1)</code> on <code>nodejs</code>:</p> <pre><code>strace -o /tmp/node.strace -fF nodejs script.js ltrace -o /tmp/node.ltrace -f nodejs script.js </code></pre> <p>Then look through the <code>/tmp/node.*</code> files to discover what it was doing moments before it crashed. <strong>Edit</strong>: <code>strace(1)</code> reports the <em>system calls</em> that the program makes; as programs interact with the outside world via system calls, it's often the fastest mechanism to finding bugs. <code>ltrace(1)</code> reports dynamic library calls, which is frequently a lot more information about the internal workings of the program. Both are useful.</p> <p>Second, run <code>dmesg &gt; /tmp/dmesg</code> and look through the <code>dmesg</code> output for the segfault information, it'll look like this:</p> <pre><code>[332430.652393] npviewer.bin[13508]: segfault at 418 ip 00000000f6086d16 sp 00000000ffd8b018 error 6 in libflashplayer.so[f5e19000+b5f000] </code></pre> <p>That's an Adobe Flash crash; comparing the addresses against <code>readelf -s</code> output on the program, you might be able to guess how <em>far</em> into the function the segfault is occurring, which might help when reading the source code. (It's a long shot to guess by address how far you are into a function, but I've found it useful to know if I should look near the start or end of a function.)</p> <p>Third, you could run the program with <code>valgrind(1)</code>:</p> <pre><code>valgrind nodejs script.js </code></pre> <p>Valgrind is an impressive tool that might require a fair amount of learning to really <em>know</em>. The little I've used it, I've been impressed, but I can't give as decent a guide as the other simpler tools.</p> <p>Fourth, you could run <code>nodejs</code> under <code>gdb</code>:</p> <pre><code>gdb --args nodejs script.js </code></pre> <p>When it dies, run <code>bt</code> to get a backtrace. <code>gdb</code> is also an impressive program, and you could probably find the exact line that fails using it, but it too takes a fair amount of learning to really <em>know</em>. I've been lucky enough that backtraces were usually enough to find the fault.</p> <p>With luck you'll be pointed to the exact function that failed, and <code>ltrace(1)</code> will give you the arguments of that function. This'll hopefully be enough to track down the specific bug.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload