Skip to content

Instantly share code, notes, and snippets.

@misterdjules
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save misterdjules/dddf6a1b4a13ec0b1735 to your computer and use it in GitHub Desktop.
Save misterdjules/dddf6a1b4a13ec0b1735 to your computer and use it in GitHub Desktop.
ulimit and core dumps generation with Node.js
➜ node-debug-school git:(master) ✗ ls /cores
➜ node-debug-school git:(master) ✗ ulimit -c 0; node --abort-on-uncaught-exception -e 'undef()'
Uncaught ReferenceError: undef is not defined
FROM
[eval]:1:1
Object.<anonymous> ([eval]-wrapper:6:22)
Module._compile (module.js:456:26)
evalScript (node.js:536:25)
startup (node.js:80:7)
node.js:906:3
[1] 1448 abort node --abort-on-uncaught-exception -e 'undef()'
➜ node-debug-school git:(master) ✗ ls /cores
➜ node-debug-school git:(master) ✗ node --abort-on-uncaught-exception -e 'undef()'
Uncaught ReferenceError: undef is not defined
FROM
[eval]:1:1
Object.<anonymous> ([eval]-wrapper:6:22)
Module._compile (module.js:456:26)
evalScript (node.js:536:25)
startup (node.js:80:7)
node.js:906:3
[1] 1472 abort node --abort-on-uncaught-exception -e 'undef()'
➜ node-debug-school git:(master) ✗ ls /cores
➜ node-debug-school git:(master) ✗ ulimit -c unlimited; node --abort-on-uncaught-exception -e 'undef()'
Uncaught ReferenceError: undef is not defined
FROM
[eval]:1:1
Object.<anonymous> ([eval]-wrapper:6:22)
Module._compile (module.js:456:26)
evalScript (node.js:536:25)
startup (node.js:80:7)
node.js:906:3
[1] 1488 abort (core dumped) node --abort-on-uncaught-exception -e 'undef()'
➜ node-debug-school git:(master) ✗ ls /cores
core.1488
➜ node-debug-school git:(master) ✗
[root@232e6f26-a7fe-ee26-d40b-b5473b8d9dc1 ~/node-debug-school]# ulimit -c 0; prctl -n process.max-core-size $$
process: 58274: -bash
NAME PRIVILEGE VALUE FLAG ACTION RECIPIENT
process.max-core-size
privileged 0B - deny -
system 8.00EB max deny -
[root@232e6f26-a7fe-ee26-d40b-b5473b8d9dc1 ~/node-debug-school]# ulimit -c 42; prctl -n process.max-core-size $$
process: 58274: -bash
NAME PRIVILEGE VALUE FLAG ACTION RECIPIENT
process.max-core-size
privileged 42.0KB - deny -
system 8.00EB max deny -
[root@232e6f26-a7fe-ee26-d40b-b5473b8d9dc1 ~/node-debug-school]#
[root@232e6f26-a7fe-ee26-d40b-b5473b8d9dc1 ~/node-debug-school]# coreadm
global core file pattern: /var/cores/core.%f.%p
global core file content: default
init core file pattern: /var/cores/core.%f.%p
init core file content: default
global core dumps: enabled
per-process core dumps: disabled
global setid core dumps: disabled
per-process setid core dumps: disabled
global core dump logging: enabled
[root@232e6f26-a7fe-ee26-d40b-b5473b8d9dc1 ~/node-debug-school]# ls /var/cores/
[root@232e6f26-a7fe-ee26-d40b-b5473b8d9dc1 ~/node-debug-school]# ulimit -c 0; node --abort-on-uncaught-exception -e 'undef()'
Uncaught ReferenceError: undef is not defined
FROM
[eval]:1:1
Object.<anonymous> ([eval]-wrapper:6:22)
Module._compile (module.js:456:26)
evalScript (node.js:536:25)
startup (node.js:80:7)
node.js:906:3
Abort (core dumped)
[root@232e6f26-a7fe-ee26-d40b-b5473b8d9dc1 ~/node-debug-school]# ls /var/cores/
core.node.65711
[root@232e6f26-a7fe-ee26-d40b-b5473b8d9dc1 ~/node-debug-school]#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment