You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
uutils: both lines arrive together after 1s.
GNU 9.12: first arrives immediately, second 1s later.
Same with -o0.
GNU test: bash util/build-gnu.sh && bash util/run-gnu-test.sh tests/misc/stdbuf.sh
It is listed in ignore-intermittent.txt, but it failed in all of the last 40 GnuTests runs.
I looked into this one. Two things hold the first line back. uniq writes through its own BufWriter, and libstdbuf only changes C stdio, so -oL and -o0 never reach it. And uniq only prints a group's line once the next group starts.
I agree the first part shouldn't be a uniq-only fix. stdbuf already passes the mode in _STDBUF_O, so a small uucore helper could give utils a stdout writer that flushes per line, or doesn't buffer when it's L or 0. uniq and cut (#11581) could use it first. The second part is uniq-specific and small.
Would that direction be OK? If so I can open a PR with the helper plus the uniq change.
Personally, I don't wan't to consider LD_PRELOAD things as a bug because this means we restrict API to imprement our tools.
But _STDBUF_* parser is interesting for static binaries, Window and wasi*.
Activity
oech3 commentedon Nov 17, 2026
I don't think that this should be good 1st issue sice we need some hack to fix this and not
uniqspecific things.VanshajPoonia commentedon Nov 18, 2026
I looked into this one. Two things hold the first line back. uniq writes through its own BufWriter, and libstdbuf only changes C stdio, so
-oLand-o0never reach it. And uniq only prints a group's line once the next group starts.I agree the first part shouldn't be a uniq-only fix. stdbuf already passes the mode in
_STDBUF_O, so a small uucore helper could give utils a stdout writer that flushes per line, or doesn't buffer when it'sLor0. uniq and cut (#11581) could use it first. The second part is uniq-specific and small.Would that direction be OK? If so I can open a PR with the helper plus the uniq change.
oech3 commentedon Nov 18, 2026
@anastygnome Is already working on this e.g. #16088
Personally, I don't wan't to consider
LD_PRELOADthings as a bug because this means we restrict API to imprement our tools.But
_STDBUF_*parser is interesting for static binaries, Window and wasi*.