cloudflare / cloudflare/workerd
Bug Report - Segmentation fault on MacOS with workerd and wrangler and vitest
- Dominant language
- C++
- Stars
- 8.7k
- Forks
- 739
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 174
Description
I am seeing a segfault crash in the Cloudflare Vitest worker pool on macOS arm64.
- macOS 15.7.3 (`24G419`)
- Apple Silicon
- `bun` `1.3.12`
- `node` `v25.9.0`
- `vitest` `4.1.4`
- `@cloudflare/vitest-pool-workers` `0.14.6`
- `wrangler` `4.82.2`
Some tests run, but tests that import certain Worker/Durable Object modules crash before any test body executes.
```text
*** Received signal #11: Segmentation fault: 11
Error: [vitest-pool]: Worker cloudflare-pool emitted error.
Caused by: Error: Worker exited unexpectedly
```
**What works**
A simple non-DO test file passes under the same runner config.
**What fails**
Files that import more substantial Worker/Durable Object code paths consistently crash the Cloudflare pool before tests run.
**Reproduction commands**
These both fail the same way:
```bash
bunx vitest run --max-workers=1 --no-isolate path/to/crashing.test.ts
```
```bash
node ./node_modules/vitest/vitest.mjs run --max-workers=1 --no-isolate path/to/crashing.test.ts
```
The repo script also fails:
```bash
bun run test
```
**Important notes**
- This is not Bun-specific. Reproduces with direct `node` invocation too.
- `--max-workers=1 --no-isolate` does not avoid the crash.
- The crash happens before test execution for the affected files.
**Tried**
I also tried forcing Miniflare to use a newer external `workerd` binary from the latest GitHub release:
```bash
MINIFLARE_WORKERD_PATH=/absolute/path/to/workerd \
bunx vitest run --max-workers=1 --no-isolate path/to/crashing.test.ts
```
The result was unchanged: same `cloudflare-pool` worker crash and segfault.
I tested with:
- external `workerd` binary version: `workerd 2026-04-14`
Contributor guide
Assessment
This issue has not been assessed yet.