Skip to content

Node 16.4 or higher on M1 Mac OOMs in Qemu/Docker #40195

Open
@alex-hunt-materialize

Description

@alex-hunt-materialize

Version

v16.9.0

Platform

Linux buildkitsandbox 5.10.57 #1-NixOS SMP Sun Aug 8 07:05:24 UTC 2021 x86_64 GNU/Linux

Subsystem

No response

What steps will reproduce the bug?

  1. Get an M1 Mac
  2. Install Docker Desktop
  3. Attempt to build a Docker image that does npm install using nodejs 16.4 or higher targetting --platform linux/amd64.
    RUN npm install --production

Additional details of scenarios that reproduce this are in the related Docker issue docker/for-mac#5831

How often does it reproduce? Is there a required condition?

100% reproducible, as far as I can tell. It doesn't matter how much RAM you give Docker.
According to the Docker issue, this doesn't seem to affect older versions of nodejs, just 16.4 and newer. We've confirmed it works with node 14.

What is the expected behavior?

npm install to work, without OOM.

What do you see instead?

The build fails with OOM.

#18 [build 11/16] RUN npm install --production
 
#18 0.328 
#18 0.328 #
#18 0.328 # Fatal process OOM in Failed to reserve virtual memory for CodeRange
#18 0.328 #
#18 0.328 
#18 0.328 qemu: uncaught target signal 5 (Trace/breakpoint trap) - core dumped
#18 0.330 Trace/breakpoint trap
#18 ERROR: executor failed running [/bin/sh -c npm install --production]: exit code: 133

Additional information

Opening this here in case the issue is with something nodejs is doing. Related Docker issue is at docker/for-mac#5831

Metadata

Metadata

Assignees

No one assigned

    Labels

    armIssues and PRs related to the ARM platform.macosIssues and PRs related to the macOS platform / OSX.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions