I was originally going to post this at https://github.com/vadimcn/codelldb/discussions/new?category=q-a
But once I realized it looked to be bugs and not directly related to the extension, I opted to post here…
EDIT: v16.0.6
I wasn’t certain if serial
support was fully incorporated in LLDB
GDB succeeds:
{
"name": "gdb",
"type": "cppdbg",
"request": "launch",
"cwd": "/<pathTo>/linux-stable",
"MIMode": "gdb",
"miDebuggerPath": "/usr/bin/aarch64-linux-gnu-gdb",
"miDebuggerServerAddress": "/dev/ttyUSB0",
"targetArchitecture": "arm64",
"program": "/<pathTo>/vmlinux"
}
LLDB succeeds (using QEMU):
{
"name": "lldb qemu",
"type": "lldb",
"request": "custom",
"targetCreateCommands": [
"target create /<pathTo>/vmlinux"
],
"processCreateCommands": [
"gdb-remote 127.0.0.1:1234"
],
"preLaunchTask": "qemu"
}
LLDB fails (attempt from console first):
Before exiting screen
, the last message was KGDB: Waiting for connection from remote gdb...
.
$ lldb
(lldb) platform select remote-gdb-server
Platform: remote-gdb-server
Connected: no
(lldb) platform connect serial:///dev/ttyUSB0
Platform: remote-gdb-server
Hostname: (null)
Connected: yes
(lldb) target create <pathTo>/vmlinux
Current executable set to '/<pathTo>/vmlinux' (aarch64).
(lldb) gdb-remote serial:///dev/ttyUSB0
error: gdb-remote [<hostname>:]<portnum>
(lldb) process connect --plugin gdb-remote serial:///dev/ttyUSB0
Process 1 stopped
* thread #1, stop reason = signal SIGTRAP
frame #0: 0xffffffc08005ed6c vmlinux`arch_local_irq_enable at irqflags.h:51:1
48 } else {
49 __daif_local_irq_enable();
50 }
-> 51 }
52
53 static __always_inline void __daif_local_irq_disable(void)
54 {
When I saw gdb-remote
was a shortcut to the plugin, that made me give the full statement a try which surprised me that it accepted serial
while the shortcut did not.
But as you can see, even with it finally connecting, it craps out with a SIGTRAP
.
OH! Going back to vscode (I had added the launcher once I saw the full plugin statement “worked”(?)), I see it’s still spitting out output from the device:
...
Executing script: processCreateCommands
2
Stop reason: signal SIGTRAP
device-mapper: ioctl: 4.48.0-ioctl (2023-03-01) initialised: dm-devel@redhat.com
Freeing initrd memory: 12996K
rcu: INFO: rcu_sched detected stalls on CPUs/tasks:
rcu: 4-...0: (0 ticks this GP) idle=138c/1/0x4000000000000000 softirq=13/13 fqs=2582
rcu: (detected by 1, t=5252 jiffies, g=-1171, q=1140 ncpus=8)
Sending NMI from CPU 1 to CPUs 4:
NMI backtrace for cpu 4
CPU: 4 PID: 1 Comm: swapper/0 Not tainted 6.7.9 #14
Hardware name: radxa Radxa ROCK 5 Model B/Radxa ROCK 5 Model B, BIOS 2024.04-rc3-geac52e4b 04/01/2024
rcu: INFO: rcu_sched detected stalls on CPUs/tasks:
pstate: 80400009 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
rcu: 4-....: (7543 ticks this GP) idle=138c/1/0x4000000000000000 softirq=13/13 fqs=7776
pc : __do_softirq+0x8c/0x22c
rcu: (detected by 2, t=22645 jiffies, g=-1171, q=1140 ncpus=8)
lr : ____do_softirq+0x18/0x28
Sending NMI from CPU 2 to CPUs 4:
sp : ffffffc0809fbf80
rcu: rcu_sched kthread starved for 2498 jiffies! g-1171 f0x0 RCU_GP_DOING_FQS(6) ->state=0x0 ->cpu=5
x29: ffffffc0809fbf90
rcu: Unless rcu_sched kthread gets sufficient CPU time, OOM is now expected behavior.
x28: 000000000000000a
rcu: RCU grace-period kthread stack dump:
x27: 0000000000000282
task:rcu_sched state:I
stack:0 pid:15 tgid:15 ppid:2 flags:0x00000008
x26: ffffffc08090d320
Call trace:
x25: ffffffc0808687b0
__switch_to+0xc0/0x13c
x24: ffffffc0808850c0
__schedule+0x414/0x4d0
schedule+0x4c/0x78
x23: ffffff8000828000
schedule_timeout+0xa0/0x10c
x22: ffffffc080070714
rcu_gp_fqs_loop+0x190/0x704
x21: 00000000ebdb9000
rcu_gp_kthread+0xbc/0x130
x20: ffffffc080a3b900
kthread+0xd8/0xf0
x19: ffffffc0800100b8
ret_from_fork+0x10/0x20
x18: ffffffc0809e5010
rcu: Stack dump where RCU GP kthread last ran:
Sending NMI from CPU 2 to CPUs 5:
x17: ffffffc06f64d000 x16: ffffffc0809f8000 x15: 0000000000000174
x14: 0000000002dfc431 x13: 0000000000002a8e x12: 0000000029aaaaab
x11: 0038fb672092de00 x10: ffffffc08086cc80 x9 : 0000000000000100
x8 : ffffffc06f64d000 x7 : 69203a7265707061 x6 : 6d2d656369766564
x5 : ffffffc0809881fc x4 : 02d9f83121f96cea x3 : 000000000000000f
rcu: INFO: rcu_sched detected stalls on CPUs/tasks:
x2 : 0000000000000000 x1 : ffffffc080013a90
rcu: 4-....: (7543 ticks this GP) idle=138c/1/0x4000000000000000 softirq=13/13 fqs=13029
x0 : 0000000000000000
And just to put it out there, I’m running from a tinyconfig
as a baseline and building out for exactly what I need.
It’s currently at the stage where it gets into the initramfs
and systemd/dracut timesout looking for my sdcard for root which I expected.
I thought I’d see what benefit may come from stepping through boot debug.
So while the original issue began with using serial
with the gdb-remote
shortcut (I gather I should post a bug with LLDB?), it has now become that SIGTRAP
.