Skip to content

fix(runc-shim): support realtime signals for exec processes - #491

Open
immanuwell wants to merge 1 commit into
containerd:mainfrom
immanuwell:fix-runc-shim-realtime-signals
Open

fix(runc-shim): support realtime signals for exec processes#491
immanuwell wants to merge 1 commit into
containerd:mainfrom
immanuwell:fix-runc-shim-realtime-signals

Conversation

@immanuwell

@immanuwell immanuwell commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Exec kills panic for Linux realtime signals because nix::Signal rejects them.
Use libc::kill so the kernel validates raw signal values.
Also, this matches the Go runc shim

Repro:

cargo build -p containerd-runc-shim --bin containerd-shim-runc-v2-rs
sudo ctr images pull docker.io/library/alpine:3.22
sudo ctr run --runtime "$PWD/target/debug/containerd-shim-runc-v2-rs" --null-io --detach docker.io/library/alpine:3.22 rt-signal sleep 300
sudo ctr tasks exec --exec-id sleeper --detach rt-signal sleep 300
sudo ctr tasks kill --exec-id sleeper --signal 34 rt-signal

34 is SIGRTMIN on x86_64 Linux.
Added a regression test too

Signed-off-by: immanuwell <pchpr.00@list.ru>
@github-actions github-actions Bot added the C-runc-shim Runc shim label Aug 30, 2026
@mxpv
mxpv requested a balanced review from Copilot August 30, 2026 17:08
@mxpv

mxpv commented Aug 30, 2026

Copy link
Copy Markdown
Member

Needs import cleanup:

error: unused import: `Command as StdCommand`
   --> crates/runc-shim/src/runc.rs:851:19
    |
851 |         process::{Command as StdCommand, ExitStatus},
    |                   ^^^^^^^^^^^^^^^^^^^^^
    |
    = note: `-D unused-imports` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(unused_imports)]`

error: unused import: `super::signal_process`
   --> crates/runc-shim/src/runc.rs:858:9
    |
858 |     use super::signal_process;
    |         ^^^^^^^^^^^^^^^^^^^^^

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates exec-process signaling to support Linux realtime signals.

Changes:

  • Replaces nix::Signal conversion with raw libc::kill.
  • Adds a realtime-signal regression test.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +848 to +852
use std::{
os::unix::process::ExitStatusExt,
path::Path,
process::{Command as StdCommand, ExitStatus},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-runc-shim Runc shim

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants