Created attachment 155588 [details] downstream patch for bzip to correct stdin/stdout behaviour This command, for example, never finishes: bzip2 --version > bar The problem has been reported to the author ( julian@bzip.org ).
For the note, I've written upstream (julian@bzip.org) twice, no reply yet. And I'd really like to reconcile this with upstream before changing bzip2 behaviour in FreeBSD.
Created attachment 155641 [details] My version of patch
(In reply to Dmitry Marakasov from comment #1) Have you tried jseward at acm.org?
Just sent email there as well.
I've got a reply from Julian. He says that there's no new bzip2 release planned soon, but this problem should be fixed, but nothing specific, so I've asked if this patch is officially approved. If it is, I guess we can merge it as well.
(In reply to Dmitry Marakasov from comment #5) Do you have any further update for this one?
No, author is terribly unresponsive. I'll ping him again.
I've given up on contacting the author and am pushing this to HEAD. https://reviews.freebsd.org/D8924
The fix is committed to HEAD. Will close this after MFHs.
A commit references this bug: Author: amdmi3 Date: Wed Dec 28 18:04:18 UTC 2016 New revision: 310718 URL: https://svnweb.freebsd.org/changeset/base/310718 Log: bzip2 does not exit after showing license as requested with --version or --license as most apps would do, instead it waits for data to compress on stdin. Because of that, if `bzip2 --version' is called, bogus `bzip2: I won't write compressed data to a terminal' error message will be displayed, and checking for bzip2 version in scripts as in bzip2 --version 2>&1 | grep -o "Version [^,]*" will hand as bzip2 would wait for data to compress on stdin. Fix this by exiting right after showing version/license text. I've tried to push this upstream for more than a year, but author is unresponsive, so upstream may be considered dead. Ubuntu applies similar fix, for the note. PR: 199443 Approved by: dim, bapt MFC after: 2 weeks Differential Revision: D8924 Changes: head/contrib/bzip2/bzip2.c
A commit references this bug: Author: amdmi3 Date: Fri Jan 13 10:28:24 UTC 2017 New revision: 312061 URL: https://svnweb.freebsd.org/changeset/base/312061 Log: MFC r310718: bzip2 does not exit after showing license as requested with --version or --license as most apps would do, instead it waits for data to compress on stdin. Because of that, if `bzip2 --version' is called, bogus `bzip2: I won't write compressed data to a terminal' error message will be displayed, and checking for bzip2 version in scripts as in bzip2 --version 2>&1 | grep -o "Version [^,]*" will hand as bzip2 would wait for data to compress on stdin. Fix this by exiting right after showing version/license text. I've tried to push this upstream for more than a year, but author is unresponsive, so upstream may be considered dead. Ubuntu applies similar fix, for the note. PR: 199443 Approved by: dim, bapt Differential Revision: D8924 Changes: _U stable/10/ stable/10/contrib/bzip2/bzip2.c
A commit references this bug: Author: amdmi3 Date: Fri Jan 13 10:28:26 UTC 2017 New revision: 312062 URL: https://svnweb.freebsd.org/changeset/base/312062 Log: MFC r310718: bzip2 does not exit after showing license as requested with --version or --license as most apps would do, instead it waits for data to compress on stdin. Because of that, if `bzip2 --version' is called, bogus `bzip2: I won't write compressed data to a terminal' error message will be displayed, and checking for bzip2 version in scripts as in bzip2 --version 2>&1 | grep -o "Version [^,]*" will hand as bzip2 would wait for data to compress on stdin. Fix this by exiting right after showing version/license text. I've tried to push this upstream for more than a year, but author is unresponsive, so upstream may be considered dead. Ubuntu applies similar fix, for the note. PR: 199443 Approved by: dim, bapt Differential Revision: D8924 Changes: _U stable/11/ stable/11/contrib/bzip2/bzip2.c
Merged to stable/10 and stable/11