Skip to content

Allow vfork children to signal themselves - #1887

Merged
Weidong Cui (wdcui) merged 3 commits into
uliteboxfrom
wdcui/ulitebox/vfork-kill
Nov 15, 2026
Merged

Weidong Cui (wdcui) merged 3 commits into
uliteboxfrom
wdcui/ulitebox/vfork-kill

Conversation

@wdcui

@wdcui Weidong Cui (wdcui) commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

This PR lets vfork children signal themselves with kill, supporting Go's parent-death check without terminating the parent's runner. Signals use the child's identity and signal state; other targets return EINVAL. Pending signals survive execve with their process/thread direction, queue order, repeated real-time instances, and full siginfo preserved. Tests cover self-signalling, parent isolation, PID-namespace init rules, and signal preservation.

Weidong Cui (wdcui) and others added 3 commits November 15, 2026 13:05
A vfork child that called kill ended its parent's runner with status 127,
so Go's Pdeathsig check, kill(getpid(), sig), killed the parent. Allow kill
in the window for the child's own ID only: the signal goes to a new
process-directed queue of the child's, under the child's dispositions, mask
and init flag. Any other target would go to the broker as the parent's,
with the wrong sender and targets, so it fails with a logged EINVAL.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f5406de6-bab4-4f3b-b232-ae238032c2c2
A vfork child's pending signals were dropped when its new program started
in a fresh runner, while Linux keeps them across execve. Carry them in the
startup record and TaskParams as PendingSignalSets: the child's own
process-directed queue gives the process set, its private queue the
thread set, and signals that lost their siginfo stay without a sender.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f5406de6-bab4-4f3b-b232-ae238032c2c2
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 89392541-7702-4f61-8b24-b21189a90836
@wdcui Weidong Cui (wdcui) changed the title Support kill in vfork children Allow vfork children to signal themselves Nov 15, 2026
@wdcui
Weidong Cui (wdcui) marked this pull request as ready for review November 15, 2026 22:50
@wdcui
Weidong Cui (wdcui) added this pull request to the merge queue Nov 15, 2026
@github-actions

Copy link
Copy Markdown

🤖 SemverChecks 🤖 ⚠️ Potential breaking API changes detected ⚠️

Click for details
--- failure constructible_struct_adds_field: struct exhaustively constructible through public API adds field ---

Description:
A pub struct that could be exhaustively constructed with a literal using only public API has a new pub field, breaking existing exhaustive literals.
        ref: https://doc.rust-lang.org/reference/expressions/struct-expr.html
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.51.0/src/lints/constructible_struct_adds_field.ron

Failed in:
  field LinuxProgramStartup.pending_signals in /home/runner/work/litebox/litebox/litebox_common_linux/src/program_startup.rs:93
  field TaskParams.pending_signals in /home/runner/work/litebox/litebox/litebox_common_linux/src/lib.rs:1976

Merged via the queue into ulitebox with commit 7cf5807 Nov 15, 2026
13 checks passed
@wdcui
Weidong Cui (wdcui) deleted the wdcui/ulitebox/vfork-kill branch November 15, 2026 22:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant