diff --git a/src/memory/mod.rs b/src/memory/mod.rs index 39891bc9fb..935940d487 100644 --- a/src/memory/mod.rs +++ b/src/memory/mod.rs @@ -1235,9 +1235,21 @@ pub fn page_fault_handler( let mut token = unsafe { CleanLockToken::new() }; match context::memory::try_correcting_page_tables(faulting_page, mode, &mut token) { Ok(()) => return Ok(()), - Err(PfError::Oom) => todo!("oom"), + Err(PfError::Oom) => { + // Kernel could not allocate a frame to correct the fault. + // Linux would invoke the OOM killer here; Red Bear does not + // yet have one. Deliver SIGSEGV to the faulting process + // rather than panicking the kernel (the previous todo!() + // was a boot-time bomb on memory-pressure systems). + warn!("memory: OOM during page fault correction, delivering SIGSEGV"); + } Err(PfError::Segv | PfError::RecursionLimitExceeded) => (), - Err(PfError::NonfatalInternalError) => todo!(), + Err(PfError::NonfatalInternalError) => { + // Internal consistency issue inside try_correcting_page_tables. + // The name says nonfatal — log and deliver SIGSEGV rather + // than panicking the kernel. + warn!("memory: nonfatal internal error during page fault correction, delivering SIGSEGV"); + } } }