On Wed, Sep 13, 2017 at 01:40:11PM -0700, Vagrant Cascadian wrote:
> Source: qemu
> Version: 1:2.8+dfsg-7
> Severity: wishlist
> Tags: patch
> User: reproducible-bui...@lists.alioth.debian.org
> Usertags: randomness
> X-Debbugs-Cc: reproducible-b...@lists.alioth.debian.org
>
> While working on the Reproducible Builds effort [0], we noticed that
> qemu's documentation and manpages generates non-reproducible output,
> possibly based on which shell is set to /bin/sh and the handling of
> whitespace in the corresponding echo implementation[1].
>
> I believe the attached patch should resolve this issue by removing
> trailing whitespace from two lines in the file used to generate the
> documentation, though I haven't confirmed for sure.

Further investigation suggests it's the `read -r` uses in hxtool which
give different results under bash and dash:

> jrtc27@deb4g:~$ hexdump -C body
> 00000000  74 77 6f 20 20 20 77 6f  72 64 73 20 20 20 0a 6f  |two   words   .o|
> 00000010  6e 65 77 6f 72 64 20 20  20 0a                    |neword   .|
> 0000001a
> jrtc27@deb4g:~$ bash -c "while read -r str; do printf '%s\n' \"\$str\"; done 
> < body" | hexdump -C
> 00000000  74 77 6f 20 20 20 77 6f  72 64 73 0a 6f 6e 65 77  |two   words.onew|
> 00000010  6f 72 64 0a                                       |ord.|
> 00000014
> jrtc27@deb4g:~$ dash -c "while read -r str; do printf '%s\n' \"\$str\"; done 
> < body" | hexdump -C
> 00000000  74 77 6f 20 20 20 77 6f  72 64 73 20 20 20 0a 6f  |two   words   .o|
> 00000010  6e 65 77 6f 72 64 0a                              |neword.|
> 00000017

Having read the POSIX spec, and bash and dash manpages, I became
convinced this was a dash bug, and indeed there is already one reported:
#794965. Unfortunately it's 2 years old, and the upstream thread has
seen no activity since early 2016... Anyway, the trailing whitespace
should just be removed from the file, as it's clearly unwanted and
serving no purpose.

Regards,
James

Reply via email to