secret
Last active

  • Download Gist
1-linux.txt
1 2 3
ulimit -c unlimited
./node -pe 'var a = { test: "Hello Node Summit" }; process.abort();'
Aborted (core dumped)
2-mmdb.sh
Shell
1 2 3 4 5 6 7 8
#!/bin/bash
 
mlogin \
-s /NodeCore/public/linux-cores/mdb-linux.sh \
-s /NodeCore/public/linux-cores/libproc64.so \
-s $1 \
-c "bash /assets/NodeCore/public/linux-cores/mdb-linux.sh /assets/$1" \
$2
3-example.txt
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
./mmdb.sh /NodeCore/public/linux-cores/node-summit-node /NodeCore/public/linux-cores/node-summit-core
* created interactive job -- 7584150a-d174-6dba-f2bf-dd8d830f076d
* waiting for session... established
mdb: warning: librtld_db failed to initialize; shared library information will not be available
> ::load v8
V8 version: 3.14.5.9
Autoconfigured V8 support from target
> ::status
debugging core file of node (64-bit) from unknown machine
file: /assets/NodeCore/public/linux-cores/node-summit-node
initial argv: ./node -pe var a = { test: "Hello Node Summit" }; process.abort();
threading model: raw lwps
status: process terminated with exit status 0
> $r
%rax = 0x0000000000000000 %r8 = 0x00007fff9304cc38
%rbx = 0x0000000001684070 %r9 = 0x0000304d46458101
%rcx = 0xffffffffffffffff %r10 = 0x0000000000000008
%rdx = 0x0000000000000006 %r11 = 0x0000000000000206
%rsi = 0x0000000000007863 %r12 = 0x00000000016d2e00
%rdi = 0x0000000000007863 %r13 = 0x0000000000000000
%r14 = 0x000000000088f7b0
%r15 = 0x00000c533cf091e1
 
%cs = 0x0033 %fs = 0x0000 %gs = 0x0000
%ds = 0x0000 %es = 0x0000 %ss = 0x002b
 
%rip = 0x00007fcd67bfbb25
%rbp = 0x00007fff9304cc30
%rsp = 0x00007fff9304caf8
 
%rflags = 0x00000000
id=0 vip=0 vif=0 ac=0 vm=0 rf=0 nt=0 iopl=0x0
status=<of,df,if,tf,sf,zf,af,pf,cf>
 
%gsbase = 0x0000000000000000
%fsbase = 0x00007fcd68f37720
%trapno = 0x0
%err = 0x0
> ::walk thread | ::findstack
stack pointer for thread 7863: 7fff9304cc30
[ 00007fff9304cc30 0x7fcd67bfbb25() ]
00007fff9304cd50 _ZN2v88internalL21Builtin_HandleApiCallENS0_12_GLOBAL__N_116BuiltinArgumentsILNS0_21BuiltinExtraArgumentsE1EEEPNS0_7IsolateE+0x1a7()
00007fff9304cd78 0x15b07760618e()
00007fff9304cdb0 0x15b07765239a()
00007fff9304cde8 0x15b0776245e7()
00007fff9304ce70 0x15b0776118b7()
00007fff9304cf00 _ZN2v88internalL6InvokeEbNS0_6HandleINS0_10JSFunctionEEENS1_INS0_6ObjectEEEiPS5_Pb+0xf2()
00007fff9304cf50 v8::internal::Execution::Call+0x79()
00007fff9304cfb0 v8::Script::Run+0x13b()
00007fff9304d050 _ZN4node13WrappedScript11EvalMachineILNS0_14EvalInputFlagsE0ELNS0_16EvalContextFlagsE0ELNS0_15EvalOutputFlagsE0EEEN2v86HandleINS5_5ValueEEERKNS5_9ArgumentsE+0xcf()
00007fff9304d060 node::WrappedScript::CompileRunInThisContext+9()
00007fff9304d180 _ZN2v88internalL21Builtin_HandleApiCallENS0_12_GLOBAL__N_116BuiltinArgumentsILNS0_21BuiltinExtraArgumentsE1EEEPNS0_7IsolateE+0x1a7()
00007fff9304d1a8 0x15b07760618e()
00007fff9304d1f0 0x15b077650ec4()
00007fff9304d258 0x15b0776284fe()
00007fff9304d2c8 0x15b07764e850()
00007fff9304d338 0x15b077646f6c()
00007fff9304d3b0 0x15b07762ce25()
00007fff9304d3e8 0x15b07762c685()
00007fff9304d428 0x15b0776245e7()
00007fff9304d4b0 0x15b0776118b7()
00007fff9304d540 _ZN2v88internalL6InvokeEbNS0_6HandleINS0_10JSFunctionEEENS1_INS0_6ObjectEEEiPS5_Pb+0xf2()
00007fff9304d590 v8::internal::Execution::Call+0x79()
00007fff9304d600 v8::Function::Call+0x10c()
00007fff9304d670 node::Load+0xea()
00007fff9304d700 node::Start+0x143()
0000000000000000 0x7fcd67be6c4d()
> $G
C++ symbol demangling enabled
> ::jsstack
7fff9304cc30 0x7fcd67bfbb25
7fff9304cd50 _ZN2v88internalL21Builtin_HandleApiCallENS0_12_GLOBAL__N_116BuiltinArgumentsILNS0_21BuiltinExtraArgumentsE1EEEPNS0_7IsolateE+0x1a7
7fff9304cd78 0x15b07760618e internal (Code: 15b0776060e1)
7fff9304cdb0 0x15b07765239a <anonymous> (as <anon>) (304d46473159)
7fff9304cde8 0x15b0776245e7 <InternalFrame>
7fff9304ce70 0x15b0776118b7 <EntryFrame>
7fff9304cf00 _ZN2v88internalL6InvokeEbNS0_6HandleINS0_10JSFunctionEEENS1_INS0_6ObjectEEEiPS5_Pb+0xf2
7fff9304cf50 v8::internal::Execution::Call+0x79
7fff9304cfb0 v8::Script::Run+0x13b
7fff9304d050 _ZN4node13WrappedScript11EvalMachineILNS0_14EvalInputFlagsE0ELNS0_16EvalContextFlagsE0ELNS0_15EvalOutputFlagsE0EEEN2v86HandleINS5_5ValueEEERKNS5_9ArgumentsE+0xcf
7fff9304d060 node::WrappedScript::CompileRunInThisContext+9
7fff9304d180 _ZN2v88internalL21Builtin_HandleApiCallENS0_12_GLOBAL__N_116BuiltinArgumentsILNS0_21BuiltinExtraArgumentsE1EEEPNS0_7IsolateE+0x1a7
7fff9304d1a8 0x15b07760618e internal (Code: 15b0776060e1)
7fff9304d1f0 0x15b077650ec4 <anonymous> (as <anon>) (c533cf4ad59)
7fff9304d258 0x15b0776284fe <InternalFrame>
7fff9304d2c8 0x15b07764e850 <anonymous> (as Module._compile) (304d46471209)
7fff9304d338 0x15b077646f6c evalScript (c533cf12179)
7fff9304d3b0 0x15b07762ce25 startup (c533cf12101)
7fff9304d3e8 0x15b07762c685 <anonymous> (as <anon>) (c533cf12021)
7fff9304d428 0x15b0776245e7 <InternalFrame>
7fff9304d4b0 0x15b0776118b7 <EntryFrame>
7fff9304d540 _ZN2v88internalL6InvokeEbNS0_6HandleINS0_10JSFunctionEEENS1_INS0_6ObjectEEEiPS5_Pb+0xf2
7fff9304d590 v8::internal::Execution::Call+0x79
7fff9304d600 v8::Function::Call+0x10c
7fff9304d670 node::Load+0xea
7fff9304d700 node::Start+0x143
> ::findjsobjects -p test | ::jsprint
{
test: "Hello Node Summit",
}

Trying to figure out how to do this on our own SmartOS installation with a core dump from a Linux machine.
Could you provide the actual mdb command being executed above? I think that is the missing link.

Thanks for the writeup over on the Joyent blog:

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.