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

Receiving this crash consistently when using Bun workers #15345

Open
chadacious opened this issue Nov 22, 2024 · 4 comments
Open

Receiving this crash consistently when using Bun workers #15345

chadacious opened this issue Nov 22, 2024 · 4 comments
Labels
crash An issue that could cause a crash macOS An issue that occurs on macOS runtime

Comments

@chadacious
Copy link

How can we reproduce the crash?

I'll start trying to track down if it's related to any "toLowerCase()" operation in my code, but I haven't pinpointed a reproducible yet.

Relevant log output

============================================================
Bun v1.1.34 (5e5e7c60) macOS x64
macOS v13.6
CPU: sse42 popcnt avx avx2
Args: "bun" "run" "./src/index.ts"
Features: WebSocket(197) bunfig dotenv(192) fetch(15421) http_server jsc spawn(391) transpiler_cache(1566) tsconfig(10) workers_spawned(63) 
Builtins: "bun:main" "node:assert" "node:async_hooks" "node:buffer" "node:child_process" "node:constants" "node:crypto" "node:dns" "node:events" "node:fs" "node:fs/promises" "node:http" "node:https" "node:net" "node:os" "node:path" "node:process" "node:querystring" "node:stream" "node:string_decoder" "node:timers" "node:timers/promises" "node:tls" "node:tty" "node:url" "node:util" "node:util/types" "node:zlib" "node:punycode" "ws" "node-fetch" "node:http2" 
Elapsed: 3225124ms | User: 2266443ms | Sys: 775370ms
RSS: 10.07GB | Peak: 11.68GB | Commit: 0.02ZB | Faults: 482

Stack Trace (bun.report)

Bun v1.1.34 (5e5e7c6) on macos x86_64 [RunCommand]

Illegal instruction at address 0x105C3DE8C

  • 2 unknown/js code
  • pas_immortal_heap_allocate_with_heap_lock_hold_mode
  • pas_segregated_directory_append
  • pas_segregated_size_directory_take_first_eligible
  • bmalloc_heap_config_specialized_local_allocator_try_allocate_small_segregated_slow
  • bmalloc_allocate_impl_casual_case
  • WTF::StringImpl::convertToLowercaseWithoutLocale
  • WTF::String::convertToLowercaseWithoutLocale
  • operationToLowerCase

Features: workers_spawned, WebSocket, bunfig, dotenv, fetch, http_server, jsc, spawn, transpiler_cache, tsconfig

Sentry Issue: BUN-8RW

@chadacious chadacious added the crash An issue that could cause a crash label Nov 22, 2024
@github-actions github-actions bot added macOS An issue that occurs on macOS runtime labels Nov 22, 2024
Copy link
Contributor

@chadacious, the latest version of Bun is v1.1.36, 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

@Jarred-Sumner
Copy link
Collaborator

Can you share any code?

@chadacious
Copy link
Author

@chadacious, the latest version of Bun is v1.1.36, 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

So far so good on the latest version of Bun. It would occur after a period of time and not something I pinpointed to specific code as there is no call stack and the project is pretty complex... could be anywhere. Will report back if I see it again and/or can provide a reproducible.

@chadacious
Copy link
Author

chadacious commented Nov 22, 2024

Ok, I see that actually this is a memory leak resulting from the use of workers. Seems related to this open issue: #5709

Looking for a workaround, or some way to reset/clear memory. For now, I'll use child-process instead.

@chadacious chadacious reopened this Nov 22, 2024
@chadacious chadacious changed the title Receiving this crash consistently Receiving this crash consistently when using Bun workers Nov 22, 2024
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 macOS An issue that occurs on macOS runtime
Projects
None yet
Development

No branches or pull requests

2 participants