~$ ssh [email protected]
# ps aux |grep lldb
485 root lldb dotnethello/dotnethello
488 root /usr/bin/lldb-server gdbserver --fd=5 --native-regs --setsid
565 root grep lldb
# lldb
Using .NET Core runtime to host the managed SOS code
Host runtime path: /root/dotnethello
(lldb) attach 485
This version of LLDB has no plugin for the language "assembler". Inspection of frame variables will be limited.
Process 485 stopped
* thread #1, name = 'lldb', stop reason = signal SIGSTOP
frame #0: 0x0000007f9bee54c0 libc.so.6`__GI___libc_read at read.c:26:10
23 ssize_t
24 __libc_read (int fd, void *buf, size_t nbytes)
25 {
-> 26 return SYSCALL_CANCEL (read, fd, buf, nbytes);
27 }
28 libc_hidden_def (__libc_read)
29
libc.so.6`__GI___libc_read:
-> 0x7f9bee54c0 <+112>: svc #0
0x7f9bee54c4 <+116>: mov x19, x0
0x7f9bee54c8 <+120>: cmn x0, #0x1, lsl #12 ; =0x1000
0x7f9bee54cc <+124>: b.hi 0x7f9bee5504 ; <+180> [inlined] __libc_read at read.c:26:10
thread #2, name = 'dbg.evt-handler', stop reason = signal SIGSTOP
frame #0: 0x0000007fa0e1b580 libpthread.so.0`__pthread_cond_wait at futex-internal.h:183:13
180 {
181 int oldtype;
182 oldtype = __pthread_enable_asynccancel ();
-> 183 int err = lll_futex_timed_wait (futex_word, expected, NULL, private);
184 __pthread_disable_asynccancel (oldtype);
185 switch (err)
186 {
libpthread.so.0`__pthread_cond_wait:
-> 0x7fa0e1b580 <+352>: svc #0
0x7fa0e1b584 <+356>: mov x1, x0
0x7fa0e1b588 <+360>: cmn x0, #0x1, lsl #12 ; =0x1000
0x7fa0e1b58c <+364>: b.hi 0x7fa0e1b674 ; <+596> [inlined] futex_wait_cancelable at futex-internal.h:184:3
thread #3, name = 'wait4(pid=488)>', stop reason = signal SIGSTOP
frame #0: 0x0000007f9bec5d7c libc.so.6`__GI___wait4(pid=<unavailable>, stat_loc=0x0000007f9b50067c, options=1073741824, usage=0x0000000000000000) at wait4.c:30:10
27 {
28 #ifdef __NR_wait4
29 # if __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64
-> 30 return SYSCALL_CANCEL (wait4, pid, stat_loc, options, usage);
31 # else
32 pid_t ret;
33 struct __rusage32 usage32;
libc.so.6`__GI___wait4:
-> 0x7f9bec5d7c <+124>: svc #0
0x7f9bec5d80 <+128>: cmn x0, #0x1, lsl #12 ; =0x1000
0x7f9bec5d84 <+132>: b.hi 0x7f9bec5dc0 ; <+192> at wait4.c:30:10
0x7f9bec5d88 <+136>: mov w19, w0
thread #4, name = 'b-remote.async>', stop reason = signal SIGSTOP
frame #0: 0x0000007fa0e1b580 libpthread.so.0`__pthread_cond_wait at futex-internal.h:183:13
180 {
181 int oldtype;
182 oldtype = __pthread_enable_asynccancel ();
-> 183 int err = lll_futex_timed_wait (futex_word, expected, NULL, private);
184 __pthread_disable_asynccancel (oldtype);
185 switch (err)
186 {
libpthread.so.0`__pthread_cond_wait:
-> 0x7fa0e1b580 <+352>: svc #0
0x7fa0e1b584 <+356>: mov x1, x0
0x7fa0e1b588 <+360>: cmn x0, #0x1, lsl #12 ; =0x1000
0x7fa0e1b58c <+364>: b.hi 0x7fa0e1b674 ; <+596> [inlined] futex_wait_cancelable at futex-internal.h:184:3
thread #5, name = 'intern-state', stop reason = signal SIGSTOP
frame #0: 0x0000007fa0e1b580 libpthread.so.0`__pthread_cond_wait at futex-internal.h:183:13
180 {
181 int oldtype;
182 oldtype = __pthread_enable_asynccancel ();
-> 183 int err = lll_futex_timed_wait (futex_word, expected, NULL, private);
184 __pthread_disable_asynccancel (oldtype);
185 switch (err)
186 {
libpthread.so.0`__pthread_cond_wait:
-> 0x7fa0e1b580 <+352>: svc #0
0x7fa0e1b584 <+356>: mov x1, x0
0x7fa0e1b588 <+360>: cmn x0, #0x1, lsl #12 ; =0x1000
0x7fa0e1b58c <+364>: b.hi 0x7fa0e1b674 ; <+596> [inlined] futex_wait_cancelable at futex-internal.h:184:3
thread #6, name = '.process.stdio>', stop reason = signal SIGSTOP
frame #0: 0x0000007f9beebc20 libc.so.6`__GI___select(nfds=<unavailable>, readfds=0x0000007f9a3e6ea0, writefds=0x0000000000000000, exceptfds=0x0000000000000000, timeout=0x0000007f9a3e6e80) at select.c:53:12
50 tsp = &ts;
51 }
52
-> 53 result = SYSCALL_CANCEL (pselect6, nfds, readfds, writefds, exceptfds, tsp,
54 NULL);
55
56 if (timeout)
libc.so.6`__GI___select:
-> 0x7f9beebc20 <+192>: svc #0
0x7f9beebc24 <+196>: cmn x0, #0x1, lsl #12 ; =0x1000
0x7f9beebc28 <+200>: b.hi 0x7f9beebc54 ; <+244> at select.c:53:12
0x7f9beebc2c <+204>: mov w20, w0
thread #7, name = 'lldb-ust', stop reason = signal SIGSTOP
frame #0: 0x0000007f9beeece4 libc.so.6`syscall at syscall.S:38
35 mov x4, x5
36 mov x5, x6
37 mov x6, x7
-> 38 svc 0x0
39 cmn x0, #4095
40 b.cs 1f
41 RET
libc.so.6`syscall:
-> 0x7f9beeece4 <+36>: svc #0
0x7f9beeece8 <+40>: cmn x0, #0xfff ; =0xfff
0x7f9beeecec <+44>: b.hs 0x7f9beeecf4 ; <+52>
0x7f9beeecf0 <+48>: ret
thread #8, name = 'lldb-ust', stop reason = signal SIGSTOP
frame #0: 0x0000007f9beeece4 libc.so.6`syscall at syscall.S:38
35 mov x4, x5
36 mov x5, x6
37 mov x6, x7
-> 38 svc 0x0
39 cmn x0, #4095
40 b.cs 1f
41 RET
libc.so.6`syscall:
-> 0x7f9beeece4 <+36>: svc #0
0x7f9beeece8 <+40>: cmn x0, #0xfff ; =0xfff
0x7f9beeecec <+44>: b.hs 0x7f9beeecf4 ; <+52>
0x7f9beeecf0 <+48>: ret
thread #9, name = 'lldb', stop reason = signal SIGSTOP
frame #0: 0x0000007f9bee9604 libc.so.6`__GI___poll(fds=0x0000007f6094b6b0, nfds=1, timeout=<unavailable>) at poll.c:41:10
38 timeout_ts_p = &timeout_ts;
39 }
40
-> 41 return SYSCALL_CANCEL (ppoll, fds, nfds, timeout_ts_p, NULL, 0);
42 #endif
43 }
44 libc_hidden_def (__poll)
libc.so.6`__GI___poll:
-> 0x7f9bee9604 <+180>: svc #0
0x7f9bee9608 <+184>: cmn x0, #0x1, lsl #12 ; =0x1000
0x7f9bee960c <+188>: b.hi 0x7f9bee9644 ; <+244> at poll.c:41:10
0x7f9bee9610 <+192>: mov w19, w0
thread #10, name = 'lldb', stop reason = signal SIGSTOP
frame #0: 0x0000007f9bee9604 libc.so.6`__GI___poll(fds=0x0000007f8033c900, nfds=1, timeout=-1) at poll.c:41:10
38 timeout_ts_p = &timeout_ts;
39 }
40
-> 41 return SYSCALL_CANCEL (ppoll, fds, nfds, timeout_ts_p, NULL, 0);
42 #endif
43 }
44 libc_hidden_def (__poll)
libc.so.6`__GI___poll:
-> 0x7f9bee9604 <+180>: svc #0
0x7f9bee9608 <+184>: cmn x0, #0x1, lsl #12 ; =0x1000
0x7f9bee960c <+188>: b.hi 0x7f9bee9644 ; <+244> at poll.c:41:10
0x7f9bee9610 <+192>: mov w19, w0
thread #11, name = 'lldb', stop reason = signal SIGSTOP
frame #0: 0x0000007fa0e1fbe4 libpthread.so.0`__libc_open64(file="/tmp/clr-debug-pipe-485-371848-in", oflag=0) at open64.c:48:10
45 va_end (arg);
46 }
47
-> 48 return SYSCALL_CANCEL (openat, AT_FDCWD, file, oflag | EXTRA_OPEN_FLAGS,
49 mode);
50 }
51
libpthread.so.0`__libc_open64:
-> 0x7fa0e1fbe4 <+180>: svc #0
0x7fa0e1fbe8 <+184>: cmn x0, #0x1, lsl #12 ; =0x1000
0x7fa0e1fbec <+188>: b.hi 0x7fa0e1fc24 ; <+244> at open64.c:48:10
0x7fa0e1fbf0 <+192>: mov w19, w0
thread #12, name = 'lldb', stop reason = signal SIGSTOP
frame #0: 0x0000007fa0e1b580 libpthread.so.0`__pthread_cond_wait at futex-internal.h:183:13
180 {
181 int oldtype;
182 oldtype = __pthread_enable_asynccancel ();
-> 183 int err = lll_futex_timed_wait (futex_word, expected, NULL, private);
184 __pthread_disable_asynccancel (oldtype);
185 switch (err)
186 {
libpthread.so.0`__pthread_cond_wait:
-> 0x7fa0e1b580 <+352>: svc #0
0x7fa0e1b584 <+356>: mov x1, x0
0x7fa0e1b588 <+360>: cmn x0, #0x1, lsl #12 ; =0x1000
0x7fa0e1b58c <+364>: b.hi 0x7fa0e1b674 ; <+596> [inlined] futex_wait_cancelable at futex-internal.h:184:3
thread #13, name = '.NET Finalizer', stop reason = signal SIGSTOP
frame #0: 0x0000007fa0e1b924 libpthread.so.0`__pthread_cond_timedwait at futex-internal.h:320:13
317 return ETIMEDOUT;
318 int oldtype;
319 oldtype = __pthread_enable_asynccancel ();
-> 320 int err = lll_futex_clock_wait_bitset (futex_word, expected,
321 clockid, abstime,
322 private);
323 __pthread_disable_asynccancel (oldtype);
libpthread.so.0`__pthread_cond_timedwait:
-> 0x7fa0e1b924 <+580>: svc #0
0x7fa0e1b928 <+584>: mov x1, x0
0x7fa0e1b92c <+588>: cmn x0, #0x1, lsl #12 ; =0x1000
0x7fa0e1b930 <+592>: b.hi 0x7fa0e1b9e4 ; <+772> [inlined] futex_abstimed_wait_cancelable at futex-internal.h:323:3
Executable module set to "/usr/bin/lldb".
Architecture set to: aarch64-unknown-linux-gnu.
(lldb) image list
[ 0] 06431E41 0x000000558bac0000 /usr/bin/lldb
[ 1] D3C411EE-0486-5C3A-550A-BD0319D00B09-CA2C53A0 0x0000007fa0e6f000 [vdso] (0x0000007fa0e6f000)
[ 2] 6F18CD34 0x0000007fa0e0e000 /lib64/libpthread.so.0
[ 3] 8C907678 0x0000007fa0408000 /usr/lib64/liblldb.so.13git
[ 4] 6D32A039 0x0000007f9e0fb000 /usr/lib64/libclang-cpp.so.13git
[ 5] F0F293BB 0x0000007f9c1ed000 /usr/lib64/libLLVM-13git.so
[ 6] BCF14096 0x0000007f9c05e000 /usr/lib64/libstdc++.so.6
[ 7] 7B81C1FD 0x0000007f9bfb5000 /lib64/libm.so.6
[ 8] 891EC04E 0x0000007f9bf93000 /lib64/libgcc_s.so.1
[ 9] 399C1384 0x0000007f9be25000 /lib64/libc.so.6
[ 10] EE40D8EF 0x0000007fa0e3e000 /lib/ld-linux-aarch64.so.1
[ 11] D2381993 0x0000007f9bdcf000 /usr/lib64/libncurses.so.6
[ 12] 972CA7DA 0x0000007f9bdb0000 /usr/lib64/libform.so.6
[ 13] 47F69E44 0x0000007f9bd9c000 /usr/lib64/libpanel.so.6
[ 14] FFE0795F 0x0000007f9bd88000 /lib64/libdl.so.2
[ 15] 6B85AD6B 0x0000007f9bd70000 /lib64/librt.so.1
[ 16] E85BF4D2-69C6-FE3E-ADC4-648E6BA5FFBD-BF4C0336 0x0000007f9bd37000 /root/.dotnet/sos/libsosplugin.so
[ 17] 9972B066 0x0000007f9b502000 /lib64/libnss_files.so.2
[ 18] 9F494D7A-A7C3-89D2-14FE-4BB106ABB594-0FDDF18C 0x0000007f704a2000 /root/.dotnet/sos/libsos.so
[ 19] 4029DDE4-835B-6BA8-07A9-F447499D289F-B94928AD 0x0000007f6094d000 /root/dotnethello/libcoreclr.so
/root/dotnethello/libcoreclr.so.dbg
[ 20] A577BD51-9216-4D33-4152-30196F1DFD2A-1C950AA0 0x0000007f703de000 /root/dotnethello/libcoreclrtraceptprovider.so
/root/dotnethello/libcoreclrtraceptprovider.so.dbg
[ 21] 395A5DE0 0x0000007f7035c000 /usr/lib64/liblttng-ust.so.0
[ 22] F6AC9BB3 0x0000007f70332000 /usr/lib64/liblttng-ust-tracepoint.so.0
[ 23] 5270F3D2 0x0000007f7ae55000 /usr/lib64/liburcu-bp.so.6
[ 24] 2BF38621 0x0000007f70318000 /usr/lib64/liburcu-cds.so.6
[ 25] D0C899B0 0x0000007f70303000 /usr/lib64/liburcu-common.so.6
[ 26] E0D49E0B-7CF7-053D-27C7-5E8F3BA848FC-4CD1625C 0x0000007f7005a000 /root/dotnethello/libclrjit.so
/root/dotnethello/libclrjit.so.dbg
[ 27] 69D8375D-1CFC-0D4E-0A6C-7B66E3B93729-0BFDF64A 0x0000007f60016000 /root/dotnethello/libSystem.Native.so
/root/dotnethello/libSystem.Native.so.dbg
[ 28] 717B9EA5 0x0000007f59195000 /usr/lib64/libicuuc.so.68
[ 29] 49DB9C5B 0x0000007f524b0000 /usr/lib64/libicudata.so.68
[ 30] CCFC5673 0x0000007f5917b000 /lib64/libatomic.so.1
[ 31] 0C6295E5 0x0000007f58eb4000 /usr/lib64/libicui18n.so.68
[ 32] 50CBD5D8-EB68-5D39-48F6-9F383B8AE53A-7A03D588 0x0000007f58b64000 /root/dotnethello/libmscordaccore.so
/root/dotnethello/libmscordaccore.so.dbg
(lldb) image lookup -r -n ClrDataStackWalk::Request libmscordaccore.so
1 match found in /root/dotnethello/libmscordaccore.so:
Address: libmscordaccore.so[0x00000000000918c4] (libmscordaccore.so.PT_LOAD[0]..text + 378164)
Summary: libmscordaccore.so`ClrDataStackWalk::Request(unsigned int, unsigned int, unsigned char*, unsigned int, unsigned char*) at stack.cpp:383
(lldb) br set -n ClrDataStackWalk::Request -s libmscordaccore.so
Breakpoint 1: where = libmscordaccore.so`ClrDataStackWalk::Request(unsigned int, unsigned int, unsigned char*, unsigned int, unsigned char*) + 40 at stack.cpp:386:5, address = 0x0000007f337cc8ec
(lldb) c
Process 121 resuming
(lldb) Process 121 stopped
* thread #1, name = 'lldb', stop reason = breakpoint 1.1
frame #0: 0x0000007f337cc8ec libmscordaccore.so`ClrDataStackWalk::Request(this=0x000000558686c250, reqCode=4026531840, inBufferSize=0, inBuffer=0x0000000000000000, outBufferSize=8, outBuffer="") at stack.cpp:386:5
383 {
384 HRESULT status;
385
-> 386 DAC_ENTER_SUB(m_dac);
387
388 EX_TRY
389 {
libmscordaccore.so`ClrDataStackWalk::Request:
-> 0x7f337cc8ec <+40>: adrp x0, 445
0x7f337cc8f0 <+44>: mov x20, x5
0x7f337cc8f4 <+48>: ldr x8, [x8]
0x7f337cc8f8 <+52>: mov w21, w4
bt
* thread #1, name = 'lldb', stop reason = breakpoint 1.1
* frame #0: 0x0000007f337cc8ec libmscordaccore.so`ClrDataStackWalk::Request(this=0x000000558686c250, reqCode=4026531840, inBufferSize=0, inBuffer=0x0000000000000000, outBufferSize=8, outBuffer="") at stack.cpp:386:5
frame #1: 0x0000007f50dffcb0 libsos.so`ClrStackImpl::PrintThread(unsigned int, int, int, int, int, int, int) [inlined] DacpFrameData::Request(this=0x0000007fe5276908, dac=<unavailable>) at dacprivate.h:1037:21
frame #2: 0x0000007f50dffc90 libsos.so`ClrStackImpl::PrintThread(osID=<unavailable>, bParams=<unavailable>, bLocals=<unavailable>, bSuppressLines=NO, bGC=<unavailable>, bFull=NO, bDisplayRegVals=NO) at strike.cpp:14033
frame #3: 0x0000007f50df416c libsos.so`::ClrStack(PDEBUG_CLIENT, PCSTR) [inlined] ClrStackImpl::PrintCurrentThread(bParams=NO, bLocals=NO, bSuppressLines=NO, bGC=NO, bNative=NO, bDisplayRegVals=NO) at strike.cpp:14298:9
frame #4: 0x0000007f50df40f0 libsos.so`::ClrStack(client=<unavailable>, args=<unavailable>) at strike.cpp:14818
frame #5: 0x0000007f7c450604 libsosplugin.so`sosCommand::DoExecute(this=<unavailable>, debugger=<unavailable>, arguments=<unavailable>, result=0x0000007fe52771b0) at soscommand.cpp:75:30
frame #6: 0x0000007f80a182a0 liblldb.so.12`CommandPluginInterfaceImplementation::DoExecute(lldb_private::Args&, lldb_private::CommandReturnObject&) + 164
frame #7: 0x0000007f80c362f4 liblldb.so.12`lldb_private::CommandObjectParsed::Execute(char const*, lldb_private::CommandReturnObject&) + 392
frame #8: 0x0000007f80c34230 liblldb.so.12`lldb_private::CommandInterpreter::HandleCommand(char const*, lldb_private::LazyBool, lldb_private::CommandReturnObject&, lldb_private::ExecutionContext*, bool, bool) + 1512
frame #9: 0x0000007f80c347a8 liblldb.so.12`lldb_private::CommandInterpreter::IOHandlerInputComplete(lldb_private::IOHandler&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) + 224
frame #10: 0x0000007f80bd09e4 liblldb.so.12`lldb_private::IOHandlerEditline::Run() + 308
frame #11: 0x0000007f80bc0550 liblldb.so.12`lldb_private::Debugger::RunIOHandlers() + 84
frame #12: 0x0000007f80c2b6c4 liblldb.so.12`lldb_private::CommandInterpreter::RunCommandInterpreter(lldb_private::CommandInterpreterRunOptions&) + 112
frame #13: 0x0000007f80a465b4 liblldb.so.12`lldb::SBDebugger::RunCommandInterpreter(bool, bool) + 484
frame #14: 0x00000055861077e4 lldb`Driver::MainLoop(this=0x0000007fe5277b78) at Driver.cpp:675:39
frame #15: 0x0000005586106594 lldb`main(argc=<unavailable>, argv=<unavailable>) at Driver.cpp:940:34
frame #16: 0x0000007f7c5513f8 libc.so.6`__libc_start_main(main=(lldb`main at Driver.cpp:870:40), argc=2, argv=0x0000007fe5277f88, init=<unavailable>, fini=<unavailable>, rtld_fini=<unavailable>, stack_end=<unavailable>) at libc-start.c:314:16
frame #17: 0x0000005586106638 lldb`_start at start.S:91
(lldb) f 4
frame #4: 0x0000007f50df40f0 libsos.so`::ClrStack(client=<unavailable>, args=<unavailable>) at strike.cpp:14818
14815 ClrStackImpl::PrintAllThreads(bParams, bLocals, bSuppressLines, bGC, bFull, bDisplayRegVals);
14816 }
14817 else {
-> 14818 ClrStackImpl::PrintCurrentThread(bParams, bLocals, bSuppressLines, bGC, bFull, bDisplayRegVals);
14819 }
14820
14821 return S_OK;
libsos.so`::ClrStack(PDEBUG_CLIENT, PCSTR):
0x7f50df40f0 <+956>: adrp x28, 150
0x7f50df40f4 <+960>: ldr x28, [x28, #0xb80]
0x7f50df40f8 <+964>: stp wzr, wzr, [sp, #0x44]
0x7f50df40fc <+968>: ldr x8, [x28]
(lldb) detach
Process 121 detached