vitest: Segmentation fault (core dumped)

Describe the bug

I’m trying Vitest out for the first time by trying to switch vite-imagetools to use it. I ran vitest and got:

Segmentation fault (core dumped) error Command failed with exit code 139.

Reproduction

git clone https://github.com/benmccann/imagetools.git
cd imagetools
git checkout vitest
yarn
cd packages/core
yarn test

System Info

command doesn’t work because this project uses yarn. I’m hoping to send a PR to switch to pnpm, but that’s sort of blocked on this issue

anyway, I’m using:

  • Vite 2.7.3
  • Vitest 0.0.113

Used Package Manager

yarn

Logs

>Segmentation fault (core dumped)
error Command failed with exit code 139.

Validations

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 20 (7 by maintainers)

Commits related to this issue

Most upvoted comments

I’m also running into this issue, would be nice to have a fix or a workaround!

Facing this issue as well - Re-opening an issue because this one’s closed for some reason

* when using both `minThreads` and `maxThreads` set to `1`, the point (suite file logged in the console) that generates the error every time is different.

Prior to Vitest 0.12.3, the only way I can reliably run the tests is to set minThreads / maxThreads to 1. Am on Windows 10, Node 16.14 (although we get it on a Linux based CI box too).

Since updating to 0.12.3, I have had the issue once (the first time), but since then have had no issues fewer issues.

vitest watch worked 9/10 times (first one failed) vitest run --coverage worked 5/10 times (last 5 failed)

From the experience I had with older releases of Vitest, once the error occurs, it does tend to keep occuring. I’m not sure at what point it starts working again, but it will do at some point!

For now I am more than happy with my workaround of using minThreads and maxThreads set to 1, but thought I’d add my experience up here in case it helps.

bumping as I am facing similar issue as @mikemaccana. If I disable threads, then tests run ok

Hrm using 0.26.2 here and getting Segemntation Faults. I don’t want to file a new issue because I don’t have a repo to reproduce, but I can say the error happens more often the more test files I run in parallel - this is why I can’t reproduce, as running tests individually works.

npx vitest run src/backend/*test.ts - seg fault npx vitest run src/backend/[a-u]test.ts - seg fault most of the time npx vitest run src/backend/[a-k]test.ts - works npx vitest run src/backend/some-file.test.ts (with any file including the ones at the end of the alphabet) - works

Upgrading to the latest did not help me, but rebasing against JonasKruckenberg/imagetools did fix it. I’m not exactly sure what fixed it, but I’m guessing it’s because the repo switched from yarn to pnpm

That’s good enough for me, so I’ll close this issue. If other people are still encountering this I’d recommend filing a new issue with a repository that reproduces your error