[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#761423: busybox: using find in pipe with dd produce semi-random output



Sorry I see I've missed a `touch /test/.x` in the bugreport.

The test case is really simple:

    % busybox sh
    
    BusyBox v1.22.1 (Debian 1:1.22.0-8) built-in shell (ash)
    Enter 'help' for a list of built-in commands.
    
    ~ $ mkdir /tmp/emptytest
    ~ $ touch /tmp/emptytest/.x
    ~ $ find /tmp/emptytest/ -name "*?" | dd count=1 2>/dev/null
    /tmp/emptytest/
    ~ $ find /tmp/emptytest/ -name "*?" | dd count=1 2>/dev/null 
    /tmp/emptytest/
    ~ $ find /tmp/emptytest/ -name "*?" | dd count=1 2>/dev/null 
    /tmp/emptytest/
    /tmp/emptytest/.x
    ~ $ find /tmp/emptytest/ -name "*?" | dd count=1 2>/dev/null 
    /tmp/emptytest/
    ~ $ find /tmp/emptytest/ -name "*?" | dd count=1 2>/dev/null 
    /tmp/emptytest/
    /tmp/emptytest/.x
    ~ $ find /tmp/emptytest/ -name "*?" | dd count=1 2>/dev/null 
    /tmp/emptytest/
    ~ $ find /tmp/emptytest/ -name "*?" | dd count=1 2>/dev/null 
    /tmp/emptytest/
    /tmp/emptytest/.x
    
The output should be always:

    /tmp/emptytest/
    /tmp/emptytest/.x
    
Assuming dd block size default to 512.

Notice that omitting count or in pipe with cat it work properly.

I guess something wrong on how dd close the pipe or find handle
broken pipes.


Reply to: