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

Segmentation fault (core dumped) on Github Actions running Node.js 12.x #10662

Closed
Tracked by #1026
Ionaru opened this issue Oct 20, 2020 · 17 comments
Closed
Tracked by #1026

Segmentation fault (core dumped) on Github Actions running Node.js 12.x #10662

Ionaru opened this issue Oct 20, 2020 · 17 comments
Labels
Bug Report Needs Reproduction Every bug report requires a minimal reproduction Needs Triage

Comments

@Ionaru
Copy link

Ionaru commented Oct 20, 2020

🐛 Bug Report

Running tests on Github Actions using Node.js 12.x gives a segmentation fault very frequently when the tests are done.

To Reproduce

Steps to reproduce the behavior:

  1. Create jest tests
  2. Create Github workflow to test on Node.js 12.x
  3. Run the workflow

Expected behavior

The tests succeed (or fail) normally.

Link to repl or repo (highly encouraged)

https://github.com/Ionaru/typeorm-utils/runs/1281969729?check_suite_focus=true

envinfo

  System:
    OS: Linux 5.4 Ubuntu 18.04.5 LTS (Bionic Beaver)
    CPU: (2) x64 Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz
  Binaries:
    Node: 12.19.0 - /opt/hostedtoolcache/node/12.19.0/x64/bin/node
    Yarn: 1.22.5 - /usr/bin/yarn
    npm: 6.14.8 - /opt/hostedtoolcache/node/12.19.0/x64/bin/npm
  npmPackages:
    jest: ^26.6.0 => 26.6.0 
@seahindeniz
Copy link

seahindeniz commented Jun 19, 2021

Similar issue also happens with Node 16.x
The one problem is that, using jest with pnpm or yarn result in fail but not with npm 🙃

Here is the minimal repo with three package manager setup on different branches
https://github.com/seahindeniz/jest-issue-10662

Screenshots .

npm:
image

pnpm:
image

yarn:
image

Windows 10, Node 16.3.0

@seahindeniz
Copy link

Seems like it fails with npm as well on GitHub Actions https://github.com/seahindeniz/jest-issue-10662/runs/2864518775?check_suite_focus=true

@EmiM
Copy link

EmiM commented Jun 29, 2021

We also experienced this problem. We sometimes get segmentation fault (core dumped) after all tests (and other jobs) pass:
https://github.com/ZbayApp/waggle/pull/53/checks?check_run_id=2942073718

  • ubuntu-20.04
  • node 12

@EmiM
Copy link

EmiM commented Jun 29, 2021

I removed --collectCoverage and it passed so it probably caused the error.

@Jolg42
Copy link

Jolg42 commented Jul 8, 2021

Also getting Segmentation fault (core dumped) 3 times in 3 days, it was extremely rare before.
https://github.com/prisma/prisma/runs/3021367125#step:9:247

Probably the latest Node.js 12.x version got a glitch?

@millsp
Copy link

millsp commented Jul 8, 2021

@mhf-ir
Copy link

mhf-ir commented Jul 18, 2021

Same problem docker node:16-buster-slim, switch to node:15-buster-slim problem solve, might be clue

@Jolg42
Copy link

Jolg42 commented Jul 27, 2021

Switching to node:14-buster or node:12-buster also solved it.

@TrySound
Copy link
Contributor

I just solved the problem by setting maxWorkers to 3.

I have a guess experimental-vm-modules flag spends one more available worker and jest-worker must use os.CPUS - 2 or something like this.

cc @SimenB

skeet70 added a commit to IronCoreLabs/recrypt-node-binding that referenced this issue Dec 6, 2021
Should still dodge the weird GH issue tracked by
jestjs/jest#10662 but won't impact local
machine runs as much
skeet70 added a commit to IronCoreLabs/recrypt-node-binding that referenced this issue Dec 6, 2021
Removed the native directory. Made the tests run expecting the same
structure as what we distribute. That same structure is created by
either running `yarn compile` or `node-pre-gyp install` (the second
being how and end user gets the binary).

The publish structure is the same other than the new entry point, so
that should continue working.

* Add NAPI to changelog, would be good to remember

* bump-version: Set release version 0.8.0-pre.1

* Add a comment to clarify where changes happen

Limited jest `maxWorkers` to dodge the weird GH issue tracked by
jestjs/jest#10662 but won't impact local
machine runs as much

Co-authored-by: Leeroy Travis <[email protected]>
skeet70 added a commit to IronCoreLabs/recrypt-node-binding that referenced this issue Dec 6, 2021
* Update to latest of all deps

* Recrypt 0.12

* Try Node 16 as well

* Reduce cardinality

* Bump MSRV to 1.51

* Update documentation.

* Upgrade JS dependencies too.

* Replace Node 10 with 16 in the matrix

* Apply patch

* Update recrypt

* And changelog

* Rust 2021 so we can use recrypt 0.13

* Checkpointing migration to NAPI

* Try different coverage switch command

* Rust fmt

* Neon packaging (#75)

Removed the native directory. Made the tests run expecting the same
structure as what we distribute. That same structure is created by
either running `yarn compile` or `node-pre-gyp install` (the second
being how and end user gets the binary).

The publish structure is the same other than the new entry point, so
that should continue working.

* Add NAPI to changelog, would be good to remember

* bump-version: Set release version 0.8.0-pre.1

* Add a comment to clarify where changes happen

Limited jest `maxWorkers` to dodge the weird GH issue tracked by
jestjs/jest#10662 but won't impact local
machine runs as much

Co-authored-by: Leeroy Travis <[email protected]>

Co-authored-by: Murph Murphy <[email protected]>
Co-authored-by: Leeroy Travis <[email protected]>
trivikr added a commit to trivikr/aws-sdk-js-v3 that referenced this issue Jan 6, 2022
@AlexMesser
Copy link

Having the same issue with node:16.14.0 + --experimental-vm-modules flag. Tests successfully passed on the local machine but fails on GitHub Actions with Segmentation fault (core dumped) error.

Setting maxWorkers to 3-4-5 causes tests to stuck.
Setting --runInBand flag causes fail on a local machine with segmentation fault npm test error.

@adico1
Copy link

adico1 commented Aug 26, 2022

in my case, not related to node 12,
removing --detectOpenHandles helped

reference: https://stackoverflow.com/questions/68012814/gitlab-jest-test-segmentation-fault-core-dumped

@dgrisham
Copy link

Haivng this issue as well running tests on the node:16-alpine container -- the tests were working fine previously, and now the same tests fail during the setup phase. They run fine locally with the same configuration. Same issue with node 18, and we can't go below 16 with our dependencies

chirag-madlani added a commit to open-metadata/OpenMetadata that referenced this issue Oct 1, 2022
Getting segmentation fault error on GitHub CI too frequently for running tests with coverage. trying possible fix for it 
Reference: jestjs/jest#10662
@chirag-madlani
Copy link

Hi all,
I am facing the same issue with my project below is the config that we are using.

Ubuntu version: 20.04.05 LTS
frontend-maven-plugin - v1.11.0
nodeVersion - v16.14.2
yarnVersion - v1.22.18

Getting this error while running Unit tests via jest

jest --passWithNoTests --coverage

Tried running --coverage but that didn't help

Let me know if there's a workaround or any debug technique that I can use

Sachin-chaurasiya pushed a commit to open-metadata/OpenMetadata that referenced this issue Oct 13, 2022
* fix(ui-test): segmentation fault error unit tests

Getting segmentation fault error on GitHub CI too frequently for running tests with coverage. trying possible fix for it 
Reference: jestjs/jest#10662

* fix failed unit tests

* remove coverage to test segmentation fault

* update maxWorker to resolve segmentation fault

* remove duplicate key from props
chirag-madlani added a commit to open-metadata/OpenMetadata that referenced this issue Nov 18, 2022
* fix(ui-test): segmentation fault error unit tests

Getting segmentation fault error on GitHub CI too frequently for running tests with coverage. trying possible fix for it
Reference: jestjs/jest#10662

* fix failed unit tests

* remove coverage to test segmentation fault

* update maxWorker to resolve segmentation fault

* remove duplicate key from props

(cherry picked from commit 2349684)
mohityadav766 added a commit to open-metadata/OpenMetadata that referenced this issue Nov 18, 2022
* Release 0.12.3 - Updated the required files

* updated Docker File

* fix(ui-test): segmentation fault error unit tests (#7840)

* fix(ui-test): segmentation fault error unit tests

Getting segmentation fault error on GitHub CI too frequently for running tests with coverage. trying possible fix for it
Reference: jestjs/jest#10662

* fix failed unit tests

* remove coverage to test segmentation fault

* update maxWorker to resolve segmentation fault

* remove duplicate key from props

(cherry picked from commit 2349684)

Co-authored-by: Chirag Madlani <[email protected]>
@KittySparkles
Copy link

KittySparkles commented Feb 5, 2023

So this is going to sound super weird, but for me the problem started occurring when I upgraded isomorphic-unfetch to v4+. I’ve been having this segfault problem for about 2 weeks, and eventually tracked back the first occurrence to the Dependabot PR updating isomorphic-unfetch in my project. I tried rolling back isomorphic-unfetch to v3.1.0, and Jest no longer throws a segfault. I have no clue why that would be the problem though.

@lucasrodriguezdavila
Copy link

v3.1.0,

this solved for me, thanks

@SimenB SimenB added the Needs Reproduction Every bug report requires a minimal reproduction label Sep 16, 2023
@github-actions
Copy link

As noted in the Bug Report template, all bug reports requires a minimal reproduction. Please open up a new issue providing one. Read more at https://stackoverflow.com/help/minimal-reproducible-example.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Report Needs Reproduction Every bug report requires a minimal reproduction Needs Triage
Projects
None yet
Development

No branches or pull requests