Tidy-ups: replay event, timeline after end, VICTORY_WATCH, validator status

- Replay: a Worker closes its fence event when dropped (one leaked per
  256 MiB upload batch in diagnostics builds).
- Timeline: put_of and stack write nothing once recording has ended, so
  events that straddle end() no longer land in the next recording.
- VICTORY_WATCH: rva + 4 is checked, as VICTORY_CRASH_SAVE's ranges are
  (a huge RVA in the list wrapped instead of being dropped).
- Validator: a failed GetStatus is an error, not a pass, and an error blob
  with a null pointer reads as empty instead of building a slice from null.

Port of avatarmanz/VIctory-7900XTX#319 (its issue #227).

(cherry picked from commit 8db88ce6fe40cdd03bc9f9b66fb5d31c92bd246d)
This commit is contained in:
illuminatedfellow authored and trustno1-coder committed 2026-11-27 17:29:35 -08:00
1 parent 0dd34bdbe6
commit c12c4959a5
4 files changed
+28 -3

No files matched your search

+11 -2
View File
@@ -187,7 +187,11 @@ impl Validator {
let mut status = 0;
let get_status: unsafe extern "system" fn(Object, *mut Hresult) -> Hresult =
method(result, 3);
get_status(result, &mut status);
let got = get_status(result, &mut status);
if got < 0 {
release(result);
return Err(format!("GetStatus failed: {got:#x}"));
}
let mut text = String::new();
if status < 0 {
let mut errors: Object = std::ptr::null_mut();
@@ -196,7 +200,12 @@ impl Validator {
if get_errors(result, &mut errors) >= 0 && !errors.is_null() {
let ptr: unsafe extern "system" fn(Object) -> *const u8 = method(errors, 3);
let len: unsafe extern "system" fn(Object) -> usize = method(errors, 4);
let bytes = std::slice::from_raw_parts(ptr(errors), len(errors));
let (at, n) = (ptr(errors), len(errors));
let bytes: &[u8] = if at.is_null() {
&[]
} else {
std::slice::from_raw_parts(at, n)
};
text = String::from_utf8_lossy(bytes)
.trim_end_matches('\0')
.trim()