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

Abort PT trace decoding if the "taken" bug arises. #1562

Merged
merged 1 commit into from
Jan 24, 2025
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
13 changes: 9 additions & 4 deletions hwtracer/src/pt/ykpt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -447,11 +447,16 @@ impl YkPTBlockIterator<'_> {
// TNT buffer. The unwrap cannot fail because the above code ensures that `self.tnts`
// is not empty.
let taken = self.tnts.pop_front().unwrap();
// FIXME: If you re-enable compressed returns (in `collect.c`), once in a blue moon
// this assertion will fail.
// FIXME: Occasionally `taken` is `false` here, which indicates that something has gone
// wrong when decoding the PT trace (even with compressed returns disabled!).
//
// More info: https://github.com/ykjit/yk/issues/874
debug_assert!(taken);
// For now we abort decoding the trace, since we know (and have seen in the wild) that
// if you carry on you get all manner of crashes.
if !taken {
return Err(IteratorError::HWTracerError(HWTracerError::Unrecoverable(
"PT taken bug detected".to_string(),
)));
}
}

Ok(compressed)
Expand Down
Loading