Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

diagnose: support newer kernels #484

Merged
merged 3 commits into from
Apr 25, 2024
Merged

diagnose: support newer kernels #484

merged 3 commits into from
Apr 25, 2024

Conversation

hawkw
Copy link
Member

@hawkw hawkw commented Apr 22, 2024

Currently, the humility diagnose command contains its own code for looking up the task table. This code only uses the TASK_TABLE_BASE symbol used by older kernels, and does not look for the TASK_TABLE_SPACE symbol used by newer kernels. This means that on a recent kernel, the diagnose command will fail:

$ 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

This commit changes humility diagnose to use the HubrisArchive::task_table method to look up the task table, instead. Unlike the previous code, this method will look for both the TASK_TABLE_BASE and TASK_TABLE_SIZE symbols of older kernels, and the TASK_TABLE_SPACE symbol of newer kernels. Now, it works for my recent Hubris build:

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

--- Initial Inspection ---

Taking initial snapshot of task status...
System last rebooted 791183 ticks ago; assuming tick=millisecond, 791.183s ago
Snapshot taken, 25 tasks in application.

--- Tasks: First Pass ---

Checking for any suspicious task attributes...

--- Advancing Time ---

Resuming core for a bit...
Core halted after 1001 more ticks.

--- Tasks: Second Pass ---

--- Generating Coredump ---

humility: dumping to hubris.core.0
humility: dumped 731.46KB in 29 seconds
Leaving CPU halted in case you want to inspect.

--- End Of Report ---

Fixes #483

Currently, the `humility diagnose` command contains its own code for
looking up the task table. This code only uses the `TASK_TABLE_BASE`
symbol used by older kernels, and does not look for the
`TASK_TABLE_SPACE` symbol used by newer kernels. This means that on a
recent kernel, the `diagnose` command will fail:

```console
$ 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

```

This commit changes `humility diagnose` to use the
`HubrisArchive::task_table` method to look up the task table, instead.
Unlike the previous code, this method will look for both the
`TASK_TABLE_BASE` and `TASK_TABLE_SIZE` symbols of older kernels, _and_
the `TASK_TABLE_SPACE` symbol of newer kernels. Now, it works for my
recent Hubris build:

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

--- Initial Inspection ---

Taking initial snapshot of task status...
System last rebooted 791183 ticks ago; assuming tick=millisecond, 791.183s ago
Snapshot taken, 25 tasks in application.

--- Tasks: First Pass ---

Checking for any suspicious task attributes...

--- Advancing Time ---

Resuming core for a bit...
Core halted after 1001 more ticks.

--- Tasks: Second Pass ---

--- Generating Coredump ---

humility: dumping to hubris.core.0
humility: dumped 731.46KB in 29 seconds
Leaving CPU halted in case you want to inspect.

--- End Of Report ---

```

Fixes #483
@hawkw hawkw requested review from cbiffle and bcantrill April 22, 2024 17:48
the error from `task_table` is actually already more descriptive
@hawkw hawkw merged commit 795b0c3 into master Apr 25, 2024
11 checks passed
@hawkw hawkw deleted the eliza/diagnose-good-tcbs branch April 25, 2024 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

humility diagnose doesn't work with newer kernels
2 participants