dumpme
v2.1.0
Published
Creates a coredump of the current process, without killing it
Readme
dumpme
Creates a coredump of the current process, without killing it.
Supports Linux Kernel Hardening options.
Pre-requisites
- gdb/gcore must be installed on the system
- obviously, works only on *nix systems
Installation
The package ships prebuilt N-API binaries for linux-x64, linux-arm64
(glibc 2.31+), darwin-x64 and darwin-arm64, valid for every supported Node
major: on those platforms npm install compiles nothing and needs no compiler.
Elsewhere (Alpine/musl, other architectures) it falls back to building from
source with node-gyp, which requires Python and a C++ toolchain.
How to use
dumpme([gcore], [coredump])
Where:
gcoreis the path and filename of the gcore binary (default:gcore)coredumpis the path + file name of the coredump file to create (default:core.<PID>)
Returns a Boolean as an indicator of success/failure.
const dumpme = require('dumpme');
dumpme();Why gdb/gcore is needed?
The only alternative to gcore is to use google-coredumper, which is done by node-gcore.
Using google coredumper programatically is way cleaner than gcore, but it has the following issues:
- coredumps generated by Google coredumper are not compatible with llnode (see https://github.com/nodejs/llnode/issues/61)
- Google coredumper might not work with newer Linux distributions (mainly due to Kernel Hardening features, but not only), and it seems unmaintained since 2008
