{"record":{"id":"589b95a405346a5e","repo":"firecracker-microvm/firecracker","slug":"caddr-should-be-within-the-region","errorCode":null,"errorMessage":"caddr should be within the region","messagePattern":"caddr should be within the region","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/vmm/src/vstate/memory.rs","lineNumber":610,"sourceCode":"            slot_size,\n            region_type: state.region_type,\n            slot_from,\n            plugged: Mutex::new(BitVec::from_iter(state.plugged.iter())),\n        })\n    }\n\n    /// Check whether the given guest address range falls within plugged slots.\n    pub(crate) fn check_range_plugged(\n        &self,\n        caddr: MemoryRegionAddress,\n        len: usize,\n    ) -> Result<(), GuestMemoryError> {\n        // caddr is guaranteed to be within the region by the caller\n        // (try_for_each_region_in_range validates this).\n        let from = self\n            .start_addr()\n            .checked_add(caddr.raw_value())\n            .expect(\"caddr should be within the region\");\n        if self\n            .slots_intersecting_range(from, len)\n            .any(|(_, plugged)| !plugged)\n        {\n            return Err(GuestMemoryError::HostAddressNotAvailable);\n        }\n        Ok(())\n    }\n\n    pub(crate) fn slot_cnt(&self) -> u32 {\n        u32::try_from(u64_to_usize(self.len()) / self.slot_size).unwrap()\n    }\n\n    pub(crate) fn mem_slot(&self, slot: u32) -> GuestMemorySlot<'_> {\n        assert!(slot >= self.slot_from && slot < self.slot_from + self.slot_cnt());\n\n        let offset = ((slot - self.slot_from) as u64) * (self.slot_size as u64);\n","sourceCodeStart":592,"sourceCodeEnd":628,"githubUrl":"https://github.com/firecracker-microvm/firecracker/blob/9384f395f5d47f05b68a657525e209f8aa9c8264/src/vmm/src/vstate/memory.rs#L592-L628","documentation":"Error \"caddr should be within the region\" thrown in firecracker-microvm/firecracker.","triggerScenarios":"Thrown at src/vmm/src/vstate/memory.rs:610 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the guest physical address being accessed lies within the memory region it is looked up in.","Validate addresses from the guest before translating them to host addresses."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9384f395f5d47f05b68a657525e209f8aa9c8264","analyzedAt":"2026-08-19T05:27:02.517Z","contentChangedAt":"2026-08-19T05:27:02.517Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}