Skip to content

Releases: oskarirauta/process_cpp

v2.1.0

Choose a tag to compare

@github-actions github-actions released this 05 Jul 21:12
Release v2.1.0

feat: bounded execution — timeout, abort flag and output cap

Add opt-in bounds to process_t, configured before reading output:
- timeout(ms): wall-clock limit; kill the process on expiry
- abort_with(std::atomic<bool>*): kill when the flag becomes true
- max_output(bytes): cap captured stdout+stderr (keeps draining to avoid deadlock)
- timed_out() / aborted() / truncated(): outcome queries

The child now runs in its own process group, so a timeout/abort kills the whole
tree via killpg (SIGTERM, escalating to SIGKILL). collect() polls on a short
tick only when bounded; with no options set the behaviour is unchanged (blocks
and drains until the child exits).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Oskari Rauta <oskari.rauta@gmail.com>

v2.0.0

Choose a tag to compare

@github-actions github-actions released this 28 Jun 01:18
Release v2.0.0

Drain stdout/stderr eagerly to remove the pipe deadlock, and fix a
use-after-free in the variadic constructor.

- stdout and stderr were read lazily while status() (and the destructor,
  which calls status()) waited with waitpid(). A child that writes more
  than the pipe buffer (~64 KiB) blocks on write until a reader drains
  it, so waiting before reading deadlocked - and because ~process_t()
  waits, simply letting a large-output process go out of scope without
  reading it would hang. Add collect(): it closes our copy of the child's
  stdin and poll()s stdout and stderr together, draining both into
  buffers before any wait. str_out()/str_err()/status() all collect
  first, so reading, waiting and destruction can happen in any order.
- the c++20 variadic constructor built its argv from `arg.c_str()` where
  `arg` was a loop variable destroyed each iteration, so execvp() ran
  with dangling pointers. Keep the argument strings in an arg_storage
  member that the char* vector points into (both constructors).
- guard the dynamic_cast in PIPE(process_t*) so piping from a process
  with no input stream cannot dereference a null filebuffer.
- the uncallable second variadic constructor (a parameter pack followed
  by process_t* input cannot be deduced) is removed; input piping still
  works through the (cmd, args, input) constructor.

Example/build: delete the leaked process in example6 (valgrind is now
clean), `int main()`, and correct the README - process_cpp builds with
c++17, only the variadic string-argument constructor needs c++20.

Bump the throws submodule to v1.1.0 and refresh the GitHub Actions
(checkout@v5, create/upload actions @v2, push/pull_request triggers,
submodules in the release checkout).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Oskari Rauta <oskari.rauta@gmail.com>

v1.2.0

Choose a tag to compare

@github-actions github-actions released this 14 Apr 09:24
 - Updated Makefiles
 - throws_cpp submodule updated

Signed-off-by: Oskari Rauta <oskari.rauta@gmail.com>

v1.1.0

Choose a tag to compare

@github-actions github-actions released this 06 Apr 10:09
Release v1.1.0

This release makes minor changes to README.md only

Signed-off-by: Oskari Rauta <oskari.rauta@gmail.com>

v1.0.1

Choose a tag to compare

@github-actions github-actions released this 30 Jan 03:03
  • remove zombie processes on process_t destructor
  • Add section about zombie processes to documentation

v1.0.0

Choose a tag to compare

@github-actions github-actions released this 22 Jan 13:13
Initial release

Co-authored-by: Tero Saarni <tero.saarni@gmail.com>
Authored-by: Oskari Rauta <oskari.rauta@gmail.com>
Signed-off-by: Oskari Rauta <oskari.rauta@gmail.com>