gatsbyjs / gatsby

The best React-based framework with performance, scalability and security built in.
https://www.gatsbyjs.com
MIT License
55.27k stars 10.31k forks source link

Command failed with signal "SIGSEGV" & segmentation fault #37246

Closed yesh closed 1 year ago

yesh commented 1 year ago

Preliminary Checks

Description

After updating all gatsby packages to the latest 5.3.0 version, yarn dev and yarn build both throw the error:

error Command failed with signal "SIGSEGV".

gatsby develop and gatsby build both throw the error:

[1] 12714 segmentation fault gatsby develop [1] 12739 segmentation fault gatsby build

with the 5.2.0 version everything worked flawlessly. I also tried deleting and rebuilding the node_modules folder with no success.

Reproduction link

Suggested reproduction services are not working because of Node 18 requirement. The issue can be hardware related for m1 / arm architecture cpus.

Steps to Reproduce

Expected Result

running or building

Actual Result

Screenshot 2022-12-13 at 16 00 57

Screenshot 2022-12-13 at 16 10 15

Environment

System:
    OS: macOS 13.0.1
    CPU: (8) arm64 Apple M1 Pro
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 18.12.1 - ~/.nvm/versions/node/v18.12.1/bin/node
    Yarn: 1.22.19 - ~/.yarn/bin/yarn
    npm: 8.19.2 - ~/.nvm/versions/node/v18.12.1/bin/npm
  Browsers:
    Chrome: 108.0.5359.98
    Edge: 102.0.1245.44
    Firefox: 107.0.1
    Safari: 16.1
  npmPackages:
    gatsby: ^5.2.0 => 5.3.0 
    gatsby-plugin-image: ^3.2.0 => 3.3.0 
    gatsby-plugin-postcss: ^6.2.0 => 6.3.0 
    gatsby-plugin-react-helmet: ^6.2.0 => 6.3.0 
    gatsby-plugin-robots-txt: ^1.8.0 => 1.8.0 
    gatsby-plugin-sharp: ^5.2.0 => 5.3.0 
    gatsby-plugin-sitemap: ^6.2.0 => 6.3.0 
    gatsby-source-contentful: ^8.2.0 => 8.3.0 
    gatsby-source-filesystem: ^5.2.0 => 5.3.0 
    gatsby-transformer-sharp: ^5.2.0 => 5.3.0 
  npmGlobalPackages:
    gatsby-cli: 5.3.0

Config Flags

No response

LekoArts commented 1 year ago

Hi!

Sorry to hear you're running into an issue. To help us best begin debugging the underlying cause, it is incredibly helpful if you're able to create a minimal reproduction. This is a simplified example of the issue that makes it clear and obvious what the issue is and how we can begin to debug it.

If you're up for it, we'd very much appreciate if you could provide a minimal reproduction and we'll be able to take another look.

Thanks for using Gatsby! πŸ’œ

denisgoryaynov commented 1 year ago

I am also having the same issue after upgrading to 5.3.0, I tried creating a new project using the default starter and then updating the versions to 5.3.0 and the problem still happens: npx gatsby new test https://github.com/gatsbyjs/gatsby-starter-default

This is my system information:

System:
    OS: macOS 13.0.1
    CPU: (8) arm64 Apple M1
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 18.12.1 - ~/.nvm/versions/node/v18.12.1/bin/node
    Yarn: 1.22.19 - ~/.nvm/versions/node/v18.12.1/bin/yarn
    npm: 9.2.0 - ~/.nvm/versions/node/v18.12.1/bin/npm
  Browsers:
    Chrome: 108.0.5359.98
    Safari: 16.1
  npmPackages:
    gatsby: ^5.3.0 => 5.3.0
    gatsby-plugin-image: ^3.3.0 => 3.3.0
    gatsby-plugin-manifest: ^5.3.0 => 5.3.0
    gatsby-plugin-sharp: ^5.3.0 => 5.3.0
    gatsby-source-filesystem: ^5.3.0 => 5.3.0
    gatsby-transformer-sharp: ^5.3.0 => 5.3.0
OPITOs commented 1 year ago

npx gatsby new test https://github.com/gatsbyjs/gatsby-starter-default and updating to 5.3.0

on Windows

We encountered an error while trying to load your site's gatsby-config. Please fix the error and try again. Error: Only URLs with a scheme in: file, data are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'c:'

yesh commented 1 year ago

Hi!

Sorry to hear you're running into an issue. To help us best begin debugging the underlying cause, it is incredibly helpful if you're able to create a minimal reproduction. This is a simplified example of the issue that makes it clear and obvious what the issue is and how we can begin to debug it.

If you're up for it, we'd very much appreciate if you could provide a minimal reproduction and we'll be able to take another look.

Thanks for using Gatsby! πŸ’œ

I don't think a reproduction is necessary or useful, from checking around is possible the issue is related to apple m1 / arm architecture. anyway you can test it with:

lezan commented 1 year ago

npx gatsby new test https://github.com/gatsbyjs/gatsby-starter-default and updating to 5.3.0

on Windows

We encountered an error while trying to load your site's gatsby-config. Please fix the error and try again. Error: Only URLs with a scheme in: file, data are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'c:'

I am experience the same issue after upgrading from 5.2 to 5.3. On Windows.

  System:
    OS: Windows 10 10.0.19044
    CPU: (4) x64 Intel(R) Core(TM) i5-4670K CPU @ 3.40GHz
  Binaries:
    Node: 18.12.1 - E:\Program Files\nodejs\node.EXE
    Yarn: 3.2.3 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 8.4.1 - E:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.19041.1266.0), Chromium (108.0.1462.46)
  npmPackages:
    gatsby: ^5.3.0 => 5.3.0
    gatsby-plugin-canonical-urls: ^5.3.0 => 5.3.0
    gatsby-plugin-google-tagmanager: ^5.3.0 => 5.3.0
    gatsby-plugin-image: ^3.3.0 => 3.3.0
    gatsby-plugin-manifest: ^5.3.0 => 5.3.0
    gatsby-plugin-no-sourcemaps: ^5.3.0 => 5.3.0
    gatsby-plugin-offline: ^6.3.0 => 6.3.0
    gatsby-plugin-purgecss: ^6.1.2 => 6.1.2
    gatsby-plugin-robots-txt: 1.8.0 => 1.8.0
    gatsby-plugin-sass: ^6.3.0 => 6.3.0
    gatsby-plugin-sharp: ^5.3.0 => 5.3.0
    gatsby-plugin-sitemap: ^6.3.0 => 6.3.0
    gatsby-source-filesystem: ^5.3.0 => 5.3.0
    gatsby-source-shopify: ^8.3.0 => 8.3.0
    gatsby-transformer-json: ^5.3.0 => 5.3.0
    gatsby-transformer-sharp: ^5.3.0 => 5.3.0
  npmGlobalPackages:
    gatsby-cli: 5.3.0

I am able to reproduce the error with npx gatsby new my-shopify-store https://github.com/gatsbyjs/gatsby-starter-shopify yarn install yarn develop

chmielulu commented 1 year ago

Have the same issue.

MacBook Air M1 2020 MacOS 13.0.1 Node.js v18.12.1

yarn run v1.22.19
$ gatsby develop
β ‹ compile gatsby files
error Command failed with signal "SIGSEGV".
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
theiawolfe commented 1 year ago

Same issue:

MacBook Pro (14-inch, 2021) M1 Pro MacOS 12.6.1 Node.js v18.12.1

$ gatsby build
β ‹ compile gatsby files
error Command failed with signal "SIGSEGV".
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
petrpacas commented 1 year ago

+1

labnol commented 1 year ago

+1

LekoArts commented 1 year ago

Sorry for the inconveniences this is causing, we'll look into it today and rollout a fix. About the Windows issue, please go to https://github.com/gatsbyjs/gatsby/issues/37251

Sidenote: Please don’t comment β€ž+1β€œ, GitHub has an emoji reaction system

LekoArts commented 1 year ago

We're pretty sure that the lmdb upgrade is the cause and have prepared a PR to revert that commit: https://github.com/gatsbyjs/gatsby/pull/37255

Also it seems to only happen on Mac, we couldn't reproduce on WSL or Windows.

Once merged we'll test that it resolves it (on all platforms) and then backport as 5.3.1

LekoArts commented 1 year ago

I opened https://github.com/kriszyp/lmdb-js/issues/206 to hopefully get to the bottom of this πŸ‘ The revert PR is merged and in our testing it works again, so we'll release 5.3.1 shortly.

LekoArts commented 1 year ago

Fixed in gatsby@5.3.1 πŸŽ‰