awslabs / aws-crt-nodejs

NodeJS bindings for the AWS Common Runtime.
Apache License 2.0
38 stars 24 forks source link

"Signal Received: 5, errno: 0" #404

Closed zkldi closed 1 year ago

zkldi commented 1 year ago

Hi. I just got this bizarre stacktrace that killed a process of mine. It seems to be coming from this library, and happened while I was running a database migration. The code in question has nothing to do with AWS, infact, this library is only brought in as a consequence of import { DeleteObjectCommand, PutObjectCommand, S3Client } from "@aws-sdk/client-s3";

However, the migration i was running never even touches that code (nor anything AWS related).

What does this error/stack trace mean?

Signal received: 5, errno: 0
################################################################################
Stack trace:
################################################################################
/home/zkldi/Repos/Projects/Tachi/tachi-mono/node_modules/.pnpm/aws-crt@1.12.5/node_modules/aws-crt/dist/bin/linux-x64/aws-crt-nodejs.node(aws_backtrace_print+0x41) [0x7fcc090c9d11]
/home/zkldi/Repos/Projects/Tachi/tachi-mono/node_modules/.pnpm/aws-crt@1.12.5/node_modules/aws-crt/dist/bin/linux-x64/aws-crt-nodejs.node(+0x6dc63) [0x7fcc08e6dc63]
/usr/lib/libc.so.6(+0x38a00) [0x7fcc1990ba00]
node(_ZN2v88internal3Map24TransitionToDataPropertyEPNS0_7IsolateENS0_6HandleIS1_EENS4_INS0_4NameEEENS4_INS0_6ObjectEEENS0_18PropertyAttributesENS0_17PropertyConstnessENS0_11StoreOriginE+0x490) [0x10bd6f0]
node(_ZN2v88internal14LookupIterator31PrepareTransitionToDataPropertyENS0_6HandleINS0_10JSReceiverEEENS2_INS0_6ObjectEEENS0_18PropertyAttributesENS0_11StoreOriginE+0x82) [0x10abf72]
node(_ZN2v88internal6Object15AddDataPropertyEPNS0_14LookupIteratorENS0_6HandleIS1_EENS0_18PropertyAttributesENS_5MaybeINS0_11ShouldThrowEEENS0_11StoreOriginE+0x2fa) [0x10cf3fa]
node(_ZN2v88internal8JSObject11AddPropertyEPNS0_7IsolateENS0_6HandleIS1_EENS4_INS0_4NameEEENS4_INS0_6ObjectEEENS0_18PropertyAttributesE+0xab) [0x10851ab]
node() [0xdcb4d0]
node(_ZNK2v88internal13ScopeIterator11VisitLocalsERKSt8functionIFbNS0_6HandleINS0_6StringEEENS3_INS0_6ObjectEEENS1_9ScopeTypeEEENS1_4ModeES8_+0xfa) [0xdcd79a]
node(_ZNK2v88internal13ScopeIterator15VisitLocalScopeERKSt8functionIFbNS0_6HandleINS0_6StringEEENS3_INS0_6ObjectEEENS1_9ScopeTypeEEENS1_4ModeES8_+0x30) [0xdcdd30]
node(_ZN2v88internal13ScopeIterator11ScopeObjectENS1_4ModeE+0x67) [0xdce5e7]
node(_ZN2v88internal18DebugScopeIterator9GetObjectEv+0x12) [0xdcaff2]
node(_ZN12v8_inspector19V8DebuggerAgentImpl17currentCallFramesEPSt10unique_ptrISt6vectorIS1_INS_8protocol8Debugger9CallFrameESt14default_deleteIS5_EESaIS8_EES6_ISA_EE+0x2f2) [0x12b0c82]
node(_ZN12v8_inspector19V8DebuggerAgentImpl8didPauseEiN2v85LocalINS1_5ValueEEERKSt6vectorIiSaIiEENS1_5debug13ExceptionTypeEbbb+0x56e) [0x12b77ce]
node() [0x12a526f]
node(_ZN12v8_inspector15V8InspectorImpl14forEachSessionEiRKSt8functionIFvPNS_22V8InspectorSessionImplEEE+0x1cc) [0x12c334c]
node(_ZN12v8_inspector10V8Debugger18handleProgramBreakEN2v85LocalINS1_7ContextEEENS2_INS1_5ValueEEERKSt6vectorIiSaIiEENS1_5debug13ExceptionTypeEb+0x21d) [0x12a48cd]
node(_ZN2v88internal5Debug12OnDebugBreakENS0_6HandleINS0_10FixedArrayEEENS0_10StepActionE+0x1c9) [0xddaf29]
node(_ZN2v88internal5Debug16HandleDebugBreakENS0_15IgnoreBreakModeE+0x103) [0xddb3c3]
node(_ZN2v85debug13BreakRightNowEPNS_7IsolateE+0x29) [0xdc2799]
node(_ZN2v88internal7Isolate27InvokeApiInterruptCallbacksEv+0x6a) [0xe3911a]
node(_ZN2v88internal10StackGuard16HandleInterruptsEv+0x251) [0xe508e1]
node(_ZN2v88internal25Runtime_StackGuardWithGapEiPmPNS0_7IsolateE+0x74) [0x11fcf14]
node() [0x15f20b9]
bretambrose commented 1 year ago

Basically all it tells is node itself crashed. The CRT library installs a native signal handler (https://github.com/awslabs/aws-crt-nodejs/blob/main/source/module.c#L880-L896) to catch crashes and try and construct a stack trace. The stack produced by the signal handler is 100% node.

zkldi commented 1 year ago

Ah, no worries then. Thank you for clarifying!