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
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn’t already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 20 (7 by maintainers)
Commits related to this issue
- fix(useTimeoutFn): immediate on SSR, close #317 — committed to chaii3/vitest by antfu 3 years ago
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
Prior to Vitest 0.12.3, the only way I can reliably run the tests is to set
minThreads
/maxThreads
to1
. 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 issuesfewer 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
andmaxThreads
set to1
, 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 faultnpx vitest run src/backend/[a-u]test.ts
- seg fault most of the timenpx vitest run src/backend/[a-k]test.ts
- worksnpx vitest run src/backend/some-file.test.ts
(with any file including the ones at the end of the alphabet) - worksUpgrading 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 pnpmThat’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