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

rethrowing error from worker causes illegal instruction panic #15415

Closed
trvswgnr opened this issue Nov 26, 2024 · 3 comments
Closed

rethrowing error from worker causes illegal instruction panic #15415

trvswgnr opened this issue Nov 26, 2024 · 3 comments
Assignees
Labels
confirmed bug We can reproduce this issue crash An issue that could cause a crash runtime

Comments

@trvswgnr
Copy link

How can we reproduce the crash?

  1. git clone https://github.com/trvswgnr/bun-worker-microservices.git
  2. git checkout bun-crash-bug
  3. bun ./index.ts
  4. see intentional error thrown at services/logger.ts:7:9
  5. see error being rethrown at shared/util.ts:102:13

Relevant log output

➜ worker-microservices git:(main) ✗ bun ./index.ts
123 travvy
2 | import fs from "node:fs";
3 | 
4 | const validStrategies = {
5 |     console: console.log,
6 |     file: (msg: string) => {
7 |         fs.appendFileSync("logs/app.log", `${msg}\n`)
               ^
ENOENT: No such file or directory
   errno: -2
 syscall: "open"

      at file (/Users/WagnerT/projects/worker-microservices/services/logger.ts:7:12)
      at /Users/WagnerT/projects/worker-microservices/services/logger.ts:23:41
      at log (/Users/WagnerT/projects/worker-microservices/services/logger.ts:29:18)
      at /Users/WagnerT/projects/worker-microservices/shared/util.ts:88:37
============================================================
Bun v1.1.36 (ededc168) macOS x64
macOS v13.2.1
CPU: sse42 popcnt avx avx2
Args: "bun" "./index.ts"
Features: jsc transpiler_cache(16) tsconfig workers_spawned(15) 
Builtins: "bun:main" "node:fs" "node:string_decoder" "node:util/types" 
Elapsed: 80ms | User: 413ms | Sys: 144ms
RSS: 99.09MB | Peak: 99.09MB | Commit: 1.07GB | Faults: 146

panic: Illegal instruction at address 0x10220BF53
oh no: Bun has crashed. This indicates a bug in Bun, not your code.

To send a redacted crash report to Bun's team,
please file a GitHub issue using the link below:

 https://bun.report/1.1.36/ma1ededc16EgggkggD__m6i/iBo4orlBirgglBy3+/kBmo+/kB+usmmBipisagy3xIA3Cm1/ikC

234 travvy
2 | import fs from "node:fs";
3 | 
4 | const validStrategies = {
5 |     console: console.log,
6 |     file: (msg: string) => {
7 |         fs.appendFileSync("logs/app.log", `${msg}\n`)
               ^
ENOENT: No such file or directory
   errno: -2
 syscall: "open"

      at file (/Users/WagnerT/projects/worker-microservices/services/logger.ts:7:12)
      at /Users/WagnerT/projects/worker-microservices/services/logger.ts:23:41
      at log (/Users/WagnerT/projects/worker-microservices/services/logger.ts:29:18)
      at /Users/WagnerT/projects/worker-microservices/shared/util.ts:88:37
[1]    54576 illegal hardware instruction  bun ./index.ts

Stack Trace (bun.report)

Bun v1.1.36 (ededc16) on macos x86_64 [AutoCommand]

Illegal instruction at address 0x106A58F53

  • 2 unknown/js code
  • WebCore::reportException
  • WebCore::JSEventListener::handleEvent
  • WebCore::EventTarget::innerInvokeEventListeners
  • WebCore::EventTarget::fireEventListeners
  • WebCore::EventTarget::dispatchEvent
  • WebWorker__dispatchError
  • src.bun.js.web_worker.WebWorker.onUnhandledRejection
  • Bun__reportUnhandledError

Features: workers_spawned, jsc, transpiler_cache, tsconfig

Sentry Issue: BUN-8Y3

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

@trvswgnr, the latest version of Bun is v1.1.37, but this crash was reported on Bun v1.1.36.

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

bun upgrade

@RiskyMH RiskyMH added confirmed bug We can reproduce this issue and removed macOS An issue that occurs on macOS labels Nov 26, 2024
@trvswgnr
Copy link
Author

yes

@190n 190n self-assigned this Dec 3, 2024
@Jarred-Sumner
Copy link
Collaborator

Tracking this in #15964

TLDR: Worker in Bun is still unstable, especially when it comes to error handling or closing them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed bug We can reproduce this issue crash An issue that could cause a crash runtime
Projects
None yet
Development

No branches or pull requests

4 participants