oven-sh / bun

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

Segmentation fault with sequelize-typescript + pg + reflect-metadata #6644

Open eslym opened 11 months ago

eslym commented 11 months ago

What version of Bun is running?

1.0.7+b62c010e95579017ee0ec6c1a4c8355d0110ac4b

What platform is your computer?

Linux 5.15.90.1-microsoft-standard-WSL2 x86_64 x86_64

What steps can reproduce the bug?

  1. import 'reflect-metadata';, this is the key point of the segmentation fault triggered, remove it then everything seems fine
  2. use sequelize-typescript with postgres dialect

minimum setup to reproduce: bun-test.zip

What is the expected behavior?

dont seg fault

What do you see instead?

seg fault

Additional information

LLDB log ``` $ lldb ./bun-linux-x64-profile/bun-profile ./scripts/sync-db.ts (lldb) target create "./bun-linux-x64-profile/bun-profile" Current executable set to '/com.docker.devenvironments.code/bun-linux-x64-profile/bun-profile' (x86_64). (lldb) settings set -- target.run-args "./scripts/sync-db.ts" (lldb) run Process 43922 launched: '/com.docker.devenvironments.code/bun-linux-x64-profile/bun-profile' (x86_64) Process 43922 stopped * thread #1, name = 'bun-profile', stop reason = signal SIGSEGV: invalid address (fault address: 0x1a) frame #0: 0x00007fffad4c40b3 -> 0x7fffad4c40b3: movq 0x10(%rax), %rax 0x7fffad4c40b7: movq %rax, -0x28(%r12) 0x7fffad4c40bc: movq %rax, -0x40(%rbp) 0x7fffad4c40c0: movq 0x30(%rbp), %rax (lldb) bt all error: need to add support for DW_TAG_base_type 'anyopaque' encoded with DW_ATE = 0x5, bit_size = 0 * thread #1, name = 'bun-profile', stop reason = signal SIGSEGV: invalid address (fault address: 0x1a) * frame #0: 0x00007fffad4c40b3 frame #1: 0x00007fffad49555e frame #2: 0x00005555590a1d20 bun-profile`vmEntryToJavaScript + 213 frame #3: 0x0000555559704fb9 bun-profile`JSC::Interpreter::executeCall(JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 2025 frame #4: 0x000055555936f88b bun-profile`JSC::VM::drainMicrotasks() + 907 frame #5: 0x000055555ae132ca bun-profile`Bun::jsFunctionDrainMicrotaskQueue(JSC::JSGlobalObject*, JSC::CallFrame*) + 10 frame #6: 0x00007fffad43c1b8 frame #7: 0x00005555590c01a1 bun-profile`js_trampoline_op_call_ignore_result + 23 frame #8: 0x00005555590a1d20 bun-profile`vmEntryToJavaScript + 213 frame #9: 0x0000555559704fb9 bun-profile`JSC::Interpreter::executeCall(JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 2025 frame #10: 0x0000555559bf424b bun-profile`JSC::call(JSC::JSGlobalObject*, JSC::JSValue, JSC::ArgList const&, WTF::ASCIILiteral) + 235 frame #11: 0x000055555adda1cb bun-profile`Bun::JSNextTickQueue::drain(JSC::VM&, JSC::JSGlobalObject*) + 299 frame #12: 0x00005555587e9917 bun-profile`src.bun.js.event_loop.EventLoop.tickWithCount [inlined] drainMicrotasksWithGlobal(this=0x00000264a80f0100, globalObject=0x00007fffac4c4068) at event_loop.zig:631:45 frame #13: 0x00005555587e9912 bun-profile`src.bun.js.event_loop.EventLoop.tickWithCount(this=0x00000264a80f0100) at event_loop.zig:922 frame #14: 0x0000555558673037 bun-profile`src.bun.js.event_loop.EventLoop.tick(this=0x00000264a80f0100) at event_loop.zig:1087:38 frame #15: 0x0000555558b0a771 bun-profile`src.bun.js.event_loop.EventLoop.waitForPromise(this=0x00000264a80f0100, promise=src.bun.js.bindings.bindings.AnyPromise @ 0x00007ffffff95280) at event_loop.zig:1109:30 frame #16: 0x00005555589bb4bc bun-profile`src.bun.js.javascript.VirtualMachine.loadEntryPoint [inlined] waitForPromise(promise=src.bun.js.bindings.bindings.AnyPromise @ 0x00007ffffff95280) at javascript.zig:1030:40 frame #17: 0x00005555589bb4b7 bun-profile`src.bun.js.javascript.VirtualMachine.loadEntryPoint(this=0x00000264a80f0000, entry_path=) at javascript.zig:2185 frame #18: 0x00005555585c6de3 bun-profile`src.bun.js.javascript.OpaqueWrap__anon_50961__struct_715844.callback at bun_js.zig:256:30 frame #19: 0x00005555585c6d31 bun-profile`src.bun.js.javascript.OpaqueWrap__anon_50961__struct_715844.callback(ctx=0x000055555b42cea0) at javascript.zig:105 frame #20: 0x000055555aec1874 bun-profile`JSC__VM__holdAPILock + 36 frame #21: 0x000055555852e131 bun-profile`src.bun_js.Run.boot at shimmer.zig:186:41 frame #22: 0x000055555852e11b bun-profile`src.bun_js.Run.boot [inlined] holdAPILock(this=, ctx=, callback=) at bindings.zig:5068 frame #23: 0x000055555852e11b bun-profile`src.bun_js.Run.boot(ctx_=, entry_path=) at bun_js.zig:233 frame #24: 0x000055555853e1c5 bun-profile`src.cli.Command.maybeOpenWithBunJS(ctx=0x00007ffffffc3d00) at cli.zig:1748:23 frame #25: 0x00005555582a9c8a bun-profile`src.cli.Cli.start__anon_5447 at cli.zig:1647:47 frame #26: 0x00005555582a8e5a bun-profile`src.cli.Cli.start__anon_5447(allocator=, (null)=, (null)=) at cli.zig:57 frame #27: 0x00005555582a4daa bun-profile`main at main.zig:40:22 frame #28: 0x00005555582a4b60 bun-profile`main [inlined] callMain at start.zig:573 frame #29: 0x00005555582a4b60 bun-profile`main [inlined] initEventLoopAndCallMain at start.zig:517 frame #30: 0x00005555582a4b60 bun-profile`main at start.zig:467 frame #31: 0x00005555582a4b1c bun-profile`main(c_argc=, c_argv=, c_envp=) at start.zig:482 frame #32: 0x00007ffff7ca4d0a libc.so.6`__libc_start_main(main=(bun-profile`main at start.zig:470), argc=2, argv=0x00007fffffffe008, init=, fini=, rtld_fini=, stack_end=0x00007fffffffdff8) at libc-start.c:308:16 frame #33: 0x0000555557f6902a bun-profile`_start + 42 thread #2, name = 'bun-profile' frame #0: 0x00007ffff7e63ad8 libpthread.so.0`__pthread_cond_timedwait at futex-internal.h:323:13 frame #1: 0x00007ffff7e63ab3 libpthread.so.0`__pthread_cond_timedwait at pthread_cond_wait.c:520 frame #2: 0x00007ffff7e639e0 libpthread.so.0`__pthread_cond_timedwait(cond=0x00007fffefc44968, mutex=0x00007fffefc44940, abstime=0x00007fffefbeea00) at pthread_cond_wait.c:656 frame #3: 0x00005555592c4dee bun-profile`scavenger_thread_main + 1918 frame #4: 0x00007ffff7e5cea7 libpthread.so.0`start_thread(arg=) at pthread_create.c:477:8 frame #5: 0x00007ffff7d7ca2f libc.so.6`__clone at clone.S:95 thread #3, name = 'HeapHelper' frame #0: 0x00007ffff7e63ad8 libpthread.so.0`__pthread_cond_timedwait at futex-internal.h:323:13 frame #1: 0x00007ffff7e63ab3 libpthread.so.0`__pthread_cond_timedwait at pthread_cond_wait.c:520 frame #2: 0x00007ffff7e639e0 libpthread.so.0`__pthread_cond_timedwait(cond=0x00007fffee0d8138, mutex=0x00007fffee0d8110, abstime=0x00007fffa936a810) at pthread_cond_wait.c:656 frame #3: 0x00005555593219a8 bun-profile`WTF::ParkingLot::parkConditionallyImpl(void const*, WTF::ScopedLambda const&, WTF::ScopedLambda const&, WTF::TimeWithDynamicClockType const&) + 6104 frame #4: 0x000055555956b764 bun-profile`WTF::Detail::CallableWrapper::call() + 404 frame #5: 0x00005555592a4707 bun-profile`WTF::wtfThreadEntryPoint(void*) + 311 frame #6: 0x00007ffff7e5cea7 libpthread.so.0`start_thread(arg=) at pthread_create.c:477:8 frame #7: 0x00007ffff7d7ca2f libc.so.6`__clone at clone.S:95 thread #4, name = 'HeapHelper' frame #0: 0x00007ffff7e63ad8 libpthread.so.0`__pthread_cond_timedwait at futex-internal.h:323:13 frame #1: 0x00007ffff7e63ab3 libpthread.so.0`__pthread_cond_timedwait at pthread_cond_wait.c:520 frame #2: 0x00007ffff7e639e0 libpthread.so.0`__pthread_cond_timedwait(cond=0x00007fffee0e4138, mutex=0x00007fffee0e4110, abstime=0x00007fffa8b69810) at pthread_cond_wait.c:656 frame #3: 0x00005555593219a8 bun-profile`WTF::ParkingLot::parkConditionallyImpl(void const*, WTF::ScopedLambda const&, WTF::ScopedLambda const&, WTF::TimeWithDynamicClockType const&) + 6104 frame #4: 0x000055555956b764 bun-profile`WTF::Detail::CallableWrapper::call() + 404 frame #5: 0x00005555592a4707 bun-profile`WTF::wtfThreadEntryPoint(void*) + 311 frame #6: 0x00007ffff7e5cea7 libpthread.so.0`start_thread(arg=) at pthread_create.c:477:8 frame #7: 0x00007ffff7d7ca2f libc.so.6`__clone at clone.S:95 thread #5, name = 'HeapHelper' frame #0: 0x00007ffff7e63ad8 libpthread.so.0`__pthread_cond_timedwait at futex-internal.h:323:13 frame #1: 0x00007ffff7e63ab3 libpthread.so.0`__pthread_cond_timedwait at pthread_cond_wait.c:520 frame #2: 0x00007ffff7e639e0 libpthread.so.0`__pthread_cond_timedwait(cond=0x00007fffee0f4138, mutex=0x00007fffee0f4110, abstime=0x00007fffa8368810) at pthread_cond_wait.c:656 frame #3: 0x00005555593219a8 bun-profile`WTF::ParkingLot::parkConditionallyImpl(void const*, WTF::ScopedLambda const&, WTF::ScopedLambda const&, WTF::TimeWithDynamicClockType const&) + 6104 frame #4: 0x000055555956b764 bun-profile`WTF::Detail::CallableWrapper::call() + 404 frame #5: 0x00005555592a4707 bun-profile`WTF::wtfThreadEntryPoint(void*) + 311 frame #6: 0x00007ffff7e5cea7 libpthread.so.0`start_thread(arg=) at pthread_create.c:477:8 frame #7: 0x00007ffff7d7ca2f libc.so.6`__clone at clone.S:95 thread #6, name = 'HeapHelper' frame #0: 0x00007ffff7e63ad8 libpthread.so.0`__pthread_cond_timedwait at futex-internal.h:323:13 frame #1: 0x00007ffff7e63ab3 libpthread.so.0`__pthread_cond_timedwait at pthread_cond_wait.c:520 frame #2: 0x00007ffff7e639e0 libpthread.so.0`__pthread_cond_timedwait(cond=0x00007fffee0fc138, mutex=0x00007fffee0fc110, abstime=0x00007fffa7b67810) at pthread_cond_wait.c:656 frame #3: 0x00005555593219a8 bun-profile`WTF::ParkingLot::parkConditionallyImpl(void const*, WTF::ScopedLambda const&, WTF::ScopedLambda const&, WTF::TimeWithDynamicClockType const&) + 6104 frame #4: 0x000055555956b764 bun-profile`WTF::Detail::CallableWrapper::call() + 404 frame #5: 0x00005555592a4707 bun-profile`WTF::wtfThreadEntryPoint(void*) + 311 frame #6: 0x00007ffff7e5cea7 libpthread.so.0`start_thread(arg=) at pthread_create.c:477:8 frame #7: 0x00007ffff7d7ca2f libc.so.6`__clone at clone.S:95 thread #7, name = 'HeapHelper' frame #0: 0x00007ffff7e63ad8 libpthread.so.0`__pthread_cond_timedwait at futex-internal.h:323:13 frame #1: 0x00007ffff7e63ab3 libpthread.so.0`__pthread_cond_timedwait at pthread_cond_wait.c:520 frame #2: 0x00007ffff7e639e0 libpthread.so.0`__pthread_cond_timedwait(cond=0x00007fffee104138, mutex=0x00007fffee104110, abstime=0x00007fffa7366810) at pthread_cond_wait.c:656 frame #3: 0x00005555593219a8 bun-profile`WTF::ParkingLot::parkConditionallyImpl(void const*, WTF::ScopedLambda const&, WTF::ScopedLambda const&, WTF::TimeWithDynamicClockType const&) + 6104 frame #4: 0x000055555956b764 bun-profile`WTF::Detail::CallableWrapper::call() + 404 frame #5: 0x00005555592a4707 bun-profile`WTF::wtfThreadEntryPoint(void*) + 311 frame #6: 0x00007ffff7e5cea7 libpthread.so.0`start_thread(arg=) at pthread_create.c:477:8 frame #7: 0x00007ffff7d7ca2f libc.so.6`__clone at clone.S:95 thread #8, name = 'HeapHelper' frame #0: 0x00007ffff7e63ad8 libpthread.so.0`__pthread_cond_timedwait at futex-internal.h:323:13 frame #1: 0x00007ffff7e63ab3 libpthread.so.0`__pthread_cond_timedwait at pthread_cond_wait.c:520 frame #2: 0x00007ffff7e639e0 libpthread.so.0`__pthread_cond_timedwait(cond=0x00007fffee114138, mutex=0x00007fffee114110, abstime=0x00007fffa6b65810) at pthread_cond_wait.c:656 frame #3: 0x00005555593219a8 bun-profile`WTF::ParkingLot::parkConditionallyImpl(void const*, WTF::ScopedLambda const&, WTF::ScopedLambda const&, WTF::TimeWithDynamicClockType const&) + 6104 frame #4: 0x000055555956b764 bun-profile`WTF::Detail::CallableWrapper::call() + 404 frame #5: 0x00005555592a4707 bun-profile`WTF::wtfThreadEntryPoint(void*) + 311 frame #6: 0x00007ffff7e5cea7 libpthread.so.0`start_thread(arg=) at pthread_create.c:477:8 frame #7: 0x00007ffff7d7ca2f libc.so.6`__clone at clone.S:95 thread #9, name = 'HeapHelper' frame #0: 0x00007ffff7e63ad8 libpthread.so.0`__pthread_cond_timedwait at futex-internal.h:323:13 frame #1: 0x00007ffff7e63ab3 libpthread.so.0`__pthread_cond_timedwait at pthread_cond_wait.c:520 frame #2: 0x00007ffff7e639e0 libpthread.so.0`__pthread_cond_timedwait(cond=0x00007fffee11c138, mutex=0x00007fffee11c110, abstime=0x00007fffa6364810) at pthread_cond_wait.c:656 frame #3: 0x00005555593219a8 bun-profile`WTF::ParkingLot::parkConditionallyImpl(void const*, WTF::ScopedLambda const&, WTF::ScopedLambda const&, WTF::TimeWithDynamicClockType const&) + 6104 frame #4: 0x000055555956b764 bun-profile`WTF::Detail::CallableWrapper::call() + 404 frame #5: 0x00005555592a4707 bun-profile`WTF::wtfThreadEntryPoint(void*) + 311 frame #6: 0x00007ffff7e5cea7 libpthread.so.0`start_thread(arg=) at pthread_create.c:477:8 frame #7: 0x00007ffff7d7ca2f libc.so.6`__clone at clone.S:95 thread #10, name = 'Bun Pool' frame #0: 0x00005555587aa11b bun-profile`src.thread_pool.Event.wait at Atomic.zig:80:45 frame #1: 0x00005555587aa11b bun-profile`src.thread_pool.Event.wait(self=0x000055555b9aa36c) at thread_pool.zig:840 frame #2: 0x0000555558c81908 bun-profile`src.thread_pool.wait(self=0x000055555b9aa328, _is_waking=) at thread_pool.zig:574:33 frame #3: 0x00005555587a9881 bun-profile`Thread.PosixThreadImpl.spawn__anon_773250.Instance.entryFn [inlined] run(thread_pool=0x000055555b9aa328) at thread_pool.zig:708:41 frame #4: 0x00005555587a982b bun-profile`Thread.PosixThreadImpl.spawn__anon_773250.Instance.entryFn [inlined] callFn__anon_895282 at Thread.zig:412 frame #5: 0x00005555587a982b bun-profile`Thread.PosixThreadImpl.spawn__anon_773250.Instance.entryFn(raw_arg=0x000055555ba9cc70) at Thread.zig:685 frame #6: 0x00007ffff7e5cea7 libpthread.so.0`start_thread(arg=) at pthread_create.c:477:8 frame #7: 0x00007ffff7d7ca2f libc.so.6`__clone at clone.S:95 thread #11, name = 'Bun Pool' frame #0: 0x00005555587aa11b bun-profile`src.thread_pool.Event.wait at Atomic.zig:80:45 frame #1: 0x00005555587aa11b bun-profile`src.thread_pool.Event.wait(self=0x000055555b9aa36c) at thread_pool.zig:840 frame #2: 0x0000555558c81908 bun-profile`src.thread_pool.wait(self=0x000055555b9aa328, _is_waking=) at thread_pool.zig:574:33 frame #3: 0x00005555587a9881 bun-profile`Thread.PosixThreadImpl.spawn__anon_773250.Instance.entryFn [inlined] run(thread_pool=0x000055555b9aa328) at thread_pool.zig:708:41 frame #4: 0x00005555587a982b bun-profile`Thread.PosixThreadImpl.spawn__anon_773250.Instance.entryFn [inlined] callFn__anon_895282 at Thread.zig:412 frame #5: 0x00005555587a982b bun-profile`Thread.PosixThreadImpl.spawn__anon_773250.Instance.entryFn(raw_arg=0x00007fffa0000b60) at Thread.zig:685 frame #6: 0x00007ffff7e5cea7 libpthread.so.0`start_thread(arg=) at pthread_create.c:477:8 frame #7: 0x00007ffff7d7ca2f libc.so.6`__clone at clone.S:95 thread #12, name = 'Bun Pool' frame #0: 0x00005555587aa11b bun-profile`src.thread_pool.Event.wait at Atomic.zig:80:45 frame #1: 0x00005555587aa11b bun-profile`src.thread_pool.Event.wait(self=0x000055555b9aa36c) at thread_pool.zig:840 frame #2: 0x0000555558c81908 bun-profile`src.thread_pool.wait(self=0x000055555b9aa328, _is_waking=) at thread_pool.zig:574:33 frame #3: 0x00005555587a9881 bun-profile`Thread.PosixThreadImpl.spawn__anon_773250.Instance.entryFn [inlined] run(thread_pool=0x000055555b9aa328) at thread_pool.zig:708:41 frame #4: 0x00005555587a982b bun-profile`Thread.PosixThreadImpl.spawn__anon_773250.Instance.entryFn [inlined] callFn__anon_895282 at Thread.zig:412 frame #5: 0x00005555587a982b bun-profile`Thread.PosixThreadImpl.spawn__anon_773250.Instance.entryFn(raw_arg=0x00007fff98000b60) at Thread.zig:685 frame #6: 0x00007ffff7e5cea7 libpthread.so.0`start_thread(arg=) at pthread_create.c:477:8 frame #7: 0x00007ffff7d7ca2f libc.so.6`__clone at clone.S:95 thread #13, name = 'Bun Pool' frame #0: 0x00005555587aa11b bun-profile`src.thread_pool.Event.wait at Atomic.zig:80:45 frame #1: 0x00005555587aa11b bun-profile`src.thread_pool.Event.wait(self=0x000055555b9aa36c) at thread_pool.zig:840 frame #2: 0x0000555558c81908 bun-profile`src.thread_pool.wait(self=0x000055555b9aa328, _is_waking=) at thread_pool.zig:574:33 frame #3: 0x00005555587a9881 bun-profile`Thread.PosixThreadImpl.spawn__anon_773250.Instance.entryFn [inlined] run(thread_pool=0x000055555b9aa328) at thread_pool.zig:708:41 frame #4: 0x00005555587a982b bun-profile`Thread.PosixThreadImpl.spawn__anon_773250.Instance.entryFn [inlined] callFn__anon_895282 at Thread.zig:412 frame #5: 0x00005555587a982b bun-profile`Thread.PosixThreadImpl.spawn__anon_773250.Instance.entryFn(raw_arg=0x00007fff90000b60) at Thread.zig:685 frame #6: 0x00007ffff7e5cea7 libpthread.so.0`start_thread(arg=) at pthread_create.c:477:8 frame #7: 0x00007ffff7d7ca2f libc.so.6`__clone at clone.S:95 thread #14, name = 'JITWorker' frame #0: 0x00007ffff7e63ad8 libpthread.so.0`__pthread_cond_timedwait at futex-internal.h:323:13 frame #1: 0x00007ffff7e63ab3 libpthread.so.0`__pthread_cond_timedwait at pthread_cond_wait.c:520 frame #2: 0x00007ffff7e639e0 libpthread.so.0`__pthread_cond_timedwait(cond=0x00007fffee1443b8, mutex=0x00007fffee144390, abstime=0x00007fffa4b5e810) at pthread_cond_wait.c:656 frame #3: 0x00005555593219a8 bun-profile`WTF::ParkingLot::parkConditionallyImpl(void const*, WTF::ScopedLambda const&, WTF::ScopedLambda const&, WTF::TimeWithDynamicClockType const&) + 6104 frame #4: 0x000055555956b764 bun-profile`WTF::Detail::CallableWrapper::call() + 404 frame #5: 0x00005555592a4707 bun-profile`WTF::wtfThreadEntryPoint(void*) + 311 frame #6: 0x00007ffff7e5cea7 libpthread.so.0`start_thread(arg=) at pthread_create.c:477:8 frame #7: 0x00007ffff7d7ca2f libc.so.6`__clone at clone.S:95 thread #15, name = 'CryptoQueue' frame #0: 0x00007ffff7e637b2 libpthread.so.0`__pthread_cond_wait at futex-internal.h:186:13 frame #1: 0x00007ffff7e63794 libpthread.so.0`__pthread_cond_wait at pthread_cond_wait.c:508 frame #2: 0x00007ffff7e636c6 libpthread.so.0`__pthread_cond_wait(cond=0x00007fffee2601b8, mutex=0x00007fffee260190) at pthread_cond_wait.c:638 frame #3: 0x0000555559321b78 bun-profile`WTF::ParkingLot::parkConditionallyImpl(void const*, WTF::ScopedLambda const&, WTF::ScopedLambda const&, WTF::TimeWithDynamicClockType const&) + 6568 frame #4: 0x00005555593034d6 bun-profile`WTF::RunLoop::runImpl(WTF::RunLoop::RunMode) + 4550 frame #5: 0x0000555559301491 bun-profile`WTF::Detail::CallableWrapper::call() + 241 frame #6: 0x00005555592a4707 bun-profile`WTF::wtfThreadEntryPoint(void*) + 311 frame #7: 0x00007ffff7e5cea7 libpthread.so.0`start_thread(arg=) at pthread_create.c:477:8 frame #8: 0x00007ffff7d7ca2f libc.so.6`__clone at clone.S:95 thread #16, name = 'JITWorker' frame #0: 0x00007ffff7e63ad8 libpthread.so.0`__pthread_cond_timedwait at futex-internal.h:323:13 frame #1: 0x00007ffff7e63ab3 libpthread.so.0`__pthread_cond_timedwait at pthread_cond_wait.c:520 frame #2: 0x00007ffff7e639e0 libpthread.so.0`__pthread_cond_timedwait(cond=0x00007fffee318338, mutex=0x00007fffee318310, abstime=0x00007fff8ffb8810) at pthread_cond_wait.c:656 frame #3: 0x00005555593219a8 bun-profile`WTF::ParkingLot::parkConditionallyImpl(void const*, WTF::ScopedLambda const&, WTF::ScopedLambda const&, WTF::TimeWithDynamicClockType const&) + 6104 frame #4: 0x000055555956b764 bun-profile`WTF::Detail::CallableWrapper::call() + 404 frame #5: 0x00005555592a4707 bun-profile`WTF::wtfThreadEntryPoint(void*) + 311 frame #6: 0x00007ffff7e5cea7 libpthread.so.0`start_thread(arg=) at pthread_create.c:477:8 frame #7: 0x00007ffff7d7ca2f libc.so.6`__clone at clone.S:95 thread #17, name = 'JITWorker' frame #0: 0x00007ffff7e63ad8 libpthread.so.0`__pthread_cond_timedwait at futex-internal.h:323:13 frame #1: 0x00007ffff7e63ab3 libpthread.so.0`__pthread_cond_timedwait at pthread_cond_wait.c:520 frame #2: 0x00007ffff7e639e0 libpthread.so.0`__pthread_cond_timedwait(cond=0x00007fffee354138, mutex=0x00007fffee354110, abstime=0x00007fff8f7b7810) at pthread_cond_wait.c:656 frame #3: 0x00005555593219a8 bun-profile`WTF::ParkingLot::parkConditionallyImpl(void const*, WTF::ScopedLambda const&, WTF::ScopedLambda const&, WTF::TimeWithDynamicClockType const&) + 6104 frame #4: 0x000055555956b764 bun-profile`WTF::Detail::CallableWrapper::call() + 404 frame #5: 0x00005555592a4707 bun-profile`WTF::wtfThreadEntryPoint(void*) + 311 frame #6: 0x00007ffff7e5cea7 libpthread.so.0`start_thread(arg=) at pthread_create.c:477:8 frame #7: 0x00007ffff7d7ca2f libc.so.6`__clone at clone.S:95 (lldb) ```

trace using breakpoint show the segment fault seems always happens after node_modules/pg/lib/connection.js line 44, this.stream.connect(port, host) (net.Socket.connect), and the on('connect') listener never get called, not sure does it really the cause.

Jarred-Sumner commented 11 months ago

Debug build of JSC indicates an assertion failure

ASSERTION FAILED: JS assertion failed at line 1 in:
function (promise, value)
{
    "use strict";

    @assert(@isPromise(promise));
    @assert((@getPromiseInternalField(promise, @promiseFieldFlags) & @promiseStateMask) == @promiseStatePending);

    var flags = @getPromiseInternalField(promise, @promiseFieldFlags);
    var reactions = @getPromiseInternalField(promise, @promiseFieldReactionsOrResult);
    @putPromiseInternalField(promise, @promiseFieldReactionsOrResult, value);
    @putPromiseInternalField(promise, @promiseFieldFlags, flags | @promiseStateFulfilled);

    @triggerPromiseReactions(@promiseStateFulfilled, reactions, value);
}

false
WebKit/Source/JavaScriptCore/runtime/JSGlobalObject.cpp(410) : JSC::EncodedJSValue JSC::assertCall(JSGlobalObject *, CallFrame *)
1   0x1024c1598 WTFCrash
2   0x101bc5e94 JSC::assertCall(JSC::JSGlobalObject*, JSC::CallFrame*)
3   0x12200c1fc 2   ???                                 0x000000012200c1fc 0x0 + 4865442300
4   0x12208b334 3   ???                                 0x000000012208b334 0x0 + 4865962804
5   0x1220dbed0 4   ???                                 0x00000001220dbed0 0x0 + 4866293456
6   0x10020e508 vmEntryToJavaScript
7   0x101600e64 JSC::Interpreter::executeCallImpl(JSC::VM&, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
8   0x101600f54 JSC::Interpreter::executeCall(JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
9   0x10199d93c JSC::call(JSC::JSGlobalObject*, JSC::JSValue, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
10  0x10199dbd4 JSC::profiledCall(JSC::JSGlobalObject*, JSC::ProfilingReason, JSC::JSValue, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
11  0x101c49d34 JSC::runJSMicrotask(JSC::JSGlobalObject*, WTF::ObjectIdentifierGeneric<JSC::MicrotaskIdentifierType, WTF::ObjectIdentifierThreadSafeAccessTraits>, JSC::JSValue, JSC::JSValue, JSC::JSValue, JSC::JSValue, JSC::JSValue)
12  0x101ee2000 JSC::QueuedTask::run()
13  0x101ee1dc8 JSC::VM::drainMicrotasks()