coreutils icon indicating copy to clipboard operation
coreutils copied to clipboard

`dd` fails on `tests/dd/not-rewound.sh`

Open sylvestre opened this issue 3 years ago • 6 comments

With the test case, it show b - with gnu, it shows bde:

export C=./target/debug/coreutils
echo abcde > in
echo "bde" > ref
($C dd skip=1 count=1 bs=1; $C dd skip=1 bs=1) < in > out 2> /dev/null 
diff -u ref out

comment the first line to come back on GNU

To run it: bash util/run-gnu-test.sh tests/dd/not-rewound.sh

sylvestre avatar Jun 13 '22 19:06 sylvestre

@jfinkels rings a bell ?

sylvestre avatar Jun 13 '22 19:06 sylvestre

Yes! see https://github.com/uutils/coreutils/issues/3008#issuecomment-1028437526

jfinkels avatar Jun 14 '22 01:06 jfinkels

oh, thanks, it is a dup then :)

sylvestre avatar Jun 14 '22 07:06 sylvestre

Reopening as this seems to be broken still:

On GNU v8.30:

$ (dd skip=1 count=1 bs=1; dd skip=1 bs=1) < in > out 2> /dev/null && cat out
bde

On uutils dd (main branch, commit 0a385ee7a5297707045ad2f9c83f0b11df290e41)

$ (./target/release/dd skip=1 count=1 bs=1; ./target/release/dd skip=1 bs=1) < in > out 2> /dev/null && cat out
de

jfinkels avatar Nov 17 '23 01:11 jfinkels

Another clue here is that this works as expected if stdout is not redirected to a file:

$ (./target/release/dd skip=1 count=1 bs=1; ./target/release/dd skip=1 bs=1) < in 2> /dev/null
bde

jfinkels avatar Nov 17 '23 01:11 jfinkels

I think #4542 is getting at this issue.

jfinkels avatar Nov 27 '23 03:11 jfinkels