awslabs / aws-crt-nodejs

NodeJS bindings for the AWS Common Runtime.
Apache License 2.0
40 stars 27 forks source link

Fatal error condition occurred #286

Closed Kikobeats closed 2 years ago

Kikobeats commented 2 years ago

This is happening using ava@4 as test runner.

Environment information

npx envinfo --binaries --system

  System:
    OS: macOS 12.0.1
    CPU: (10) arm64 Apple M1 Pro
    Memory: 3.32 GB / 32.00 GB
    Shell: 3.3.1 - /opt/homebrew/bin/fish
  Binaries:
    Node: 16.13.1 - ~/.local/share/nvm/v16.13.1/bin/node
    Yarn: 1.22.17 - /opt/homebrew/bin/yarn
    npm: 8.1.2 - ~/.local/share/nvm/v16.13.1/bin/npm

Stack trace error

Fatal error condition occurred in /Users/kikobeats/Projects/microlink/api/node_modules/aws-crt/source/module.c:603: s_node_uv_elg == NULL
Exiting Application
################################################################################
Stack trace:
################################################################################
1   aws-crt-nodejs.node                 0x00000001133723d8 aws_fatal_assert + 80
2   aws-crt-nodejs.node                 0x000000011330d244 napi_register_module_v1 + 2320
3   node                                0x0000000104953758 _Z30napi_module_register_by_symbolN2v85LocalINS_6ObjectEEENS0_INS_5ValueEEENS0_INS_7ContextEEEPFP12napi_value__P10napi_env__S8_E + 496
4   node                                0x0000000104957eb4 _ZNSt3__110__function6__funcIZN4node7binding6DLOpenERKN2v820FunctionCallbackInfoINS4_5ValueEEEE3$_0NS_9allocatorISA_EEFbPNS3_4DLibEEEclEOSE_ + 448
5   node                                0x00000001049570f0 _ZN4node11Environment12TryLoadAddonEPKciRKNSt3__18functionIFbPNS_7binding4DLibEEEE + 240
6   node                                0x0000000104956f18 _ZN4node7binding6DLOpenERKN2v820FunctionCallbackInfoINS1_5ValueEEE + 480
7   node                                0x0000000104b3b57c _ZN2v88internal25FunctionCallbackArguments4CallENS0_15CallHandlerInfoE + 276
8   node                                0x0000000104b3b074 _ZN2v88internal12_GLOBAL__N_119HandleApiCallHelperILb0EEENS0_11MaybeHandleINS0_6ObjectEEEPNS0_7IsolateENS0_6HandleINS0_10HeapObjectEEESA_NS8_INS0_20FunctionTemplateInfoEEENS8_IS4_EENS0_16BuiltinArgumentsE + 468
9   node                                0x0000000104b3a900 _ZN2v88internal21Builtin_HandleApiCallEiPmPNS0_7IsolateE + 228
10  node                                0x000000010527842c Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit + 108
11  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
12  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
13  ???                                 0x00000005580982b4 0x0 + 22951854772
14  ???                                 0x00000005580b60f0 0x0 + 22951977200
15  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
16  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
17  ???                                 0x0000000558091e7c 0x0 + 22951829116
18  ???                                 0x00000005580aca0c 0x0 + 22951938572
19  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
20  ???                                 0x00000005580982b4 0x0 + 22951854772
21  ???                                 0x00000005580b60f0 0x0 + 22951977200
22  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
23  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
24  ???                                 0x0000000558091e7c 0x0 + 22951829116
25  ???                                 0x00000005580aca0c 0x0 + 22951938572
26  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
27  ???                                 0x00000005580982b4 0x0 + 22951854772
28  ???                                 0x00000005580b60f0 0x0 + 22951977200
29  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
30  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
31  ???                                 0x0000000558091e7c 0x0 + 22951829116
32  ???                                 0x00000005580aca0c 0x0 + 22951938572
33  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
34  ???                                 0x00000005580982b4 0x0 + 22951854772
35  ???                                 0x00000005580b60f0 0x0 + 22951977200
36  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
37  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
38  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
39  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
40  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
41  node                                0x0000000105208f78 construct_stub_create_deopt_addr + 344
42  node                                0x00000001053072d0 Builtins_ConstructHandler + 656
43  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
44  node                                0x0000000105208f78 construct_stub_create_deopt_addr + 344
45  node                                0x00000001053072d0 Builtins_ConstructHandler + 656
46  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
47  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
48  ???                                 0x0000000558091e7c 0x0 + 22951829116
49  ???                                 0x00000005580aca0c 0x0 + 22951938572
50  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
51  ???                                 0x00000005580982b4 0x0 + 22951854772
52  ???                                 0x000000055808e7dc 0x0 + 22951815132
53  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
54  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
55  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
56  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
57  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
58  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
59  ???                                 0x0000000558065f60 0x0 + 22951649120
60  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
61  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
62  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
63  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
64  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
65  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
66  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
67  ???                                 0x0000000558065f60 0x0 + 22951649120
68  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
69  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
70  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
71  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
72  node                                0x000000010523b574 Builtins_AsyncFunctionAwaitResolveClosure + 84
73  node                                0x00000001052c0418 Builtins_PromiseFulfillReactionJob + 56
74  node                                0x000000010522d954 Builtins_RunMicrotasks + 596
75  node                                0x0000000105209c44 Builtins_JSRunMicrotasksEntry + 164
76  node                                0x0000000104bde450 _ZN2v88internal12_GLOBAL__N_16InvokeEPNS0_7IsolateERKNS1_12InvokeParamsE + 2332
77  node                                0x0000000104bde884 _ZN2v88internal12_GLOBAL__N_118InvokeWithTryCatchEPNS0_7IsolateERKNS1_12InvokeParamsE + 88
78  node                                0x0000000104bde970 _ZN2v88internal9Execution16TryRunMicrotasksEPNS0_7IsolateEPNS0_14MicrotaskQueueEPNS0_11MaybeHandleINS0_6ObjectEEE + 64
79  node                                0x0000000104c0159c _ZN2v88internal14MicrotaskQueue13RunMicrotasksEPNS0_7IsolateE + 336
80  node                                0x0000000104c01e30 _ZN2v88internal14MicrotaskQueue17PerformCheckpointEPNS_7IsolateE + 124
81  node                                0x00000001048cfd8c _ZN4node21InternalCallbackScope5CloseEv + 248
82  node                                0x00000001048cf7c4 _ZN4node21InternalCallbackScopeD1Ev + 20
83  node                                0x00000001049833dc _ZN4node2fs10FileHandle8CloseReq7ResolveEv + 136
84  node                                0x000000010499610c _ZZN4node2fs10FileHandle12ClosePromiseEvEN3$_08__invokeEP7uv_fs_s + 244
85  node                                0x00000001051ea3b0 uv__work_done + 192
86  node                                0x00000001051edb10 uv__async_io + 320
87  node                                0x00000001051ff824 uv__io_poll + 1052
88  node                                0x00000001051edfa0 uv_run + 380
89  node                                0x00000001048d0e00 _ZN4node13SpinEventLoopEPNS_11EnvironmentE + 244
90  node                                0x0000000104a11be8 _ZN4node6worker6Worker3RunEv + 984
91  node                                0x0000000104a14e10 _ZZN4node6worker6Worker11StartThreadERKN2v820FunctionCallbackInfoINS2_5ValueEEEEN3$_38__invokeEPv + 56
92  libsystem_pthread.dylib             0x00000001b1bb54ec _pthread_start + 148
93  libsystem_pthread.dylib             0x00000001b1bb02d0 thread_start + 8
Signal received: 6, errno: 0
################################################################################
Stack trace:
################################################################################
1   aws-crt-nodejs.node                 0x000000011330d488 s_print_stack_trace + 24
2   libsystem_platform.dylib            0x00000001b1bcc4e4 _sigtramp + 56
3   libsystem_pthread.dylib             0x00000001b1bb515c pthread_kill + 288
4   libsystem_c.dylib                   0x00000001b1af2314 abort + 164
5   aws-crt-nodejs.node                 0x00000001133723dc aws_byte_buf_init + 0
6   aws-crt-nodejs.node                 0x000000011330d244 napi_register_module_v1 + 2320
7   node                                0x0000000104953758 _Z30napi_module_register_by_symbolN2v85LocalINS_6ObjectEEENS0_INS_5ValueEEENS0_INS_7ContextEEEPFP12napi_value__P10napi_env__S8_E + 496
8   node                                0x0000000104957eb4 _ZNSt3__110__function6__funcIZN4node7binding6DLOpenERKN2v820FunctionCallbackInfoINS4_5ValueEEEE3$_0NS_9allocatorISA_EEFbPNS3_4DLibEEEclEOSE_ + 448
9   node                                0x00000001049570f0 _ZN4node11Environment12TryLoadAddonEPKciRKNSt3__18functionIFbPNS_7binding4DLibEEEE + 240
10  node                                0x0000000104956f18 _ZN4node7binding6DLOpenERKN2v820FunctionCallbackInfoINS1_5ValueEEE + 480
11  node                                0x0000000104b3b57c _ZN2v88internal25FunctionCallbackArguments4CallENS0_15CallHandlerInfoE + 276
12  node                                0x0000000104b3b074 _ZN2v88internal12_GLOBAL__N_119HandleApiCallHelperILb0EEENS0_11MaybeHandleINS0_6ObjectEEEPNS0_7IsolateENS0_6HandleINS0_10HeapObjectEEESA_NS8_INS0_20FunctionTemplateInfoEEENS8_IS4_EENS0_16BuiltinArgumentsE + 468
13  node                                0x0000000104b3a900 _ZN2v88internal21Builtin_HandleApiCallEiPmPNS0_7IsolateE + 228
14  node                                0x000000010527842c Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit + 108
15  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
16  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
17  ???                                 0x00000005580982b4 0x0 + 22951854772
18  ???                                 0x00000005580b60f0 0x0 + 22951977200
19  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
20  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
21  ???                                 0x0000000558091e7c 0x0 + 22951829116
22  ???                                 0x00000005580aca0c 0x0 + 22951938572
23  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
24  ???                                 0x00000005580982b4 0x0 + 22951854772
25  ???                                 0x00000005580b60f0 0x0 + 22951977200
26  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
27  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
28  ???                                 0x0000000558091e7c 0x0 + 22951829116
29  ???                                 0x00000005580aca0c 0x0 + 22951938572
30  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
31  ???                                 0x00000005580982b4 0x0 + 22951854772
32  ???                                 0x00000005580b60f0 0x0 + 22951977200
33  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
34  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
35  ???                                 0x0000000558091e7c 0x0 + 22951829116
36  ???                                 0x00000005580aca0c 0x0 + 22951938572
37  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
38  ???                                 0x00000005580982b4 0x0 + 22951854772
39  ???                                 0x00000005580b60f0 0x0 + 22951977200
40  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
41  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
42  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
43  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
44  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
45  node                                0x0000000105208f78 construct_stub_create_deopt_addr + 344
46  node                                0x00000001053072d0 Builtins_ConstructHandler + 656
47  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
48  node                                0x0000000105208f78 construct_stub_create_deopt_addr + 344
49  node                                0x00000001053072d0 Builtins_ConstructHandler + 656
50  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
51  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
52  ???                                 0x0000000558091e7c 0x0 + 22951829116
53  ???                                 0x00000005580aca0c 0x0 + 22951938572
54  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
55  ???                                 0x00000005580982b4 0x0 + 22951854772
56  ???                                 0x000000055808e7dc 0x0 + 22951815132
57  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
58  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
59  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
60  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
61  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
62  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
63  ???                                 0x0000000558065f60 0x0 + 22951649120
64  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
65  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
66  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
67  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
68  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
69  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
70  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
71  ???                                 0x0000000558065f60 0x0 + 22951649120
72  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
73  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
74  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
75  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
76  node                                0x000000010523b574 Builtins_AsyncFunctionAwaitResolveClosure + 84
77  node                                0x00000001052c0418 Builtins_PromiseFulfillReactionJob + 56
78  node                                0x000000010522d954 Builtins_RunMicrotasks + 596
79  node                                0x0000000105209c44 Builtins_JSRunMicrotasksEntry + 164
80  node                                0x0000000104bde450 _ZN2v88internal12_GLOBAL__N_16InvokeEPNS0_7IsolateERKNS1_12InvokeParamsE + 2332
81  node                                0x0000000104bde884 _ZN2v88internal12_GLOBAL__N_118InvokeWithTryCatchEPNS0_7IsolateERKNS1_12InvokeParamsE + 88
82  node                                0x0000000104bde970 _ZN2v88internal9Execution16TryRunMicrotasksEPNS0_7IsolateEPNS0_14MicrotaskQueueEPNS0_11MaybeHandleINS0_6ObjectEEE + 64
83  node                                0x0000000104c0159c _ZN2v88internal14MicrotaskQueue13RunMicrotasksEPNS0_7IsolateE + 336
84  node                                0x0000000104c01e30 _ZN2v88internal14MicrotaskQueue17PerformCheckpointEPNS_7IsolateE + 124
85  node                                0x00000001048cfd8c _ZN4node21InternalCallbackScope5CloseEv + 248
86  node                                0x00000001048cf7c4 _ZN4node21InternalCallbackScopeD1Ev + 20
87  node                                0x00000001049833dc _ZN4node2fs10FileHandle8CloseReq7ResolveEv + 136
88  node                                0x000000010499610c _ZZN4node2fs10FileHandle12ClosePromiseEvEN3$_08__invokeEP7uv_fs_s + 244
89  node                                0x00000001051ea3b0 uv__work_done + 192
90  node                                0x00000001051edb10 uv__async_io + 320
91  node                                0x00000001051ff824 uv__io_poll + 1052
92  node                                0x00000001051edfa0 uv_run + 380
93  node                                0x00000001048d0e00 _ZN4node13SpinEventLoopEPNS_11EnvironmentE + 244
94  node                                0x0000000104a11be8 _ZN4node6worker6Worker3RunEv + 984
95  node                                0x0000000104a14e10 _ZZN4node6worker6Worker11StartThreadERKN2v820FunctionCallbackInfoINS2_5ValueEEEEN3$_38__invokeEPv + 56
96  libsystem_pthread.dylib             0x00000001b1bb54ec _pthread_start + 148
97  libsystem_pthread.dylib             0x00000001b1bb02d0 thread_start + 8
Signal received: 6, errno: 0
################################################################################
Stack trace:
################################################################################
1   aws-crt-nodejs.node                 0x000000011330d488 s_print_stack_trace + 24
2   libsystem_platform.dylib            0x00000001b1bcc4e4 _sigtramp + 56
3   libsystem_pthread.dylib             0x00000001b1bb515c pthread_kill + 288
4   libsystem_c.dylib                   0x00000001b1af2314 abort + 164
5   node                                0x00000001051fa718 uv_barrier_wait + 0
6   node                                0x00000001048e5d24 _ZN4node9MutexBaseINS_16LibuvMutexTraitsEED1Ev + 20
7   libsystem_c.dylib                   0x00000001b1aa47d8 __cxa_finalize_ranges + 460
8   libsystem_c.dylib                   0x00000001b1aa4580 exit + 44
9   aws-crt-nodejs.node                 0x000000011330d490 s_napi_context_finalize + 0
10  libsystem_platform.dylib            0x00000001b1bcc4e4 _sigtramp + 56
11  libsystem_pthread.dylib             0x00000001b1bb515c pthread_kill + 288
12  libsystem_c.dylib                   0x00000001b1af2314 abort + 164
13  aws-crt-nodejs.node                 0x00000001133723dc aws_byte_buf_init + 0
14  aws-crt-nodejs.node                 0x000000011330d244 napi_register_module_v1 + 2320
15  node                                0x0000000104953758 _Z30napi_module_register_by_symbolN2v85LocalINS_6ObjectEEENS0_INS_5ValueEEENS0_INS_7ContextEEEPFP12napi_value__P10napi_env__S8_E + 496
16  node                                0x0000000104957eb4 _ZNSt3__110__function6__funcIZN4node7binding6DLOpenERKN2v820FunctionCallbackInfoINS4_5ValueEEEE3$_0NS_9allocatorISA_EEFbPNS3_4DLibEEEclEOSE_ + 448
17  node                                0x00000001049570f0 _ZN4node11Environment12TryLoadAddonEPKciRKNSt3__18functionIFbPNS_7binding4DLibEEEE + 240
18  node                                0x0000000104956f18 _ZN4node7binding6DLOpenERKN2v820FunctionCallbackInfoINS1_5ValueEEE + 480
19  node                                0x0000000104b3b57c _ZN2v88internal25FunctionCallbackArguments4CallENS0_15CallHandlerInfoE + 276
20  node                                0x0000000104b3b074 _ZN2v88internal12_GLOBAL__N_119HandleApiCallHelperILb0EEENS0_11MaybeHandleINS0_6ObjectEEEPNS0_7IsolateENS0_6HandleINS0_10HeapObjectEEESA_NS8_INS0_20FunctionTemplateInfoEEENS8_IS4_EENS0_16BuiltinArgumentsE + 468
21  node                                0x0000000104b3a900 _ZN2v88internal21Builtin_HandleApiCallEiPmPNS0_7IsolateE + 228
22  node                                0x000000010527842c Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit + 108
23  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
24  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
25  ???                                 0x00000005580982b4 0x0 + 22951854772
26  ???                                 0x00000005580b60f0 0x0 + 22951977200
27  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
28  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
29  ???                                 0x0000000558091e7c 0x0 + 22951829116
30  ???                                 0x00000005580aca0c 0x0 + 22951938572
31  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
32  ???                                 0x00000005580982b4 0x0 + 22951854772
33  ???                                 0x00000005580b60f0 0x0 + 22951977200
34  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
35  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
36  ???                                 0x0000000558091e7c 0x0 + 22951829116
37  ???                                 0x00000005580aca0c 0x0 + 22951938572
38  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
39  ???                                 0x00000005580982b4 0x0 + 22951854772
40  ???                                 0x00000005580b60f0 0x0 + 22951977200
41  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
42  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
43  ???                                 0x0000000558091e7c 0x0 + 22951829116
44  ???                                 0x00000005580aca0c 0x0 + 22951938572
45  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
46  ???                                 0x00000005580982b4 0x0 + 22951854772
47  ???                                 0x00000005580b60f0 0x0 + 22951977200
48  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
49  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
50  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
51  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
52  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
53  node                                0x0000000105208f78 construct_stub_create_deopt_addr + 344
54  node                                0x00000001053072d0 Builtins_ConstructHandler + 656
55  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
56  node                                0x0000000105208f78 construct_stub_create_deopt_addr + 344
57  node                                0x00000001053072d0 Builtins_ConstructHandler + 656
58  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
59  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
60  ???                                 0x0000000558091e7c 0x0 + 22951829116
61  ???                                 0x00000005580aca0c 0x0 + 22951938572
62  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
63  ???                                 0x00000005580982b4 0x0 + 22951854772
64  ???                                 0x000000055808e7dc 0x0 + 22951815132
65  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
66  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
67  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
68  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
69  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
70  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
71  ???                                 0x0000000558065f60 0x0 + 22951649120
72  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
73  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
74  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
75  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
76  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
77  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
78  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
79  ???                                 0x0000000558065f60 0x0 + 22951649120
80  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
81  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
82  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
83  node                                0x000000010520bf78 Builtins_InterpreterEntryTrampoline + 248
84  node                                0x000000010523b574 Builtins_AsyncFunctionAwaitResolveClosure + 84
85  node                                0x00000001052c0418 Builtins_PromiseFulfillReactionJob + 56
86  node                                0x000000010522d954 Builtins_RunMicrotasks + 596
87  node                                0x0000000105209c44 Builtins_JSRunMicrotasksEntry + 164
88  node                                0x0000000104bde450 _ZN2v88internal12_GLOBAL__N_16InvokeEPNS0_7IsolateERKNS1_12InvokeParamsE + 2332
89  node                                0x0000000104bde884 _ZN2v88internal12_GLOBAL__N_118InvokeWithTryCatchEPNS0_7IsolateERKNS1_12InvokeParamsE + 88
90  node                                0x0000000104bde970 _ZN2v88internal9Execution16TryRunMicrotasksEPNS0_7IsolateEPNS0_14MicrotaskQueueEPNS0_11MaybeHandleINS0_6ObjectEEE + 64
91  node                                0x0000000104c0159c _ZN2v88internal14MicrotaskQueue13RunMicrotasksEPNS0_7IsolateE + 336
92  node                                0x0000000104c01e30 _ZN2v88internal14MicrotaskQueue17PerformCheckpointEPNS_7IsolateE + 124
93  node                                0x00000001048cfd8c _ZN4node21InternalCallbackScope5CloseEv + 248
94  node                                0x00000001048cf7c4 _ZN4node21InternalCallbackScopeD1Ev + 20
95  node                                0x00000001049833dc _ZN4node2fs10FileHandle8CloseReq7ResolveEv + 136
96  node                                0x000000010499610c _ZZN4node2fs10FileHandle12ClosePromiseEvEN3$_08__invokeEP7uv_fs_s + 244
97  node                                0x00000001051ea3b0 uv__work_done + 192
98  node                                0x00000001051edb10 uv__async_io + 320
99  node                                0x00000001051ff824 uv__io_poll + 1052
100 node                                0x00000001051edfa0 uv_run + 380
101 node                                0x00000001048d0e00 _ZN4node13SpinEventLoopEPNS_11EnvironmentE + 244
102 node                                0x0000000104a11be8 _ZN4node6worker6Worker3RunEv + 984
103 node                                0x0000000104a14e10 _ZZN4node6worker6Worker11StartThreadERKN2v820FunctionCallbackInfoINS2_5ValueEEEEN3$_38__invokeEPv + 56
104 libsystem_pthread.dylib             0x00000001b1bb54ec _pthread_start + 148
105 libsystem_pthread.dylib             0x00000001b1bb02d0 thread_start + 8
gugu commented 2 years ago

Same thing, but reproduces only in ava v4 with workerThreads enabled, turning off workerThreads fixes the problem. Here is my stacktrace:

FROM node:16.13.1-slim, esm-enabled code

> NODE_ENV=test NODE_OPTIONS=--enable-source-maps ./node_modules/.bin/ava

Fatal error condition occurred in /codebuild/output/src422080616/src/aws-crt-nodejs/source/module.c:603: s_node_uv_elg == NULL
Exiting Application
################################################################################
Stack trace:
################################################################################
/srv/shorturl_redirector/node_modules/aws-crt/dist/bin/linux-x64/aws-crt-nodejs.node(aws_backtrace_print+0x41) [0x7fe50c825d21]
/srv/shorturl_redirector/node_modules/aws-crt/dist/bin/linux-x64/aws-crt-nodejs.node(aws_fatal_assert+0x43) [0x7fe50c81b0f3]
/srv/shorturl_redirector/node_modules/aws-crt/dist/bin/linux-x64/aws-crt-nodejs.node(napi_register_module_v1+0x9e6) [0x7fe50c5fee36]
node(_Z30napi_module_register_by_symbolN2v85LocalINS_6ObjectEEENS0_INS_5ValueEEENS0_INS_7ContextEEEPFP12napi_value__P10napi_env__S8_E+0x351) [0xac7dc1]
node() [0xacc367]
node(_ZN4node7binding6DLOpenERKN2v820FunctionCallbackInfoINS1_5ValueEEE+0x2c3) [0xacc893]
node() [0xd4a35e]
node(_ZN2v88internal21Builtin_HandleApiCallEiPmPNS0_7IsolateE+0xaf) [0xd4b77f]
node() [0x15e78f9]
Signal received: 1866676063, errno: 2019914862
################################################################################
Stack trace:
################################################################################
/srv/shorturl_redirector/node_modules/aws-crt/dist/bin/linux-x64/aws-crt-nodejs.node(aws_backtrace_print+0x41) [0x7fe50c825d21]
/srv/shorturl_redirector/node_modules/aws-crt/dist/bin/linux-x64/aws-crt-nodejs.node(+0x652d3) [0x7fe50c5fd2d3]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x12730) [0x7fe51ffa7730]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x10b) [0x7fe51fe0b7bb]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x121) [0x7fe51fdf6535]
/srv/shorturl_redirector/node_modules/aws-crt/dist/bin/linux-x64/aws-crt-nodejs.node(+0x2830f8) [0x7fe50c81b0f8]
/srv/shorturl_redirector/node_modules/aws-crt/dist/bin/linux-x64/aws-crt-nodejs.node(napi_register_module_v1+0x9e6) [0x7fe50c5fee36]
node(_Z30napi_module_register_by_symbolN2v85LocalINS_6ObjectEEENS0_INS_5ValueEEENS0_INS_7ContextEEEPFP12napi_value__P10napi_env__S8_E+0x351) [0xac7dc1]
node() [0xacc367]
node(_ZN4node7binding6DLOpenERKN2v820FunctionCallbackInfoINS1_5ValueEEE+0x2c3) [0xacc893]
node() [0xd4a35e]
node(_ZN2v88internal21Builtin_HandleApiCallEiPmPNS0_7IsolateE+0xaf) [0xd4b77f]
node() [0x15e78f9]
Signal received: 0, errno: 0
################################################################################
Stack trace:
################################################################################
/srv/shorturl_redirector/node_modules/aws-crt/dist/bin/linux-x64/aws-crt-nodejs.node(aws_backtrace_print+0x41) [0x7fe50c825d21]
/srv/shorturl_redirector/node_modules/aws-crt/dist/bin/linux-x64/aws-crt-nodejs.node(+0x652d3) [0x7fe50c5fd2d3]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x12730) [0x7fe51ffa7730]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x10b) [0x7fe51fe0b7bb]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x121) [0x7fe51fdf6535]
node() [0xa315d8]
/lib/x86_64-linux-gnu/libc.so.6(+0x39d8c) [0x7fe51fe0dd8c]
/lib/x86_64-linux-gnu/libc.so.6(+0x39eba) [0x7fe51fe0deba]
/srv/shorturl_redirector/node_modules/aws-crt/dist/bin/linux-x64/aws-crt-nodejs.node(+0x652dd) [0x7fe50c5fd2dd]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x12730) [0x7fe51ffa7730]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x10b) [0x7fe51fe0b7bb]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x121) [0x7fe51fdf6535]
/srv/shorturl_redirector/node_modules/aws-crt/dist/bin/linux-x64/aws-crt-nodejs.node(+0x2830f8) [0x7fe50c81b0f8]
/srv/shorturl_redirector/node_modules/aws-crt/dist/bin/linux-x64/aws-crt-nodejs.node(napi_register_module_v1+0x9e6) [0x7fe50c5fee36]
node(_Z30napi_module_register_by_symbolN2v85LocalINS_6ObjectEEENS0_INS_5ValueEEENS0_INS_7ContextEEEPFP12napi_value__P10napi_env__S8_E+0x351) [0xac7dc1]
node() [0xacc367]
node(_ZN4node7binding6DLOpenERKN2v820FunctionCallbackInfoINS1_5ValueEEE+0x2c3) [0xacc893]
node() [0xd4a35e]
node(_ZN2v88internal21Builtin_HandleApiCallEiPmPNS0_7IsolateE+0xaf) [0xd4b77f]
node() [0x15e78f9]
Signal received: 0, errno: 0
################################################################################
Stack trace:
################################################################################
/srv/shorturl_redirector/node_modules/aws-crt/dist/bin/linux-x64/aws-crt-nodejs.node(aws_backtrace_print+0x41) [0x7fe50c825d21]
/srv/shorturl_redirector/node_modules/aws-crt/dist/bin/linux-x64/aws-crt-nodejs.node(+0x652d3) [0x7fe50c5fd2d3]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x12730) [0x7fe51ffa7730]
[0x66457d0]
bretambrose commented 2 years ago

I don't really know anything about ava v4 but the thread-crash vs. process-no-crash as well as the call stacks make me wonder if the issue is with NAPI module multi-init. The CRT does not support multi-init of its native module right now and if multiple inits get invoked within the same process it's going to crash. If that is indeed the root problem, I don't have a timeline when it will get fixed. It's in the backlog, but we haven't had a pressing external stimulus to get it prioritized.

gugu commented 2 years ago

Can you at least add a human-readable node exception? Crashing process, which destroys all connections in the middle of request is not the best way to communicate about errors

bretambrose commented 2 years ago

If you're able to provide from-scratch step-by-step repro, I can try and squeeze something in.

gugu commented 2 years ago

repro.js:

import { Worker, isMainThread, parentPort } from 'worker_threads';
const worker = new Worker('./reproWorker.js');

reproWorker.js:

import 'aws-crt';

package.json:

{
  "name": "repro",
  "version": "1.0.0",
  "description": "",
  "main": "index.js.js",
  "type": "module",
  "author": "",
  "license": "ISC",
  "dependencies": {
    "aws-crt": "1.10.5"
  },
  "devDependencies": {
  }
}

Segfault here

bretambrose commented 2 years ago

How does ava factor in?

gugu commented 2 years ago

By default they use worker threads for running tests. To provide a minimal repro I removed ava and loaded worker threads directly

Kikobeats commented 2 years ago

Correct me if I'm wrong, but potentially this library is broken for any other dependency or user code that uses worker_threads API.

gugu commented 2 years ago

Correct me if I'm wrong, but potentially this library is broken for any other dependency or user code that uses worker_threads API.

Not potentially, it is. The bigger problem is that it kills whole node process instead of raising an exception

bretambrose commented 2 years ago

v1.10.6 now throws an exception if the module init is called more than once.