Pádraig Brady <[email protected]> writes:
> The last case is what worries me.
> The failure isn't diagnosed. Also SIGPIPE is common and usually not diagnosed.
> Whether 2 or 3 occurs depends on how much is written to the failed
> compressors.
> I can trigger 3. 100% of the time here without valgrind
> by increasing the buffer size (amount written) to 100K.
>
> Consider for example:
>
> $ printf '%s\n' '#!/bin/sh' 'exit 1' > exit1 && chmod a+x exit1
> $ src/sort -S 100K --compress-program=./exit1 Makefile | head -n1
> $ echo $?
> 0
>
> No diagnostics or failure code etc.
> We'll need to address that.
FWIW it doesn't seem like this is a new bug:
$ /bin/sort --version | head -n 1
sort (GNU coreutils) 9.6
$ /bin/sort -S 100K --compress-program=./exit1 Makefile
sort: './exit1' [-d] terminated abnormally
$ /bin/sort -S 100K --compress-program=./exit1 Makefile
sort: './exit1' [-d] terminated abnormally
$ /bin/sort -S 100K --compress-program=./exit1 Makefile
$ /bin/sort -S 100K --compress-program=./exit1 Makefile
$ /bin/sort -S 100K --compress-program=./exit1 Makefile
So, on the bright side it seems my patch lets us consistently have the
wrong behavior?
Collin