From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/14616 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: Loading of Node.js native module segfaults in Alpine 3.10 (works in 3.9) Date: Fri, 6 Sep 2019 09:23:29 -0400 Message-ID: <20190906132329.GI9017@brightrain.aerifal.cx> References: Reply-To: musl@lists.openwall.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="4719"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.5.21 (2010-09-15) To: musl@lists.openwall.com Original-X-From: musl-return-14632-gllmg-musl=m.gmane.org@lists.openwall.com Fri Sep 06 15:23:50 2019 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.89) (envelope-from ) id 1i6EDL-00011s-L1 for gllmg-musl@m.gmane.org; Fri, 06 Sep 2019 15:23:47 +0200 Original-Received: (qmail 7205 invoked by uid 550); 6 Sep 2019 13:23:42 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 6129 invoked from network); 6 Sep 2019 13:23:41 -0000 Content-Disposition: inline In-Reply-To: Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:14616 Archived-At: On Fri, Sep 06, 2019 at 01:10:45PM +0000, Christof Marti wrote: > Hi everyone, > > We have a Node.js native module that fails to load on Alpine 3.10 > (musl-1.1.22-r3). It loads fine on Alpine 3.9 (musl-1.1.20-r4) and > other (Debian / CentOS base) Linux distros. I also specifically > tested with alpine:3.10 and debian:8 Docker images and Node.js > 10.16.3 to rule out differences between Node.js versions and the > Debian image does not show the problem. > > 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. > > I have filed an issue for Alpine, but it was suggested that I should > follow-up upstream: > https://gitlab.alpinelinux.org/alpine/aports/issues/10767 > > We couldn't establish the source of the problem with certainty. Any > help on tracking this down further is appreciated. Have you checked with gdb, strace, or any other log/trace output to get an idea of the type/cause of crash? Is it possible that there are bad seccomp filters involved and this is just them trapping something? What type of operations is the spdlog module performing on load? Are there threads involved? Rich