Skip to content

Prevent orphan child processes when CBMC parent is killed#8900

Draft
tautschnig wants to merge 1 commit intodiffblue:developfrom
tautschnig:fix-8485-orphan-process
Draft

Prevent orphan child processes when CBMC parent is killed#8900
tautschnig wants to merge 1 commit intodiffblue:developfrom
tautschnig:fix-8485-orphan-process

Conversation

@tautschnig
Copy link
Copy Markdown
Collaborator

Add prctl(PR_SET_PDEATHSIG, SIGTERM) in the child process fork path so the kernel sends SIGTERM to the child (e.g., z3) when the parent dies. This prevents orphan processes from persisting indefinitely after CBMC is killed with SIGKILL.

The prctl call is guarded by #ifdef linux since it is Linux-specific.

Fixes: #8485

  • Each commit message has a non-empty body, explaining why the change was made.
  • Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • White-space or formatting changes outside the feature-related changed lines are in commits of their own.

Add prctl(PR_SET_PDEATHSIG, SIGTERM) in the child process fork path so
the kernel sends SIGTERM to the child (e.g., z3) when the parent dies.
This prevents orphan processes from persisting indefinitely after CBMC
is killed with SIGKILL.

The prctl call is guarded by #ifdef __linux__ since it is Linux-specific.

Fixes: diffblue#8485
@tautschnig tautschnig self-assigned this Mar 27, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 27, 2026

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 80.41%. Comparing base (59d2211) to head (34dc275).

Files with missing lines Patch % Lines
src/util/piped_process.cpp 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #8900      +/-   ##
===========================================
- Coverage    80.41%   80.41%   -0.01%     
===========================================
  Files         1703     1703              
  Lines       188398   188399       +1     
  Branches        73       73              
===========================================
- Hits        151502   151499       -3     
- Misses       36896    36900       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

z3 process continues to run after CBMC process is terminated

1 participant