oxidecomputer / humility

Debugger for Hubris
Mozilla Public License 2.0
529 stars 51 forks source link

`humility diagnose` doesn't work with newer kernels #483

Closed hawkw closed 6 months ago

hawkw commented 6 months ago

On a build of the Gimletlet app from oxidecomputer/hubris@acd41c7b16a8cd613b669aa52fce5afa371a4dc2, the humility diagnose command doesn't work, because it can't find the TASK_TABLE_BASE symbol:

$ humility -t gimletlet diagnose
humility: attached to 0483:3754:000B00154D46501520383832 via ST-Link V3

--- Initial Inspection ---

Taking initial snapshot of task status...
humility diagnose failed: expected symbol TASK_TABLE_BASE not found

However, the humility tasks command does work, suggesting that my Hubris image is fine:

$ humility -t gimletlet tasks
:; humility -t gimletlet tasks
humility: attached to 0483:3754:000B00154D46501520383832 via ST-Link V3
system time = 45397
ID TASK                       GEN PRI STATE
 0 jefe                         0   0 recv, notif: fault timer(T+3)
 1 sys                          0   1 recv, notif: exti-wildcard-irq(irq6/irq7/irq8/irq9/irq10/irq23/irq40)
 2 i2c_driver                   0   2 recv
 3 user_leds                    0   5 recv, notif: timer
 4 pong                         0   8 recv, notif: timer(T+103)
 5 uartecho                     0   3 notif: usart-irq(irq38)
 6 hiffy                        0   7 notif: bit31(T+39)
 7 validate                     0   3 recv
 8 idle                         0   9 RUNNING
 9 rng_driver                   0   6 recv
10 update_server                0   3 recv
11 caboose_reader               0   2 recv
12 packrat                      0   3 recv
13 control_plane_agent          0   7 recv, notif: usart-irq(irq37) socket timer
14 sensor                       0   5 recv
15 dump_agent                   0   6 recv, notif: socket
16 gimlet_seq                   0   2 recv
17 host_sp_comms                0   8 wait: send to hf/gen0
18 hf                           0   6 notif: bit31(T+667)
19 hash_driver                  0   2 recv
20 net                          0   3 recv, notif: eth-irq(irq61) wake-timer(T+4638)
21 udprpc                       0   6 notif: socket
22 udpecho                      0   4 notif: socket
23 udpbroadcast                 0   6 notif: bit31(T+229)
24 sprot                        0   5 recv

I believe this is because TASK_TABLE_BASE only exists on older kernels, per this comment: https://github.com/oxidecomputer/humility/blob/c0888b0617898ae6973ea48900369ff7f695ba07/humility-core/src/hubris.rs#L1964-L1987

But, humility diagnose doesn't use that code; it only looks for the older task table symbols: https://github.com/oxidecomputer/humility/blob/c0888b0617898ae6973ea48900369ff7f695ba07/cmd/diagnose/src/lib.rs#L96-L100