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

Segmentation fault - Test fails when using Vitest, but passes when using Jest #5730

Closed
6 tasks done
Newbie012 opened this issue May 15, 2024 · 2 comments
Closed
6 tasks done

Comments

@Newbie012
Copy link

Newbie012 commented May 15, 2024

Describe the bug

When testing a module from libpg-query, the test passes but at the end of the execution I get "Segmentation fault" with an exit code 139:

 RUN  v1.[6](https://github.com/Newbie012/test-libpg-query-seg-fault/actions/runs/9092913524/job/24990698769#step:6:6).0 /home/runner/work/test-libpg-query-seg-fault/test-libpg-query-seg-fault
 ✓ vitest.test.ts  (1 test) 1ms
 Test Files  1 passed (1)
      Tests  1 passed (1)
   Start at  09:03:23
   Duration  249ms (transform 31ms, setup 0ms, collect 22ms, tests 1ms, environment 0ms, prepare [7](https://github.com/Newbie012/test-libpg-query-seg-fault/actions/runs/9092913524/job/24990698769#step:6:8)0ms)
Segmentation fault (core dumped)
 ELIFECYCLE  Command failed with exit code 139.
Error: Process completed with exit code 139.

When running the same file (but with @jest/globals), I get:

PASS ./jest.test.ts
  ✓ should not throw segfault (4 ms)

Test Suites: 1 passed, 1 total
Tests:       1 passed, 1 total
Snapshots:   0 total
Time:        0.506 s
Ran all test suites matching /jest/i.

Additional Info

Reproduction

  1. git clone git@github.com:Newbie012/test-libpg-query-seg-fault.git
  2. pnpm install
  3. pnpm test:vitest (see error)

System Info

System:
    OS: Linux 6.5 Ubuntu 22.04.4 LTS 22.04.4 LTS (Jammy Jellyfish)
    CPU: (4) x64 AMD EPYC 7763 64-Core Processor
    Memory: 14.62 GB / 15.61 GB
    Container: Yes
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 20.12.2 - /opt/hostedtoolcache/node/20.12.2/x64/bin/node
    Yarn: 1.22.22 - /usr/local/bin/yarn
    npm: 10.5.0 - /opt/hostedtoolcache/node/20.12.2/x64/bin/npm
    pnpm: 8.15.8 - ~/setup-pnpm/node_modules/.bin/pnpm
  Browsers:
    Chrome: 124.0.6367.60
    Chromium: 124.0.6367.0

Used Package Manager

pnpm

Validations

@Newbie012
Copy link
Author

Update - it seems like vitest passes when passing --pool=forks (see execution), but I'm not sure why it wouldn't work with the default option (threads)

@AriPerkkio
Copy link
Member

See https://github.com/vitest-dev/vitest/blob/main/docs/guide/common-errors.md#segfaults-and-native-code-errors and #5047.

@github-actions github-actions bot locked and limited conversation to collaborators Jun 1, 2024
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

2 participants