oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
74.35k stars 2.78k forks source link

Segmentation fault at address 0x6024C - crash while running server.mjs remix apps #15276

Closed mhmdhaekal closed 1 day ago

mhmdhaekal commented 2 days ago

How can we reproduce the crash?

https://github.com/mhmdhaekal/remix-bun-bug

It can be used for minimal reproduction with bun server.mjs. The crash occurred in Bun 1.1.35 and 1.1.36, but it ran on Bun 1.1.34.

Relevant log output

Bun v1.1.36 (ededc168) macOS Silicon
macOS v15.2
Args: "bun" "server.mjs"
Features: Bun.stdin jsc spawn transpiler_cache(13) tsconfig(10) tsconfig_paths(2) process_dlopen(2)
Builtins: "bun:jsc" "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:module" "node:net" "node:os" "node:path" "node:perf_hooks" "node:process" "node:querystring" "node:readline" "node:stream" "node:string_decoder" "node:tls" "node:tty" "node:url" "node:util" "node:util/types" "node:zlib" "node:worker_threads" "ws" "node:v8"
Elapsed: 612ms | User: 259ms | Sys: 95ms
RSS: 132.78MB | Peak: 132.78MB | Commit: 1.07GB | Faults: 1717

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

Stack Trace (bun.report)

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

Segmentation fault at address 0x0006024C

Features: process_dlopen, Bun.stdin, dotenv, jsc, spawn, tsconfig, tsconfig_paths, tsconfig_paths

Sentry Issue: BUN-8NE

Jarred-Sumner commented 2 days ago

Thank you very much for the reproduction

We've been seen a lot of these reports and could not reproduce it.

[sys] close(5[/private/tmp/astroy/remix-bun-bug/node_modules/compression/node_modules/debug/src/node.js])
63 | if (1 !== fd && 2 !== fd) {
64 |   util.deprecate(function(){}, 'except for stderr(2) and stdout(1), any other usage of DEBUG_FD is deprecated. Override debug.log if you want to use a different log function (https://git.io/debug_fd)')()
65 | }
66 |
67 | var stream = 1 === fd ? process.stdout :
68 |              2 === fd ? process.stderr :
                     ^
TypeError: tty.isatty is not a function. (In 'tty.isatty(fd)', 'tty.isatty' is undefined)
      at /private/tmp/astroy/remix-bun-bug/node_modules/compression/node_modules/debug/src/node.js:68:25
      at require (9:26)
      at /private/tmp/astroy/remix-bun-bug/node_modules/compression/node_modules/debug/src/index.js:9:10
      at require (9:26)
      at /private/tmp/astroy/remix-bun-bug/node_modules/compression/index.js:21:5
============================================================
Bun Debug v1.1.35 (46c5ae6d) macOS Silicon
macOS v15.0.1
Args: "bun-debug" "run" "server.mjs"
Features: jsc tsconfig tsconfig_paths
Builtins: "bun:main" "node:buffer" "node:crypto" "node:events" "node:fs" "node:string_decoder" "node:tty" "node:util" "node:util/types"
Elapsed: 204ms | User: 204ms | Sys: 48ms
RSS: 132.53MB | Peak: 132.53MB | Commit: 1.07GB | Faults: 59

panic(main thread): Segmentation fault at address 0x5
???:?:?: 0x199110183 in ??? (libsystem_platform.dylib)
cache/webkit-3bc4abf2d5875baf500b4687ef869987f6d19e00/include/JavaScriptCore/Lookup.h:539:17: 0x10434238b in reifyStaticProperty (../../src/bun.js/bindings/CallSitePrototype.cpp)
cache/webkit-3bc4abf2d5875baf500b4687ef869987f6d19e00/include/JavaScriptCore/Lookup.h:539:17: 0x10434238b in reifyStaticProperty (../../src/bun.js/bindings/CallSitePrototype.cpp)
???:?:?: 0x109aeb78b in __ZN3JSC23setUpStaticFunctionSlotERNS_2VMEPKNS_9ClassInfoEPKNS_14HashTableValueEPNS_8JSObjectENS_12PropertyNameERNS_12PropertySlotE (???)
???:?:?: 0x109a0d1ff in __ZN3JSC8JSObject24getOwnStaticPropertySlotERNS_2VMENS_12PropertyNameERNS_12PropertySlotE (???)
???:?:?: 0x108fa33c3 in __ZN3JSC8JSObject26getOwnNonIndexPropertySlotERNS_2VMEPNS_9StructureENS_12PropertyNameERNS_12PropertySlotE (???)
???:?:?: 0x1097ad04b in __ZN3JSC8JSObject15getPropertySlotILb0EEEbPNS_14JSGlobalObjectENS_12PropertyNameERNS_12PropertySlotE (???)
???:?:?: 0x108fa715b in __ZNK3JSC7JSValue15getPropertySlotEPNS_14JSGlobalObjectENS_12PropertyNameERNS_12PropertySlotE (???)
???:?:?: 0x109b79f9f in __ZNK3JSC7JSValue3getEPNS_14JSGlobalObjectENS_12PropertyNameERNS_12PropertySlotE (???)
???:?:?: 0x109660773 in __ZN3JSC5LLIntL19performLLIntGetByIDENS_13BytecodeIndexEPNS_9CodeBlockEPNS_14JSGlobalObjectENS_7JSValueERKNS_10IdentifierERNS_19GetByIdModeMetadataE (???)

fish: Job 1, 'bun-debug run server.mjs' terminated by signal SIGTRAP (Trace or breakpoint trap)