coreutils icon indicating copy to clipboard operation
coreutils copied to clipboard

stdbuf: use exec instead of forking

Open Ecordonnier opened this issue 1 month ago • 15 comments

forking creates a new PID and it not compatible with GNU coreutils implementation.

  • use Command::exec() instead of Command::spawn() which forks
  • add stdbuf test verifying that no forking happens

Fixes https://github.com/uutils/coreutils/issues/9066

Ecordonnier avatar Nov 26 '25 23:11 Ecordonnier

GNU testsuite comparison:

Skipping an intermittent issue tests/tail/overlay-headers (passes in this run but fails in the 'main' branch)

github-actions[bot] avatar Nov 26 '25 23:11 github-actions[bot]

The CI errors are unrelated to my branch.

Ecordonnier avatar Nov 27 '25 16:11 Ecordonnier

The CI err is coming from https://github.com/uutils/coreutils/pull/9471

oech3 avatar Nov 28 '25 15:11 oech3

GNU testsuite comparison:

Skip an intermittent issue tests/tail/overlay-headers (fails in this run but passes in the 'main' branch)

github-actions[bot] avatar Dec 01 '25 13:12 github-actions[bot]

CodSpeed Performance Report

Merging #9495 will not alter performance

Comparing Ecordonnier:eco/stdbuf-exec-instead-of-fork (7963769) with main (2000af8)

Summary

✅ 127 untouched
⏩ 6 skipped[^skipped]

[^skipped]: 6 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

codspeed-hq[bot] avatar Dec 03 '25 13:12 codspeed-hq[bot]

GNU testsuite comparison:

Skip an intermittent issue tests/tail/overlay-headers (fails in this run but passes in the 'main' branch)

github-actions[bot] avatar Dec 03 '25 13:12 github-actions[bot]

GNU testsuite comparison:

Skip an intermittent issue tests/tail/overlay-headers (fails in this run but passes in the 'main' branch)

github-actions[bot] avatar Dec 03 '25 13:12 github-actions[bot]

This is ready for review. I don't intend to work on this branch any more.

Ecordonnier avatar Dec 03 '25 14:12 Ecordonnier

I've just seen https://github.com/uutils/coreutils/pull/9013#issuecomment-3446625332 which is also relevant for my PR. I'll check if Command::exec() can be used instead of Command::status().

Ecordonnier avatar Dec 09 '25 00:12 Ecordonnier

GNU testsuite comparison:

Skip an intermittent issue tests/timeout/timeout (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/tail/overlay-headers (passes in this run but fails in the 'main' branch)

github-actions[bot] avatar Dec 09 '25 10:12 github-actions[bot]

GNU testsuite comparison:

Skipping an intermittent issue tests/tail/overlay-headers (passes in this run but fails in the 'main' branch)

github-actions[bot] avatar Dec 09 '25 11:12 github-actions[bot]

The PR is ready for review.

Ecordonnier avatar Dec 09 '25 12:12 Ecordonnier

GNU testsuite comparison:

Skip an intermittent issue tests/tail/overlay-headers (fails in this run but passes in the 'main' branch)

github-actions[bot] avatar Dec 09 '25 21:12 github-actions[bot]

GNU testsuite comparison:

Skip an intermittent issue tests/tail/overlay-headers (fails in this run but passes in the 'main' branch)

github-actions[bot] avatar Dec 09 '25 21:12 github-actions[bot]

GNU testsuite comparison:

Skipping an intermittent issue tests/tail/overlay-headers (passes in this run but fails in the 'main' branch)

github-actions[bot] avatar Dec 10 '25 10:12 github-actions[bot]

GNU testsuite comparison:

Skipping an intermittent issue tests/tail/overlay-headers (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/tail/inotify-dir-recreate is now passing!

github-actions[bot] avatar Dec 17 '25 09:12 github-actions[bot]