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

Bun Crash with worker threads #15890

Closed
KrishnaPG opened this issue Dec 20, 2024 · 3 comments
Closed

Bun Crash with worker threads #15890

KrishnaPG opened this issue Dec 20, 2024 · 3 comments
Labels
crash An issue that could cause a crash runtime windows An issue that is known to occur on Windows

Comments

@KrishnaPG
Copy link

How can we reproduce the crash?

When worker thread is terminated in a pool, causing the Bun to crash. This is happening with the https://github.com/poolifier/poolifier-web-worker/blob/e99582f4b4331b6d7ab53d2f0cf691378acb6aab/src/pools/worker-node.ts#L159C17-L159C26

Relevant log output

Features: Bun.stdin(34) jsc transpiler_cache(2) tsconfig(2) workers_spawned(16) workers_terminated(16)
Builtins: "bun:main" "node:buffer" "node:fs" "node:fs/promises" "node:os" "node:path" "node:process" "node:string_decoder" "node:util/types" "node:worker_threads"
Elapsed: 5689ms | User: 2515ms | Sys: 2343ms
RSS: 0.35GB | Peak: 0.81GB | Commit: 0.52GB | Faults: 204942

panic(thread 4108): Segmentation fault at address 0x211E6C44800
oh no: Bun has crashed. This indicates a bug in Bun, not your code.

Stack Trace (bun.report)

Bun v1.1.34 (5e5e7c6) on windows x86_64 [AutoCommand]

Segmentation fault at address 0x00010060

  • atomic.zig:100: fetchOr
  • utility:762: std::exchange
  • ZigSourceProvider.cpp:149: Zig::SourceProvider::~SourceProvider
  • HashTable.h:1202: WTF::HashTable<WTF::RefPtr<JSC::SourceProvider,WTF::RawPtrTraits<JSC::SourceProvider>,WTF::DefaultRefDerefTraits<JSC::SourceProvider> >,WTF::KeyValuePair<WTF::RefPtr<JSC::SourceProvider,WTF::RawPtrTraits<JSC::SourceProvider>,WTF::DefaultRefDerefTraits<JSC::SourceProvider> >,WTF::RefPtr<JSC::SourceProviderCache,WTF::RawPtrTraits<JSC::SourceProviderCache>,WTF::DefaultRefDerefTraits<JSC::SourceProviderCache> > >,WTF::KeyValuePairKeyExtractor<WTF::KeyValuePair<WTF::RefPtr<JSC::SourceProvider,WTF::RawPtrTraits<JSC::SourceProvider>,WTF::DefaultRefDerefTraits<JSC::SourceProvider> >,WTF::RefPtr<JSC::SourceProviderCache,WTF::RawPtrTraits<JSC::SourceProviderCache>,WTF::DefaultRefDerefTraits<JSC::SourceProviderCache> > > >,WTF::DefaultHash<WTF::RefPtr<JSC::SourceProvider,WTF::RawPtrTraits<JSC::SourceProvider>,WTF::DefaultRefDerefTraits<JSC::SourceProvider> > >,WTF::HashMap<WTF::RefPtr<JSC::SourceProvider,WTF::RawPtrTraits<JSC::SourceProvider>,WTF::DefaultRefDerefTraits<JSC::SourceProvider> >,WTF::RefPtr<JSC::SourceProviderCache,WTF::RawPtrTraits<JSC::SourceProviderCache>,WTF::DefaultRefDerefTraits<JSC::SourceProviderCache> >,WTF::DefaultHash<WTF::RefPtr<JSC::SourceProvider,WTF::RawPtrTraits<JSC::SourceProvider>,WTF::DefaultRefDerefTraits<JSC::SourceProvider> > >,WTF::HashTraits<WTF::RefPtr<JSC::SourceProvider,WTF::RawPtrTraits<JSC::SourceProvider>,WTF::DefaultRefDerefTraits<JSC::SourceProvider> > >,WTF::HashTraits<WTF::RefPtr<JSC::SourceProviderCache,WTF::RawPtrTraits<JSC::SourceProviderCache>,WTF::DefaultRefDerefTraits<JSC::SourceProviderCache> > >,WTF::HashTableTraits,0>::KeyValuePairTraits,WTF::HashTraits<WTF::RefPtr<JSC::SourceProvider,WTF::RawPtrTraits<JSC::SourceProvider>,WTF::DefaultRefDerefTraits<JSC::SourceProvider> > >,0>::deallocateTable
  • VM.cpp:520: JSC::VM::~VM
  • VM.h:297: JSC::VM::operator delete
  • web_worker.zig:475: exitAndDeinit
  • web_worker.zig:369: spin
  • bindings.cpp:4855: JSC__VM__holdAPILock
  • shimmer.zig:197: cppFn

Features: workers_spawned, workers_terminated, Bun.stdin, jsc, transpiler_cache, tsconfig

Sentry Issue: BUN-A25

@KrishnaPG KrishnaPG added the crash An issue that could cause a crash label Dec 20, 2024
@github-actions github-actions bot added runtime windows An issue that is known to occur on Windows labels Dec 20, 2024
Copy link
Contributor

@KrishnaPG, the latest version of Bun is v1.1.39, but this crash was reported on Bun v1.1.34.

Are you able to reproduce this crash on the latest version of Bun?

bun upgrade

@KrishnaPG
Copy link
Author

Upgraded to the latest and still same issue.

Stack Trace (bun.report)

Bun v1.1.40 (b5b5100) on windows x86_64 [AutoCommand]

Segmentation fault at address 0x20D72024788

  • ZigGlobalObject.h:292: Zig::GlobalObject::bunVM
  • ZigSourceProvider.cpp:149: Zig::SourceProvider::~SourceProvider
  • HashTable.h:1204: WTF::HashTable<WTF::RefPtr<JSC::SourceProvider,WTF::RawPtrTraits<JSC::SourceProvider>,WTF::DefaultRefDerefTraits<JSC::SourceProvider> >,WTF::KeyValuePair<WTF::RefPtr<JSC::SourceProvider,WTF::RawPtrTraits<JSC::SourceProvider>,WTF::DefaultRefDerefTraits<JSC::SourceProvider> >,WTF::RefPtr<JSC::SourceProviderCache,WTF::RawPtrTraits<JSC::SourceProviderCache>,WTF::DefaultRefDerefTraits<JSC::SourceProviderCache> > >,WTF::KeyValuePairKeyExtractor<WTF::KeyValuePair<WTF::RefPtr<JSC::SourceProvider,WTF::RawPtrTraits<JSC::SourceProvider>,WTF::DefaultRefDerefTraits<JSC::SourceProvider> >,WTF::RefPtr<JSC::SourceProviderCache,WTF::RawPtrTraits<JSC::SourceProviderCache>,WTF::DefaultRefDerefTraits<JSC::SourceProviderCache> > > >,WTF::DefaultHash<WTF::RefPtr<JSC::SourceProvider,WTF::RawPtrTraits<JSC::SourceProvider>,WTF::DefaultRefDerefTraits<JSC::SourceProvider> > >,WTF::HashMap<WTF::RefPtr<JSC::SourceProvider,WTF::RawPtrTraits<JSC::SourceProvider>,WTF::DefaultRefDerefTraits<JSC::SourceProvider> >,WTF::RefPtr<JSC::SourceProviderCache,WTF::RawPtrTraits<JSC::SourceProviderCache>,WTF::DefaultRefDerefTraits<JSC::SourceProviderCache> >,WTF::DefaultHash<WTF::RefPtr<JSC::SourceProvider,WTF::RawPtrTraits<JSC::SourceProvider>,WTF::DefaultRefDerefTraits<JSC::SourceProvider> > >,WTF::HashTraits<WTF::RefPtr<JSC::SourceProvider,WTF::RawPtrTraits<JSC::SourceProvider>,WTF::DefaultRefDerefTraits<JSC::SourceProvider> > >,WTF::HashTraits<WTF::RefPtr<JSC::SourceProviderCache,WTF::RawPtrTraits<JSC::SourceProviderCache>,WTF::DefaultRefDerefTraits<JSC::SourceProviderCache> > >,WTF::HashTableTraits,0>::KeyValuePairTraits,WTF::HashTraits<WTF::RefPtr<JSC::SourceProvider,WTF::RawPtrTraits<JSC::SourceProvider>,WTF::DefaultRefDerefTraits<JSC::SourceProvider> > >,0>::deallocateTable
  • VM.cpp:522: JSC::VM::~VM
  • VM.h:298: JSC::VM::operator delete
  • web_worker.zig:513: exitAndDeinit
  • web_worker.zig:407: spin
  • bindings.cpp:5068: JSC__VM__holdAPILock
  • shimmer.zig:201: cppFn

Features: workers_spawned, workers_terminated, Bun.stdin, jsc, transpiler_cache, tsconfig, tsconfig

@Jarred-Sumner
Copy link
Collaborator

We are tracking worker stability in #15964

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crash An issue that could cause a crash runtime windows An issue that is known to occur on Windows
Projects
None yet
Development

No branches or pull requests

2 participants