Skip to content

run(..., std::ostream &, ...) with pipe #8650

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 3, 2025
Merged

run(..., std::ostream &, ...) with pipe #8650

merged 2 commits into from
Jun 3, 2025

Conversation

kroening
Copy link
Member

@kroening kroening commented Jun 2, 2025

run(...) has a variant that that accepts an std::ostream for the stdout redirection. This replaces the use of popen(...) in this variant by a standard combination of pipe/fork/exec.

The benefit is this change is that the use of a shell is avoided, which is difficult to secure owing to the parsing of the command by the shell.

  • Each commit message has a non-empty body, explaining why the change was made.
  • n/a Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • n/a 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.
  • n/a White-space or formatting changes outside the feature-related changed lines are in commits of their own.

run(...) has a variant that that accepts an std::ostream for the stdout
redirection.  This replaces the use of popen(...) in this variant by a
standard combination of pipe/fork/exec.

The benefit is this change is that the use of a shell is avoided, which is
difficult to secure owing to the parsing of the command by the shell.
Copy link

codecov bot commented Jun 2, 2025

Codecov Report

Attention: Patch coverage is 43.93939% with 37 lines in your changes missing coverage. Please review.

Project coverage is 80.36%. Comparing base (f1faa61) to head (c4a738b).
Report is 3 commits behind head on develop.

Files with missing lines Patch % Lines
src/util/run.cpp 43.93% 37 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #8650      +/-   ##
===========================================
- Coverage    80.37%   80.36%   -0.02%     
===========================================
  Files         1686     1686              
  Lines       206889   206938      +49     
  Branches        73       73              
===========================================
+ Hits        166289   166301      +12     
- Misses       40600    40637      +37     

☔ 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.

@tautschnig tautschnig merged commit beb96b9 into develop Jun 3, 2025
39 of 41 checks passed
@tautschnig tautschnig deleted the run-with-pipe branch June 3, 2025 11:04
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.

2 participants