Skip to content

segfault when running jest tests in fastify with esm mode #43083

Description

@dlemperFuchs

Version

v16.15.0

Platform

Linux main-deb 5.10.0-0.bpo.11-amd64 #1 SMP Debian 5.10.92-1~bpo10+1 (2022-02-03) x86_64 GNU/Linux

Subsystem

No response

What steps will reproduce the bug?

git clone https://github.com/dlemperFuchs/fastify-jest-esm-segfault
cd fastify-jest-esm-segfault
npm install
NODE_OPTIONS=--experimental-vm-modules npx jest

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

reproducible every time

What is the expected behavior?

Jest runs tests in the repo

What do you see instead?

(node:249708) ExperimentalWarning: VM Modules is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
(node:249708) [FST_MODULE_DEP_FASTIFY-AUTOLOAD] FastifyWarning.fastify-autoload: fastify-autoload has been deprecated. Use @fastify/autoload@4.0.0 instead.

 RUNS  test/routes/root.test.js
PID 249708 received SIGSEGV for address: 0x10
/home/dlemper/Dokumente/src/fsttest/node_modules/segfault-handler/build/Release/segfault-handler.node(+0x2e37)[0x7fe9d5a75e37]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x12730)[0x7fe9d572b730]
node[0xa19eba]
node(_ZN2v88internal7Isolate38RunHostImportModuleDynamicallyCallbackENS0_6HandleINS0_6ScriptEEENS2_INS0_6ObjectEEENS0_11MaybeHandleIS5_EE+0xad)[0xe42d1d]
node(_ZN2v88internal25Runtime_DynamicImportCallEiPmPNS0_7IsolateE+0xba)[0x1203d8a]
node[0x15f2254]
Segmentation fault

Additional information

Sorry, I'm quite unsure if this is a node problem or a jest or fastify problem. I tried several things within about 40 hours but nothing worked and in my opinion a segfault shouldn't happen while JS code gets executed.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    experimentalIssues and PRs related to experimental features.staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.vmIssues and PRs related to the vm subsystem.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions