Segmentation fault during npm install in Docker

I get a segmentation fault during meson setup when upgrading to mediasoup v3.9.2. It appears to happen while patching openssl.

The worker builds fine on my host machine (MacOS ARM) but not in a standard Docker image.

...
#12 5.261 /app/src/node_modules/mediasoup/worker/out/pip/bin/meson setup \
#12 5.261       --buildtype release \
#12 5.261       -Db_ndebug=true \
#12 5.261       -Db_pie=true \
#12 5.261       -Db_staticpic=true \
#12 5.261       --reconfigure \
#12 5.261       "" \
#12 5.261       /app/src/node_modules/mediasoup/worker/out/Release || \
#12 5.261       /app/src/node_modules/mediasoup/worker/out/pip/bin/meson setup \
#12 5.261               --buildtype release \
#12 5.261               -Db_ndebug=true \
#12 5.261               -Db_pie=true \
#12 5.261               -Db_staticpic=true \
#12 5.261               "" \
#12 5.261               /app/src/node_modules/mediasoup/worker/out/Release
#12 5.366 Directory does not contain a valid build tree:
#12 5.366 /app/src/node_modules/mediasoup/worker/out/Release
#12 5.825 The Meson build system
#12 5.825 Version: 0.60.2
#12 5.825 Source dir: /app/src/node_modules/mediasoup/worker
#12 5.825 Build dir: /app/src/node_modules/mediasoup/worker/out/Release
#12 5.825 Build type: native build
#12 5.825 Project name: mediasoup-worker
#12 5.825 Project version: undefined
#12 5.825 C compiler for the host machine: cc (gcc 9.3.0 "cc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0")
#12 5.825 C linker for the host machine: cc ld.bfd 2.34
#12 5.825 C++ compiler for the host machine: c++ (gcc 9.3.0 "c++ (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0")
#12 5.825 C++ linker for the host machine: c++ ld.bfd 2.34
#12 5.825 Host machine cpu family: aarch64
#12 5.825 Host machine cpu: aarch64
#12 5.825 Downloading openssl source from https://www.openssl.org/source/openssl-1.1.1l.tar.gz
#12 6.036 Download size: 9834044
#12 6.036 Downloading: ..........Segmentation fault
#12 8.115 make: *** [Makefile:65: setup] Error 139
#12 8.115 make: Leaving directory '/app/src/node_modules/mediasoup/worker'
...

I can reproduce this by running docker build . in a directory with only the two files here:

Reproduced with binfmt on my machine and reported upstream: Segfault on Linux aarch64 before executing subproject · Issue #9690 · mesonbuild/meson · GitHub
Never seen this before, but clearly something is wrong. Builds fine with Docker on x86-64.

You should be able to build amd64 container image instead for now (which is probably what you want if you were to push it somewhere) like this:

docker buildx build --platform linux/amd64 .
1 Like

Very helpful!

Unfortunately the amd64 workaround will not work in my situation. I’m loading the image into KIND, which can’t run amd64 on arm64.

I’ll follow along with the upstream issue and watch for updates. Thanks for reporting it.

Turns out to be OpenSSL bug in Ubuntu itself, using newer Ubuntu image should be a viable workaround in the meantime.

Yes, FROM docker.io/ubuntu:21.10 works! Thanks for the update.