I just read this blog post by Netflix - excellent read. I have been playing around a bit with the tools etc. mentioned; especially with generating core dumps on uncaught exceptions by setting the --abort-on-uncaught-exception
flag. This is also described here for instance. I think it is working so far with a simple test script (that does nothing but throw an error), as I see this output:
Uncaught Error: foo
FROM
run (/tmp/test/index.js:4:9)
wrapper [as _onTimeout] (timers.js:265:14)
Timer.listOnTimeout (timers.js:110:15)
[1] 18165 illegal hardware instruction (core dumped) node --abort-on-uncaught-exception index.js
However, it seems like I am too stupid to locate the actual core dump file that this experiment should produce (?).
I looked at /var/cores/
and /opt/cores/
which were mentioned somewhere on the web - but these directories don't exist.
a quick find / -name core -type f
did not yield anything useful either. What am I missing?
EDIT: node version is v0.12.0.
Ah, nevermind. Perfect example of rubberducking...
Just figured out that core files are not created if ulimit -c
is set to 0
, which was the case on my machine (see e.g. here). Adjusting this setting made the core
file pop up in the working directory.
For me on MacOSX they seem to be deposited in the /cores
directory e.g. /cores/core.5748
. As you mentioned you need to run ulimit -c unlimited
to tell the OS to save core files.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With