Skip to content

Conversation

@ryanbreen
Copy link
Owner

Summary

  • Fixes CI failure caused by double CR2 read in page fault handler
  • The first read on line 894 handles errors gracefully with unwrap_or()
  • The second read on line 923 used .expect() which panics when CR2::read() returns Err
  • Solution: Reuse the already-read cr2 value instead of reading it again

Root Cause

After the CoW fork merge (PR #79), CI was failing at [80/138] SIGTERM kill test with:

KERNEL PANIC: panicked at kernel/src/interrupts.rs:923:37

The panic was Cr2::read().expect("Failed to read accessed address from CR2").

Test plan

  • Local boot-stages test passes (138/138)
  • CI boot-stages test passes

🤖 Generated with Claude Code

The page fault handler was reading CR2 twice:
1. Line 894: Cr2::read().unwrap_or(...) - handles errors gracefully
2. Line 923: Cr2::read().expect(...) - panics on error

The second read is redundant and uses .expect() which causes panics
when CR2::read() returns Err. This was causing CI failures at
[80/138] SIGTERM kill test with KERNEL PANIC at interrupts.rs:923:37.

Fix: Reuse the cr2 value already read safely on line 894 by converting
it back to a VirtAddr instead of reading CR2 again.

Co-Authored-By: Ryan Breen <ryanbreen@gmail.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@ryanbreen ryanbreen merged commit 9e165dc into main Jan 11, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants