You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Segmentation fault on x86_64 with MacOS Virtualization Framework enabled #6824
After a fresh local install of a Laravel project + Breeze (Vue), trying to build for production (sail npm run build) or starting a local hmr server (sail npm run dev) should work properly (using Docker for Mac on Intel Chip, v4.19.0)
Actual behavior
Both commands thows a Segmentation Fault error without further info.
VITE v4.3.3 ready in 727 ms
➜ Local: http://localhost:5173/
➜ Network: http://172.240.7.5:5173/
➜ press h to show help
LARAVEL v10.9.0 plugin v0.7.4
➜ APP_URL: http://mysite.test
Segmentation fault
Information
Switching back to Docker for Mac v4.18.0 works as expected.
Possible workaround: disable Virtualization framework on v4.19+
Steps to reproduce the behavior
Create a fresh Laravel project (curl -s "https://laravel.build/example-app" | bash)
There is no need to create a full Laravel project though. Installing Vite is enough to reproduce this issue:
Create a new Vite project via docker run -it --rm -v "$PWD":/usr/src/app -w /usr/src/app node npm create vite@latest
Change directory into the new Vite project: cd vite-project
Install the Vite package via npm: docker run -it --rm -v "$PWD":/usr/src/app -w /usr/src/app node npm install
Build for production or start a local hmr server: docker run -it --rm -v "$PWD":/usr/src/app -w /usr/src/app node npm run dev / docker run -it --rm -v "$PWD":/usr/src/app -w /usr/src/app node npm run build
I reported this issue to the yarn project (in hindsight not sure if I should have filed it here or at the node project instead). This issue here looks very similar to what I reported at yarnpkg/berry#5420. The issue at the yarn repository contains a minimal case to reproduce.
For me, this issue happens 100% of the time, for coworkers (almost identical hardware) it does not fail at all.
I can confirm that downgrading to Docker Desktop 4.18.0 (104112) fixes the issue for yarn install seg fauting (see comment above). Thanks for the hint @irobin591 - I can at least build assets again :)
Update I only see the issue on x86. On arm64 (macOS 13.3.1 (a) (22E772610a)) Docker Desktop 4.19.0 works fine, without segmentation fault. So it looks like 4.19.0 broke something specifically on Intel.
@sam-thibault@MihaelaStoica: Can we provide something else to help with acknowledging/analysing the issue? (looking at the status/0-more-info-needed label)
changed the title [-]Node / NPM / Vite Segmentation fault on fresh Laravel Project using Sail[/-][+]Segmentation fault on x86_64 linux on yarn install with minimal package.json[/+]on May 16, 2023
@dgageot I can reproduce on 4.29, iMac 2020 Intel i9 running Sonoma 14.4.1
You need to make sure you have Use Virtualization Framework enabled AND VirtioFS enabled.
Running the test command above gets me
docker run -it -e NG_CLI_ANALYTICS=false node:18-slim npx --yes --package @angular/cli -- ng version
Segmentation fault
npm notice
npm notice New minor version of npm available! 10.5.0 -> 10.6.0
npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.6.0
npm notice Run npm install -g npm@10.6.0 to update!
npm notice
Using Virtualization Framework AND gRPC Fuse seems to work.
As does NO virtualization framework AND osxfs
Strangely after going back to VirtioFS, node:18-slim started working but node:19-slim still gets a segfault. Node 20+ seem to work.
@dgageot I don't have a machine in a state to test this again right now, but as of May 2023, Nov 2023, and late Feb 2024 with all machines up to date on latest MacOS and Docker Desktop at that time I had 4 13" MBP (2020, Intel, i7 cpu) and 1 13" Macbook Air (2020, Intel, i7) all failed on this. I had 1 15" MBP (2018, Intel, i7) and 1 16" MBP (2019, Intel, i9) that did NOT have the problem with Mac Virtualization Framework on.
Turning off the Mac Virtualization Framework fixed all machines.
Also in my testing in November, node:16-slim did NOT have the problem. node:18-slim and node:20-slim DID have the problem. node:22-slim (not GA yet) did NOT have the problem.
Keeping you posted: For now, we failed to reproduce on four different Intel Macs. Each time, we enabled Virtualization Framework enabled AND VirtioFS.
FWIW, I wonder howVirtioFS could have an impact, since both of the reproductions you shared don't use file sharing at all.
If that helps, you can have a look at the diagnostics i have uploaded when i first opened the issue.
Unfortunately I've switched to another tool the get the job done, so i can't help with the issue anymore.
A few days ago we upgraded our stack to nodejs 20 and suffered the same issue as described here (precisely a segfault when running webpack during image build with no mount) on a macbook pro 2020.
@dgageot I gave your internal build a try, switched back to use of the Virtualization Framework and used it yesterday for a few hours, everything works fine now 👏
I'll let others confirm that it works for them too.
Thanks for taking the time to reproduce and fix the issue !
Reacted by David Gageot, Manuel Martín and Pablo Psichalis
Closing this issue because a fix has been released in Docker Desktop 4.30.0 . See the release notes for more details.
Reacted by Dossy Shiobara, Nate Felton, kazushi-tsuji, Pablo Psichalis, taniguchi, poster092009, Pavel Boldyrev, Emmanuel Magnier, salt0000 and Tomasz Czubocha
Activity
MihaelaStoica commentedon May 3, 2023
@antoniofrignani, would it be possible to submit a diagnostic report and then add the Diagnostics ID here?
antoniofrignani commentedon May 5, 2023
@MihaelaStoica i've just updated my comment with a diagnostic ID
irobin591 commentedon May 8, 2023
I also have this issue.
There is no need to create a full Laravel project though. Installing Vite is enough to reproduce this issue:
docker run -it --rm -v "$PWD":/usr/src/app -w /usr/src/app node npm create vite@latestcd vite-projectdocker run -it --rm -v "$PWD":/usr/src/app -w /usr/src/app node npm installdocker run -it --rm -v "$PWD":/usr/src/app -w /usr/src/app node npm run dev/docker run -it --rm -v "$PWD":/usr/src/app -w /usr/src/app node npm run buildDowngrading to 4.18.0 via https://docs.docker.com/desktop/release-notes/#4180 without changing the version of Vite is also a working workaround for me.
I also have access to a MacBook of a different model where this issue does not occur, so this might be hard to reproduce.
Specs of the MacBook that has the issue:
Specs of the MacBook without the issue:
tisba commentedon May 8, 2023
I reported this issue to the yarn project (in hindsight not sure if I should have filed it here or at the node project instead). This issue here looks very similar to what I reported at yarnpkg/berry#5420. The issue at the yarn repository contains a minimal case to reproduce.
For me, this issue happens 100% of the time, for coworkers (almost identical hardware) it does not fail at all.
antoniofrignani commentedon May 9, 2023
@irobin591 yes the issue is not direcly related to the framework itself, thanks for reproducing it with bare minimum boilerplate.
I'll watch the issue on the node/yarn side too since this seems strictly related, thanks @tisba for reporting it here.
tisba commentedon May 11, 2023
I can confirm that downgrading to Docker Desktop 4.18.0 (104112) fixes the issue for
yarn installseg fauting (see comment above). Thanks for the hint @irobin591 - I can at least build assets again :)Update I only see the issue on x86. On arm64 (macOS 13.3.1 (a) (22E772610a)) Docker Desktop 4.19.0 works fine, without segmentation fault. So it looks like 4.19.0 broke something specifically on Intel.
I use this to test:
tisba commentedon May 16, 2023
@sam-thibault @MihaelaStoica: Can we provide something else to help with acknowledging/analysing the issue? (looking at the
status/0-more-info-neededlabel)[-]Node / NPM / Vite Segmentation fault on fresh Laravel Project using Sail[/-][+]Segmentation fault on x86_64 linux on yarn install with minimal package.json[/+]julienallexandre commentedon May 23, 2023
I have the same problem on a Laravel project with sail when I do the command
sail npm run devI get :Docker version 23.0.5, build bc4487a
Docker Compose version v2.17.3
Node v18.16.0
NPM 9.6.7
tisba commentedon May 23, 2023
In case you missed it, @julienallexandre, downgrading Docker Desktop one version seems to help until the issue is identified and fixed.
julienallexandre commentedon May 24, 2023
@tisba thanks yes that's what I did :)
87 remaining items
sergioharo commentedon Apr 25, 2024
@dgageot I can reproduce on 4.29, iMac 2020 Intel i9 running Sonoma 14.4.1
You need to make sure you have
Use Virtualization Frameworkenabled ANDVirtioFSenabled.Running the test command above gets me
Using Virtualization Framework AND gRPC Fuse seems to work.
As does NO virtualization framework AND osxfs
Strangely after going back to VirtioFS,
node:18-slimstarted working butnode:19-slimstill gets a segfault. Node 20+ seem to work.eweidner commentedon Apr 25, 2024
@dgageot I don't have a machine in a state to test this again right now, but as of May 2023, Nov 2023, and late Feb 2024 with all machines up to date on latest MacOS and Docker Desktop at that time I had 4 13" MBP (2020, Intel, i7 cpu) and 1 13" Macbook Air (2020, Intel, i7) all failed on this. I had 1 15" MBP (2018, Intel, i7) and 1 16" MBP (2019, Intel, i9) that did NOT have the problem with Mac Virtualization Framework on.
Turning off the Mac Virtualization Framework fixed all machines.
Also in my testing in November, node:16-slim did NOT have the problem. node:18-slim and node:20-slim DID have the problem. node:22-slim (not GA yet) did NOT have the problem.
Hope that helps.
dgageot commentedon Apr 26, 2024
Keeping you posted: For now, we failed to reproduce on four different Intel Macs. Each time, we enabled
Virtualization Frameworkenabled ANDVirtioFS.FWIW, I wonder how
VirtioFScould have an impact, since both of the reproductions you shared don't use file sharing at all.dgageot commentedon Apr 26, 2024
OK, we've tried six Mac<=2018 and had no issue
But we found a 2020 MacBookPro with the issue!
I'll keep you posted
antoniofrignani commentedon Apr 26, 2024
@dgageot thank for stepping in.
If that helps, you can have a look at the diagnostics i have uploaded when i first opened the issue.
Unfortunately I've switched to another tool the get the job done, so i can't help with the issue anymore.
dgageot commentedon Apr 26, 2024
Here is an internal build which we think solves this issue. Could you give it a try?
https://desktop-stage.docker.com/mac/main/amd64/148395/Docker.dmg
Amli commentedon Apr 27, 2024
A few days ago we upgraded our stack to nodejs 20 and suffered the same issue as described here (precisely a segfault when running webpack during image build with no mount) on a macbook pro 2020.
@dgageot I gave your internal build a try, switched back to use of the Virtualization Framework and used it yesterday for a few hours, everything works fine now 👏
I'll let others confirm that it works for them too.
Thanks for taking the time to reproduce and fix the issue !
http-teapot commentedon Apr 28, 2024
I can confirm that it works on our end, too. Thank you for fixing this issue!
dgageot commentedon Apr 29, 2024
FYI, the fix is planned for Docker Desktop v4.30.0
pablo-psi commentedon Apr 29, 2024
Great, thank you for fixing the issue! 🙏
chaizeg commentedon May 6, 2024
Closing this issue because a fix has been released in Docker Desktop
4.30.0. See the release notes for more details.ciekawy commentedon Sep 1, 2024
Interestingly I am facing yarn SIGSEGV on Docker Desktom 4.33... Do I need to check specific versions/settings? I have the VirtioFS enabled
UPDATE using simply
NODE_OPTIONS="--max-old-space-size=4096"did help in my case