{"record":{"id":"7ffcd71c2211d474","repo":"firecracker-microvm/firecracker","slug":"slot-range-should-be-valid","errorCode":null,"errorMessage":"slot range should be valid","messagePattern":"slot range should be valid","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/vmm/src/vstate/memory.rs","lineNumber":635,"sourceCode":"        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\n        GuestMemorySlot {\n            slot,\n            guest_addr: self.start_addr().unchecked_add(offset),\n            slice: self\n                .inner\n                .get_slice(MemoryRegionAddress(offset), self.slot_size)\n                .expect(\"slot range should be valid\"),\n        }\n    }\n\n    /// Returns a snapshot of the slots and their state at the time of calling\n    ///\n    /// Note: to avoid TOCTOU races use only within VMM thread.\n    pub(crate) fn slots(&self) -> impl Iterator<Item = (GuestMemorySlot<'_>, bool)> {\n        self.plugged\n            .lock()\n            .unwrap()\n            .iter()\n            .enumerate()\n            .map(|(i, b)| {\n                (\n                    self.mem_slot(self.slot_from + u32::try_from(i).unwrap()),\n                    *b,\n                )\n            })","sourceCodeStart":617,"sourceCodeEnd":653,"githubUrl":"https://github.com/firecracker-microvm/firecracker/blob/9384f395f5d47f05b68a657525e209f8aa9c8264/src/vmm/src/vstate/memory.rs#L617-L653","documentation":"Error \"slot range should be valid\" thrown in firecracker-microvm/firecracker.","triggerScenarios":"Thrown at src/vmm/src/vstate/memory.rs:635 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the memory slot's guest range is valid and backed by the region before registering it with KVM.","Check the memory-region construction for overlapping or empty slot ranges."],"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-14T00:17:10.932Z"}