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

Node crash (fatal error) #1517

Closed
6 tasks done
flunderpero opened this issue Jun 20, 2022 · 7 comments
Closed
6 tasks done

Node crash (fatal error) #1517

flunderpero opened this issue Jun 20, 2022 · 7 comments

Comments

@flunderpero
Copy link

Describe the bug

Our test-suite crashes about 90% of the time with

FATAL ERROR: v8::ToLocalChecked Empty MaybeLocal.
 1: 0x1044282dc node::Abort() [/Users/pero/.nvm/versions/node/v16.15.1/bin/node]
 2: 0x104428464 node::errors::TryCatchScope::~TryCatchScope() [/Users/pero/.nvm/versions/node/v16.15.1/bin/node]
 3: 0x104579954 v8::V8::ToLocalEmpty() [/Users/pero/.nvm/versions/node/v16.15.1/bin/node]
 4: 0x104424594 node::fs::FSReqPromise<node::AliasedBufferBase<double, v8::Float64Array, void> >::Resolve(v8::Local<v8::Value>) [/Us
ers/pero/.nvm/versions/node/v16.15.1/bin/node]
 5: 0x10442d09c node::fs::AfterStringPath(uv_fs_s*) [/Users/pero/.nvm/versions/node/v16.15.1/bin/node]
 6: 0x104c96764 uv__work_done [/Users/pero/.nvm/versions/node/v16.15.1/bin/node]
 7: 0x104c99f00 uv__async_io [/Users/pero/.nvm/versions/node/v16.15.1/bin/node]
 8: 0x104cabc78 uv__io_poll [/Users/pero/.nvm/versions/node/v16.15.1/bin/node]
 9: 0x104c9a390 uv_run [/Users/pero/.nvm/versions/node/v16.15.1/bin/node]
10: 0x104376ccc node::SpinEventLoop(node::Environment*) [/Users/pero/.nvm/versions/node/v16.15.1/bin/node]
11: 0x1044ba9e8 node::worker::Worker::Run() [/Users/pero/.nvm/versions/node/v16.15.1/bin/node]
12: 0x1044bdc10 node::worker::Worker::StartThread(v8::FunctionCallbackInfo<v8::Value> const&)::$_3::__invoke(void*) [/Users/pero/.nv
m/versions/node/v16.15.1/bin/node]
13: 0x1a19e026c _pthread_start [/usr/lib/system/libsystem_pthread.dylib]
14: 0x1a19db08c thread_start [/usr/lib/system/libsystem_pthread.dylib]
[1]    27516 abort      npx vitest --silent --run

Reproduction

It happens with node and jsdom environments. I don't have any special configuration, my vite.config.ts looks like this:

export default defineConfig({
    test: {
        exclude: [...configDefaults.exclude, "**/*_e2e*", "**/test.web.wdio/**"],
        setupFiles: ["packages/lib.shared.test/test_setup.ts"],
        threads: true,
        maxThreads: 9,
        minThreads: 1,
        testTimeout: 8000,
        hookTimeout: 10000,
        coverage: true,
    },
})

System Info

System:
    OS: macOS 12.4
    CPU: (10) arm64 Apple M1 Max
    Memory: 5.19 GB / 64.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.15.1 - ~/.nvm/versions/node/v16.15.1/bin/node
    Yarn: 3.1.0 - ~/.nvm/versions/node/v16.15.1/bin/yarn
    npm: 8.11.0 - ~/.nvm/versions/node/v16.15.1/bin/npm
  Browsers:
    Chrome: 102.0.5005.115
    Firefox: 100.0.2
    Safari: 15.5
  npmPackages:
    vitest: 0.15.1 => 0.15.1

Used Package Manager

yarn

Validations

@sheremet-va
Copy link
Member

Not enough information. Please, provide actual reproduction.

@flunderpero
Copy link
Author

I try my best, but it's hard to diagnose a Node failure. This recent comment mentions Node crashes and segfaults, so I thought you are already aware of this problem.

I am still trying to find what goes wrong. I don't get a crash when I comment out the setupFiles, but then most of our tests actually don't run because they need that setup. :-)

@fzn0x
Copy link

fzn0x commented Jun 26, 2022

I try my best, but it's hard to diagnose a Node failure. This recent comment mentions Node crashes and segfaults, so I thought you are already aware of this problem.

I am still trying to find what goes wrong. I don't get a crash when I comment out the setupFiles, but then most of our tests actually don't run because they need that setup. :-)

Have you tried this?

npm rebuild vitest --update-binary

@alex-way
Copy link

I try my best, but it's hard to diagnose a Node failure. This recent comment mentions Node crashes and segfaults, so I thought you are already aware of this problem.
I am still trying to find what goes wrong. I don't get a crash when I comment out the setupFiles, but then most of our tests actually don't run because they need that setup. :-)

Have you tried this?

npm rebuild vitest --update-binary

I've tried this but no dice unfortunately. Is there any debug mode I can enable to provide further logs to help troubleshoot this?

@alex-way
Copy link

Weirdly deleting the node_modules folder and reinstalling everything with pnpm i seems to have resolved this issue for me

@mikestopcontinues
Copy link
Contributor

This problem started for me when I incorporated doing cheerio parsing. However, I tried to load test the code to see if the problem was cheerio, and it doesn't seem to be. I'll try to make a reproduction ASAP.

@sheremet-va
Copy link
Member

Duplicate of #1191

@sheremet-va sheremet-va marked this as a duplicate of #1191 Jul 20, 2022
@sheremet-va sheremet-va closed this as not planned Won't fix, can't repro, duplicate, stale Jul 20, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Jun 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants