Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where are core dump files produced by "node --abort-on-uncaught-exception" located?

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.

like image 922
alexander.biskop Avatar asked Dec 07 '15 13:12

alexander.biskop


2 Answers

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.

like image 70
alexander.biskop Avatar answered Sep 29 '22 06:09

alexander.biskop


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.

like image 40
Brian Di Palma Avatar answered Sep 29 '22 08:09

Brian Di Palma