Skip to content

Fixes #121: ignore EFI_DEVICE_ERROR in output_string #122

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

Merged
merged 3 commits into from
Feb 29, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/logger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,13 @@ impl<'boot> log::Log for Logger {
fn log(&self, record: &log::Record) {
if let Some(mut ptr) = self.writer {
let writer = unsafe { ptr.as_mut() };
DecoratedLog::write(writer, record.level(), record.args()).unwrap();
// FIXME: Some UEFI firmware implementations e.g. VrtualBox's implementation
// occasionally report a EFI_DEVICE_ERROR with some text dropped out within
// SimpleTextOutput protocol, which is a firmware bug. In that case, we will
// get a `fmt::Error` here. Since the `log` crate gives no other option to
// deal with output errors, we ignore the `Result` here to prevent potential
// panics from happening.
DecoratedLog::write(writer, record.level(), record.args()).unwrap_or_default();
}
}

Expand Down