{"record":{"id":"152768ae72a3a094","repo":"firecracker-microvm/firecracker","slug":"failed-to-register-vcpu-signal-handler","errorCode":null,"errorMessage":"Failed to register vcpu signal handler","messagePattern":"Failed to register vcpu signal handler","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/vmm/src/vstate/vcpu.rs","lineNumber":131,"sourceCode":"    /// The vCPU is executing guest code via `KVM_RUN`.\n    Running,\n    /// The vCPU is paused, waiting for events.\n    Paused,\n    /// The vCPU thread's run loop has finished; the thread will exit.\n    Finished,\n}\n\nimpl Vcpu {\n    /// Registers a signal handler which kicks the vcpu running on the current thread, if there is\n    /// one.\n    fn register_kick_signal_handler(&mut self) {\n        extern \"C\" fn handle_signal(_: c_int, _: *mut siginfo_t, _: *mut c_void) {\n            // We write to the immediate_exit from other thread, so make sure the read in the\n            // KVM_RUN sees the up to date value\n            fence(Ordering::Acquire);\n        }\n        register_signal_handler(sigrtmin() + VCPU_RTSIG_OFFSET, handle_signal)\n            .expect(\"Failed to register vcpu signal handler\");\n    }\n\n    /// Constructs a new VCPU for `vm`.\n    ///\n    /// # Arguments\n    ///\n    /// * `index` - Represents the 0-based CPU index between [0, max vcpus).\n    /// * `vm` - The vm to which this vcpu will get attached.\n    /// * `exit_evt` - An `EventFd` that will be written into when this vcpu exits.\n    pub fn new(index: u8, vm: &KvmVm, exit_evt: EventFd) -> Result<Self, VcpuError> {\n        let (event_sender, event_receiver) = channel();\n        let (response_sender, response_receiver) = channel();\n        let kvm_vcpu = KvmVcpu::new(index, vm).unwrap();\n\n        Ok(Vcpu {\n            exit_evt,\n            event_receiver,\n            event_sender: Some(event_sender),","sourceCodeStart":113,"sourceCodeEnd":149,"githubUrl":"https://github.com/firecracker-microvm/firecracker/blob/81b38b9dad6056d7a48073e95ac5a9aed51cb2ab/src/vmm/src/vstate/vcpu.rs#L113-L149","documentation":"Error \"Failed to register vcpu signal handler\" thrown in firecracker-microvm/firecracker.","triggerScenarios":"Thrown at src/vmm/src/vstate/vcpu.rs:131 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check that signal-handler registration is permitted (not blocked by seccomp or rlimit) before starting vCPUs.","Inspect the underlying OS error from sigaction for the precise cause."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"81b38b9dad6056d7a48073e95ac5a9aed51cb2ab","analyzedAt":"2026-08-19T05:27:02.517Z","contentChangedAt":"2026-08-19T05:27:02.517Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}