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

SIGSEGV running jest tests #40058

Closed
DonBranson opened this issue Sep 10, 2021 · 3 comments
Closed

SIGSEGV running jest tests #40058

DonBranson opened this issue Sep 10, 2021 · 3 comments

Comments

@DonBranson
Copy link

DonBranson commented Sep 10, 2021

Version

12, 14, and 16

Platform

At gitlab, in gitlab-runner using the image node:14, etc.

Linux runner--project-0-concurrent-0 5.10.25-linuxkit #1 SMP Tue Mar 23 09:27:39 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

and other images - alpine, ubuntu, centos

Subsystem

No response

What steps will reproduce the bug?

Many tests pass before the SIGSEGV. I'm not sure how to answer this, and that's not helpful, sorry - we have thousands of tests for a React Native project.

How often does it reproduce? Is there a required condition?

Every time.

What is the expected behavior?

The test runs and passes or fails.

What do you see instead?

PASS tests/store/assigned/shipmentLegs/selectors/getShipmentLegsByLoadIdAndShipmentId.test.js
PID 245 received SIGSEGV for address: 0x10
/builds/qdivision/stride/converge-stride-app/node_modules/segfault-handler/build/Release/segfault-handler.node(+0x2cb1)[0x7f36d0442cb1]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x110e0)[0x7f36d41fc0e0]
/usr/local/bin/node[0x9e1ed6]
/usr/local/bin/node(_ZN2v88internal7Isolate38RunHostImportModuleDynamicallyCallbackENS0_6HandleINS0_6ScriptEEENS2_INS0_6ObjectEEE+0x79)[0xd06699]
/usr/local/bin/node(_ZN2v88internal25Runtime_DynamicImportCallEiPmPNS0_7IsolateE+0xa7)[0x107b217]
/usr/local/bin/node[0x140de14]
Segmentation fault (core dumped)
error Command failed with exit code 139.

Additional information

Running under MacOS/Big Sur, the test runs fine.

@jlbooker
Copy link

I believe I'm seeing the same bug.

Node version: v14.20.0
Platform: MacOS 12.5.1 (Monterey, Apple M1 Pro) Darwin mld429 21.6.0 Darwin Kernel Version 21.6.0: Wed Aug 10 14:28:23 PDT 2022; root:xnu-8020.141.5~2/RELEASE_ARM64_T6000 arm64

Reproduction:
Happens consistently while running Jest unit tests on a React project. Dozens of Jest tests run fine, but the last test causes a segfault with the below debug log. The test in question runs fine in isolation. It only crashes when run with the whole suite of tests at the same time. There's nothing unique or special about this particular Jest unit test that should cause a segfault. It's a fairly simple test of a single React component.

I invoked Jest with the following flags: --detectOpenHandles --runInBand --forceExit. Using Jest v29.0.3

PID 69537 received SIGSEGV for address: 0x0
0   segfault-handler.node               0x000000011539b0ba _ZL16segfault_handleriP9__siginfoPv + 298
1   libsystem_platform.dylib            0x00007ff80ab7adfd _sigtramp + 29
2   ???                                 0x0000000308b98aa8 0x0 + 13031279272
3   node                                0x0000000100711ef4 _ZN2v88internal25Runtime_DynamicImportCallEiPmPNS0_7IsolateE + 340
4   node                                0x0000000100a8ec94 Builtins_CEntry_Return1_DontSaveFPRegs_ArgvInRegister_NoBuiltinExit + 52

@jlbooker
Copy link

Possibly related to #25424, #44219, #44211, #43205 -- all seem to point to a problem with dynamic imports, possibly related to importing in a async/await callback.

@bnoordhuis
Copy link
Member

Yes, this is very likely a duplicate of #43205. I'll go ahead and close it out as such.

As a side note: node <16.x is out of support and v16.x will be in a few months but the issue is known to exist in v18.x too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants