Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Random "SIGSEGV" Errors in "yarn build" Following Failed/Canceled Build #38483

Closed
2 tasks done
schettn opened this issue Aug 26, 2023 · 21 comments · Fixed by #38773
Closed
2 tasks done

Random "SIGSEGV" Errors in "yarn build" Following Failed/Canceled Build #38483

schettn opened this issue Aug 26, 2023 · 21 comments · Fixed by #38773
Labels
Gatsby status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer type: bug An issue or pull request relating to a bug in Gatsby

Comments

@schettn
Copy link

schettn commented Aug 26, 2023

Preliminary Checks

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

  1. Initiate the Gatsby build process using yarn build.
  2. Cancel the build process or allow it to fail due to various reasons.
  3. Attempt to run yarn build again.
  4. Notice that, in most cases, the build fails with a "SIGSEGV" error.
  5. 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.

gatsby-build-errors.mov

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

@schettn schettn added the type: bug An issue or pull request relating to a bug in Gatsby label Aug 26, 2023
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Aug 26, 2023
@xray-robot
Copy link

xray-robot commented Sep 7, 2023

Macbook M1, Node v18.14.2, Gatsby 5.12.4. Same error.
With Gatsby 5.11.0 everything works as it should.

@zachmerrill
Copy link

zachmerrill commented Sep 13, 2023

Experiencing this as well. Clearing cache and running build seems to work reliably for me.

libc++abi: terminating due to uncaught exception of type std::__1::system_error: mutex lock failed: Invalid argument
error Command failed with signal "SIGABRT".

@apkoponen
Copy link

Experiencing this too with: Macbook M1, Node v18.16.1, Gatsby 5.12.4.
Cannot run npm run dev or npm run build twice in a row without npm run clean

@cdguglermbb
Copy link

cdguglermbb commented Sep 28, 2023

Working on upgrading from v4 to v5 and running into the same issue. Receiving the same error until clearing cache.
Mac M1, Node v18.3.0, Gatsby 5.11, 5.12.4.
I tried segfault-handler to try to get additional info and here's the output:

PID 3355 received SIGSEGV for address: 0x11b608a7e
0   segfault-handler.node               0x0000000111ca127c _ZL16segfault_handleriP9__siginfoPv + 288
1   libsystem_platform.dylib            0x000000019c6c6a24 _sigtramp + 56
2   node                                0x000000010571162c uv_kill + 12
3   node                                0x0000000104e4f760 _ZN4nodeL4KillERKN2v820FunctionCallbackInfoINS0_5ValueEEE + 272
4   node                                0x0000000104fae0f4 _ZN2v88internal25FunctionCallbackArguments4CallENS0_15CallHandlerInfoE + 220
5   node                                0x0000000104fadbf0 _ZN2v88internal12_GLOBAL__N_119HandleApiCallHelperILb0EEENS0_11MaybeHandleINS0_6ObjectEEEPNS0_7IsolateENS0_6HandleINS0_10HeapObjectEEESA_NS8_INS0_20FunctionTemplateInfoEEENS8_IS4_EENS0_16BuiltinArgumentsE + 464
6   node                                0x0000000104fad41c _ZN2v88internal21Builtin_HandleApiCallEiPmPNS0_7IsolateE + 228
7   node                                0x000000010579d16c Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit + 108
8   node                                0x0000000105728198 Builtins_InterpreterEntryTrampoline + 248
9   node                                0x0000000105728198 Builtins_InterpreterEntryTrampoline + 248
10  ???                                 0x0000000109cfa34c 0x0 + 4459569996
11  node                                0x0000000105728198 Builtins_InterpreterEntryTrampoline + 248
12  node                                0x00000001057264d0 Builtins_JSEntryTrampoline + 176
13  node                                0x0000000105726164 Builtins_JSEntry + 164
14  node                                0x0000000105069ce0 _ZN2v88internal12_GLOBAL__N_16InvokeEPNS0_7IsolateERKNS1_12InvokeParamsE + 2740
15  node                                0x0000000105069214 _ZN2v88internal9Execution4CallEPNS0_7IsolateENS0_6HandleINS0_6ObjectEEES6_iPS6_ + 200
16  node                                0x0000000104f597fc _ZN2v88Function4CallENS_5LocalINS_7ContextEEENS1_INS_5ValueEEEiPS5_ + 540
17  node                                0x0000000104d393a0 _ZN4node20InternalMakeCallbackEPNS_11EnvironmentEN2v85LocalINS2_6ObjectEEES5_NS3_INS2_8FunctionEEEiPNS3_INS2_5ValueEEENS_13async_contextE + 312
18  node                                0x0000000104d4e310 _ZN4node9AsyncWrap12MakeCallbackEN2v85LocalINS1_8FunctionEEEiPNS2_INS1_5ValueEEE + 204
19  node                                0x0000000104e918c8 _ZN4node12_GLOBAL__N_111ProcessWrap6OnExitEP12uv_process_sxi + 248
20  node                                0x0000000105711170 uv__chld + 344
21  node                                0x0000000105712848 uv__signal_event + 184
22  node                                0x000000010571b3f4 uv__io_poll + 1748
23  node                                0x0000000105709844 uv_run + 380
24  node                                0x0000000104d39ccc _ZN4node13SpinEventLoopEPNS_11EnvironmentE + 244
25  node                                0x0000000104e25cec _ZN4node16NodeMainInstance3RunEPiPNS_11EnvironmentE + 120
26  node                                0x0000000104e259c4 _ZN4node16NodeMainInstance3RunEv + 112
27  node                                0x0000000104dbe5d0 _ZN4node5StartEiPPc + 224
28  dyld                                0x000000019c33ff28 start + 2236

@schettn
Copy link
Author

schettn commented Oct 5, 2023

Hey @LekoArts,

Just wondering if you have any idea when the Gatsby team might get back to us on this issue. Any rough estimate would be awesome.

@LekoArts
Copy link
Contributor

LekoArts commented Oct 6, 2023

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.

danroc added a commit to MetaMask/snap-simple-keyring that referenced this issue Oct 20, 2023
This is a workaround for gatsbyjs/gatsby#38483
and should be reverted once it's fixed by Gatsby.
danroc added a commit to MetaMask/snap-simple-keyring that referenced this issue Oct 20, 2023
This is a workaround for gatsbyjs/gatsby#38483
and should be reverted once it's fixed by Gatsby.
danroc added a commit to MetaMask/snap-simple-keyring that referenced this issue Oct 20, 2023
This is a workaround for gatsbyjs/gatsby#38483
and should be reverted once it's fixed by Gatsby.
montelaidev pushed a commit to MetaMask/snap-simple-keyring that referenced this issue Oct 20, 2023
* ui: move "Delete" button into account details

* fix: use method name in key (fix SonarLint warning)

* ui: add parenthesis around details of the Snap version

* build: remove cache before building site

This is a workaround for gatsbyjs/gatsby#38483
and should be reverted once it's fixed by Gatsby.
@zhaohuanyuu
Copy link

Same error, is there any progress on this issue?

@Sletheren
Copy link

same error getting these two errors everytime I try to run gatsby develop or gatsby 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

@ryan-talus
Copy link

I'm getting the same error here, but downgrading to 5.11 seems to only partly fix the issue, I still occasionally get the segfault (but not every time as I do on 5.12.9). So sorry to hear about the Gatsby team, I was afraid of that with the acquisition...

@schettn
Copy link
Author

schettn commented Nov 11, 2023

Hi @pieh!

Could you please share your thoughts on this issue and provide insights into the current state of Gatsby? It seems like your are one of the few people still contribution / work of the pull requests.

Do not get me wrong but its actually a bit scary that a repository near to 55k stars feels that discontinued.

I know Gatsby was acquired due to its innovative Data Layer, but many people including me depend on the Gatsby framework as whole.

I would be happy to hear that there are plans for further framework development, although this seems unrealistic to me since Netlify fired nearly every contributor of this repository.

@jploskonka
Copy link

jploskonka commented Nov 17, 2023

I'm getting the same error on 2020 Intel Mac. I'm using gatsby-source-wordpress, with latest versions of gatsby-* 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 #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.

@laurogripa
Copy link

Same error with Mac M2, Gatsby 5.13.1 and Node v18.15.0.

It's a shame Netlify had such an impact in the project, Gatsby is super cool, hope it survives.

@schettn
Copy link
Author

schettn commented Dec 27, 2023

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?

warn ./.cache/slice/server-slice.js
Attempted import error: 'createContentDigest' is not exported from 'gatsby-core-utils/create-content-digest' (imported as
'createContentDigest').

When this happens the Gatsby site just renders a whitescreen and a restart is required.

@craigmcginley
Copy link
Contributor

Multiple on my team experiencing this issue as well. gatsby clean seems to usually fix it.

@linear linear bot reopened this Jan 9, 2024
@dallasclark
Copy link

Multiple on my team experiencing this issue as well. gatsby clean seems to usually fix it.

Thanks for the tip!

@linear linear bot closed this as completed Jan 23, 2024
@piersolenski
Copy link

Not sure this should be closed if it's still an issue...

@jeron-diovis
Copy link

Same issue.

  System:
    OS: macOS 14.3
    CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.19.0 - /usr/local/bin/node
    Yarn: 1.22.17 - /usr/local/bin/yarn
    npm: 10.2.3 - /usr/local/bin/npm
  npmPackages:
    gatsby: 5.12.11

develop can't start twice in a row. I have to run gatsby clean every single time.
Which in particular forces me to always run gatsby-source-wordpress in preview mode only, because re-downloading media files takes like 6-7 minutes on my project.
It's basically unusable.

@Josh-Karp
Copy link

Josh-Karp commented Feb 9, 2024

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?

warn ./.cache/slice/server-slice.js
Attempted import error: 'createContentDigest' is not exported from 'gatsby-core-utils/create-content-digest' (imported as
'createContentDigest').

When this happens the Gatsby site just renders a whitescreen and a restart is required.

I literally can't get rid of this. Spend hours trying to get my app to run just so I can dev and it seems to be completely random. My team and I are so tired of it that I want to rebuild the entire app in Nextjs.

@schettn
Copy link
Author

schettn commented Feb 10, 2024

I feel you. My problem is that I have build a complete app framework around gatsby. So I am kinda stuck.

I think this error is related to some plugin or some other package that does something "wrong". But I have no clue what it is and how to debug it.

This error is so random and it leads to so much frustration.

@schettn
Copy link
Author

schettn commented Feb 10, 2024

Hi @pieh. Is this issues really fixed?

For me and several others it is not.

In your pull request you said "Possibly fixes #38483". So did you fix it or then why is the issue closed?

Maybe I am just stuck on some old version but I do not think so.

@piersolenski
Copy link

My team and I are so tired of it that I want to rebuild the entire app in Nextjs.

@Josh-Karp Finally bit the bullet and did this, no regrets 🧘‍♀️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Gatsby status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer type: bug An issue or pull request relating to a bug in Gatsby
Projects
None yet
Development

Successfully merging a pull request may close this issue.