Open eslym opened 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()
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?
import 'reflect-metadata';
, this is the key point of the segmentation fault triggered, remove it then everything seems finesequelize-typescript
withpostgres
dialectminimum 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=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 theon('connect')
listener never get called, not sure does it really the cause.