Loading of Node.js native module segfaults in 3.10 (works in 3.9)
We have a Node.js native module that fails to load Alpine 3.10. It loads fine on Alpine 3.9 and other (Debian / CentOS base) Linux distros.
The Dockerfile to reproduce is:
FROM alpine:3.10
RUN apk add g++ python make npm
RUN npm i spdlog
CMD /bin/sh -c "node -p 'require(\"spdlog\")'"
This is with the latest Docker for Windows and on Linux. At least one Docker for Mac does not reproduce it, not sure what the difference is with that.
I have built the Dockerfile for convenience: docker run chrmarti/alpine-spdlog-segfault
The source of the spdlog node module is at: https://github.com/Microsoft/node-spdlog
Removing line-by-line from the source suggests that as soon as the wrapped library (spdlog itself) is linked in the loading in Node.js fails. Loading the wrapped library in an executable outside of Node.js did work.