gatsby: Random "SIGSEGV" Errors in "yarn build" Following Failed/Canceled Build
Preliminary Checks
- This issue is not a duplicate. Before opening a new issue, please search existing issues: https://github.com/gatsbyjs/gatsby/issues
- This issue is not a question, feature request, RFC, or anything other than a bug report directly related to Gatsby. Please post those things in GitHub Discussions: https://github.com/gatsbyjs/gatsby/discussions
Description
Encountering intermittent behavior in the Gatsby build process, where executing the yarn build command after a canceled or failed build attempt sometimes results in a “SIGSEGV” error. This behavior is unpredictable, as the error occurs most of the time after a failed build, but occasionally the build process succeeds despite the prior failure.
Reproduction Link
https://github.com/schettn/mutext-test
Steps to Reproduce
- Initiate the Gatsby build process using yarn build.
- Cancel the build process or allow it to fail due to various reasons.
- Attempt to run yarn build again.
- Notice that, in most cases, the build fails with a “SIGSEGV” error.
- However, on some occasions, the build process successfully completes without errors.
Expected Result
After a failed build attempt, the yarn build command should consistently execute without any errors, maintaining a predictable behavior regardless of prior build outcomes.
Actual Result
After a failed build attempt, when running yarn build, the build process either fails with a “SIGSEGV” error or, less frequently, completes successfully despite the prior failure. This inconsistency in behavior makes it challenging to predict whether a subsequent build attempt will be successful or result in an error.
https://github.com/gatsbyjs/gatsby/assets/52858351/d71d1212-e36a-4945-a1e9-6d4ab5cf07e9
Environment
System:
OS: macOS 13.5.1
CPU: (8) arm64 Apple M2
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.15.0 -
/var/folders/04/_fcn9m61251cpx7qbc2d74j00000gn/T/yarn--1693039712873-0.25311318574212716/node
Yarn: 1.22.19 -
/var/folders/04/_fcn9m61251cpx7qbc2d74j00000gn/T/yarn--1693039712873-0.25311318574212716/yarn
npm: 9.5.0 - /usr/local/bin/npm
Browsers:
Chrome: 116.0.5845.110
Safari: 16.6
npmPackages:
gatsby: ^5.12.1 => 5.12.1
Config Flags
No response
About this issue
- Original URL
- State: closed
- Created 10 months ago
- Reactions: 16
- Comments: 21 (2 by maintainers)
Commits related to this issue
- build: remove cache before building site This is a workaround for https://github.com/gatsbyjs/gatsby/issues/38483 and should be reverted once it's fixed by Gatsby. — committed to MetaMask/snap-simple-keyring by danroc 8 months ago
- build: remove cache before building site This is a workaround for https://github.com/gatsbyjs/gatsby/issues/38483 and should be reverted once it's fixed by Gatsby. — committed to MetaMask/snap-simple-keyring by danroc 8 months ago
- build: remove cache before building site This is a workaround for https://github.com/gatsbyjs/gatsby/issues/38483 and should be reverted once it's fixed by Gatsby. — committed to MetaMask/snap-simple-keyring by danroc 8 months ago
- build: remove cache before building site (#124) * ui: move "Delete" button into account details * fix: use method name in key (fix SonarLint warning) * ui: add parenthesis around details of the... — committed to MetaMask/snap-simple-keyring by danroc 8 months ago
- fix: warn ./.cache/slice/server-slice.js ref: https://github.com/gatsbyjs/gatsby/issues/38483#issuecomment-1870299093 — committed to schettn/gatsby by schettn 3 months ago
Hey there 👋
It hurts me to say this but I no longer work at Gatsby, so I won’t be able to help you. Netlify laid off a lot of people including me and others have left since then, too. If you want to get your voice heard you’ll need to contact Netlify, the people left who might work on this repository are not at fault.
If you read this please react with a 👍 or 👎 . I want to know if this is just a me problem or something bigger. Thanks.
Does anyone experience that error?
When this happens the Gatsby site just renders a whitescreen and a restart is required.
Experiencing this too with: Macbook M1, Node v18.16.1, Gatsby 5.12.4. Cannot run
npm run dev
ornpm run build
twice in a row withoutnpm run clean
Multiple on my team experiencing this issue as well.
gatsby clean
seems to usually fix it.Macbook M1, Node v18.14.2, Gatsby 5.12.4. Same error. With Gatsby 5.11.0 everything works as it should.
Not sure this should be closed if it’s still an issue…
I’m getting the same error on 2020 Intel Mac. I’m using
gatsby-source-wordpress
, with latest versions ofgatsby-*
plugins. I planned to put some time into proper reproducible example and maybe give some work into investigation (I’ve been chasing this issue for quite some time already, and was able to narrow it down a bit).But, looking at https://github.com/gatsbyjs/gatsby/issues/38696 and recent activity around Gatsby and Netlify lay offs I’m thinking if it’s not better to spend this time to migrate away from Gatsby? Some news would be highly appreciated if we should start learning alternatives to Gatsby.EDIT: Activity in mentioned thread reassured me. I’ll wrap up some reproducible repo for my
SIGSEGV
issues when I have some time for that.same error getting these two errors everytime I try to run
gatsby develop
orgatsby build
:libc++abi: terminating with uncaught exception of type std::__1::system_error: mutex lock failed: Invalid argument [1] 21145 abort npm run start
and
[1] 21172 segmentation fault npm run start
it’s very unreliable