ddopson / node-segfault-handler

Tool for debugging native Node.js modules and getting stack traces when things go wrong.
BSD 3-Clause "New" or "Revised" License
319 stars 74 forks source link

invalid ELF header #78

Open rmclaughlin-nelnet opened 3 years ago

rmclaughlin-nelnet commented 3 years ago

I am trying to use this module in an AWS lambda to debug a sporadic segmentation fault, but when I include this module I get an invalid ELF header error whenever it runs. Any help getting this to work would be appreciated.

2021-07-01T16:34:46.344Z    undefined   ERROR   Uncaught Exception  
{
    "errorType": "Error",
    "errorMessage": "/var/task/node_modules/segfault-handler/build/Release/segfault-handler.node: invalid ELF header",
    "stack": [
        "Error: /var/task/node_modules/segfault-handler/build/Release/segfault-handler.node: invalid ELF header",
        "    at Object.Module._extensions..node (internal/modules/cjs/loader.js:1057:18)",
        "    at Module.load (internal/modules/cjs/loader.js:863:32)",
        "    at Function.Module._load (internal/modules/cjs/loader.js:708:14)",
        "    at Module.require (internal/modules/cjs/loader.js:887:19)",
        "    at require (internal/modules/cjs/helpers.js:74:18)",
        "    at bindings (/var/task/node_modules/bindings/bindings.js:112:48)",
        "    at Object.<anonymous> (/var/task/node_modules/segfault-handler/index.js:3:37)",
        "    at Module._compile (internal/modules/cjs/loader.js:999:30)",
        "    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)",
        "    at Module.load (internal/modules/cjs/loader.js:863:32)"
    ]
}

Here is how I have it installed at the top of my lambda, unfortunately I cannot share the rest of my code.

const SegfaultHandler = require('segfault-handler');

SegfaultHandler.registerHandler('crash.log');

I am using "segfault-handler": "1.3.0" on node 12