fix(ci): correct EXCEPTION_POINTERS pointer kind and ExceptionCode cast in crashlog #4

Closed
HexC0d3rz wants to merge 1 commit from fix/ci-crashlog-exception-type into main
HexC0d3rz commented 2026-06-16 10:04:52 -04:00 (Migrated from github.com)

Summary

Restores the Windows CI Test job, which has been failing repeatedly on main with two compile errors in crates/zeno-agent/src/crashlog.rs:

  • E0308 at line 97: SetUnhandledExceptionFilter(Some(handler))LPTOP_LEVEL_EXCEPTION_FILTER expects a function pointer with *const EXCEPTION_POINTERS, but our handler was declared with *mut.
  • E0610 at line 108: record.ExceptionCode.0 as u32ExceptionCode is a type alias for i32 (NTSTATUS), not a tuple struct, so .0 is illegal.

Evidence

Last failed run: https://github.com/HexC0d3rz/zeno-rmm/actions/runs/27619667030 (job: Test, conclusion: failure)

The same error has caused at least 7 consecutive Test job failures across multiple pushes to main (runs #125, #128, #130, #135, #136, #137, #138).

Fix

  1. Change handler signature to *const EXCEPTION_POINTERS (matches LPTOP_LEVEL_EXCEPTION_FILTER definition in windows-sys 0.61).
  2. Cast ExceptionCode directly to u32 (it is pub type NTSTATUS = i32).
  3. Wrap the two as_ref() calls in unsafe { } blocks since the compiler now requires them in an unsafe extern fn.

Test Plan

  • cargo check --workspace --all-targets passes locally (Linux target; Windows-only code is #[cfg(windows)]).
  • CI Test job on this PR is green.
  • No clippy regressions.

@HexC0d3rz — please merge to unblock the queue (3 runs currently queued behind the broken in_progress #138 on the self-hosted runner).

## Summary Restores the Windows CI Test job, which has been failing repeatedly on main with two compile errors in `crates/zeno-agent/src/crashlog.rs`: - **E0308** at line 97: `SetUnhandledExceptionFilter(Some(handler))` — `LPTOP_LEVEL_EXCEPTION_FILTER` expects a function pointer with `*const EXCEPTION_POINTERS`, but our handler was declared with `*mut`. - **E0610** at line 108: `record.ExceptionCode.0 as u32` — `ExceptionCode` is a type alias for `i32` (`NTSTATUS`), not a tuple struct, so `.0` is illegal. ## Evidence Last failed run: https://github.com/HexC0d3rz/zeno-rmm/actions/runs/27619667030 (job: Test, conclusion: failure) The same error has caused at least 7 consecutive Test job failures across multiple pushes to main (runs #125, #128, #130, #135, #136, #137, #138). ## Fix 1. Change handler signature to `*const EXCEPTION_POINTERS` (matches `LPTOP_LEVEL_EXCEPTION_FILTER` definition in `windows-sys 0.61`). 2. Cast `ExceptionCode` directly to `u32` (it is `pub type NTSTATUS = i32`). 3. Wrap the two `as_ref()` calls in `unsafe { }` blocks since the compiler now requires them in an `unsafe extern` fn. ## Test Plan - [x] `cargo check --workspace --all-targets` passes locally (Linux target; Windows-only code is `#[cfg(windows)]`). - [ ] CI Test job on this PR is green. - [ ] No clippy regressions. @HexC0d3rz — please merge to unblock the queue (3 runs currently queued behind the broken in_progress #138 on the self-hosted runner).
HexC0d3rz commented 2026-06-16 16:27:24 -04:00 (Migrated from github.com)

Superseded by #6. PR #4 contained only the crashlog EXCEPTION_POINTERS/ExceptionCode fix, but on its own it was blocked by the -D warnings dead-code errors in crates/zeno-installer/src/payload.rs and crates/zeno-server/src/state.rs that this branch inherits from main. #6 merges both the crashlog fix and the dead-code #[allow(dead_code)] attributes from #5 into a single branch, so all CI checks can pass together. Closing in favor of #6.

Superseded by #6. PR #4 contained only the crashlog `EXCEPTION_POINTERS`/`ExceptionCode` fix, but on its own it was blocked by the `-D warnings` dead-code errors in `crates/zeno-installer/src/payload.rs` and `crates/zeno-server/src/state.rs` that this branch inherits from `main`. #6 merges both the crashlog fix and the dead-code `#[allow(dead_code)]` attributes from #5 into a single branch, so all CI checks can pass together. Closing in favor of #6.

Pull request closed

Sign in to join this conversation.
No description provided.