Skip to content

Conversation

@hawkw
Copy link
Member

@hawkw hawkw commented Dec 3, 2025

Currently, there is no way to programmatically access the panic message of a task which has faulted due to a Rust panic fron within the Hubris userspace. This branch adds a new read_panic_message kipc that copies the contents of a panicked task's panic message buffer into the caller. If the requested task has not panicked, this kipc returns an error indicating this. This is intended by use by supervisor implementations or other tasks which wish to report panic messages from userspace.

I've also added a test case that exercises this functionality.

Fixes #2311

@hawkw hawkw requested a review from cbiffle December 3, 2025 19:53
@hawkw hawkw force-pushed the eliza/read-panic-message branch 2 times, most recently from c4ca702 to 2c80a58 Compare December 3, 2025 19:56
Currently, there is no way to programmatically access the panic message
of a task which has faulted due to a Rust panic fron within the Hubris
userspace. This branch adds a new `read_panic_message` kipc that copies
the contents of a panicked task's panic message buffer into the caller.
If the requested task has not panicked, this kipc returns an error
indicating this. This is intended by use by supervisor implementations
or other tasks which wish to report panic messages from userspace.

I've also added a test case that exercises this functionality.

Fixes #2311
@hawkw hawkw force-pushed the eliza/read-panic-message branch from 2c80a58 to 5ba535a Compare December 3, 2025 20:27
Comment on lines 522 to 526
if index >= tasks.len() {
return Err(UserError::Unrecoverable(FaultInfo::SyscallUsage(
UsageError::TaskOutOfRange,
)));
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly, something like

Suggested change
if index >= tasks.len() {
return Err(UserError::Unrecoverable(FaultInfo::SyscallUsage(
UsageError::TaskOutOfRange,
)));
}
let Some(task) = tasks.get(index) else {
return Err(UserError::Unrecoverable(FaultInfo::SyscallUsage(
UsageError::TaskOutOfRange,
)));
};

(then use task below instead of indexing repeatedly)

Co-authored-by: Matt Keeter <matt@oxide.computer>
@hawkw hawkw added kernel Relates to the Hubris kernel userlib Related to userlib, the fundamental library used by tasks fault-management Everything related to the Oxide's Fault Management architecture implementation labels Dec 4, 2025
@hawkw hawkw self-assigned this Dec 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fault-management Everything related to the Oxide's Fault Management architecture implementation kernel Relates to the Hubris kernel userlib Related to userlib, the fundamental library used by tasks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

want some kinda way for Jefe to actually know things about panic messages

4 participants