Skip to content

Missing "execinfo.h" on Node Alpine #70

Description

@soundstep

Hi,

I've got an issue running an NPM install with this module in Docker (node-alpine):

FROM node:12.15.0-alpine

The issue:

> segfault-handler@1.3.0 install /opt/hades/node_modules/segfault-handler
> node-gyp rebuild

make: Entering directory '/opt/hades/node_modules/segfault-handler/build'
  CXX(target) Release/obj.target/segfault-handler/src/segfault-handler.o
../src/segfault-handler.cpp:23:10: fatal error: execinfo.h: No such file or directory
   23 | #include <execinfo.h>
      |          ^~~~~~~~~~~~
compilation terminated.
make: Leaving directory '/opt/hades/node_modules/segfault-handler/build'
make: *** [segfault-handler.target.mk:113: Release/obj.target/segfault-handler/src/segfault-handler.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:223:5)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Linux 4.19.76-linuxkit
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /opt/hades/node_modules/segfault-handler
gyp ERR! node -v v12.15.0
gyp ERR! node-gyp -v v5.0.5

I tried the fix found there:
nodejs/node-report#86 (comment)

RUN echo "@edge http://nl.alpinelinux.org/alpine/edge/main" >> /etc/apk/repositories
RUN apk update
RUN apk add libexecinfo-dev@edge

I got a lot of red warnings like:
warning: cast between incompatible function types from 'void

But the install go through and the docker image is built successfully.

However it is still not working, it seems it doesn't find the backtrace tool when a SIGSEGV signal happens:

/opt/hades/node_modules/bindings/bindings.js:121
        throw e;
        ^

Error: Error relocating /opt/hades/node_modules/segfault-handler/build/Release/segfault-handler.node: backtrace: symbol not found
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:1021:18)
    at Module.load (internal/modules/cjs/loader.js:811:32)
    at Function.Module._load (internal/modules/cjs/loader.js:723:14)
    at Module.require (internal/modules/cjs/loader.js:848:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at bindings (/opt/hades/node_modules/bindings/bindings.js:112:48)
    at Object.<anonymous> (/opt/hades/node_modules/segfault-handler/index.js:3:37)
    at Module._compile (internal/modules/cjs/loader.js:955:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:991:10)
    at Module.load (internal/modules/cjs/loader.js:811:32)

Any clue?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions