Bug 199443 - bzip never closes stdin/stdout
Summary: bzip never closes stdin/stdout
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 10.1-STABLE
Hardware: Any Any
: --- Affects Some People
Assignee: Dmitry Marakasov
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2015-04-14 12:12 UTC by vidwer+fbsdbugs
Modified: 2017-01-13 10:29 UTC (History)
3 users (show)

See Also:


Attachments
downstream patch for bzip to correct stdin/stdout behaviour (278 bytes, patch)
2015-04-14 12:12 UTC, vidwer+fbsdbugs
no flags Details | Diff
My version of patch (1.37 KB, patch)
2015-04-16 10:32 UTC, Dmitry Marakasov
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description vidwer+fbsdbugs 2015-04-14 12:12:19 UTC
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 ).
Comment 1 Dmitry Marakasov freebsd_committer freebsd_triage 2015-04-16 10:31:35 UTC
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.
Comment 2 Dmitry Marakasov freebsd_committer freebsd_triage 2015-04-16 10:32:05 UTC
Created attachment 155641 [details]
My version of patch
Comment 3 vidwer+fbsdbugs 2015-04-29 23:40:04 UTC
(In reply to Dmitry Marakasov from comment #1)

Have you tried jseward at acm.org?
Comment 4 Dmitry Marakasov freebsd_committer freebsd_triage 2015-05-09 02:16:33 UTC
Just sent email there as well.
Comment 5 Dmitry Marakasov freebsd_committer freebsd_triage 2015-05-29 23:10:50 UTC
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.
Comment 6 Xin LI freebsd_committer freebsd_triage 2015-10-15 19:10:52 UTC
(In reply to Dmitry Marakasov from comment #5)
Do you have any further update for this one?
Comment 7 Dmitry Marakasov freebsd_committer freebsd_triage 2015-10-16 09:26:34 UTC
No, author is terribly unresponsive. I'll ping him again.
Comment 8 Dmitry Marakasov freebsd_committer freebsd_triage 2016-12-27 15:32:06 UTC
I've given up on contacting the author and am pushing this to HEAD.

https://reviews.freebsd.org/D8924
Comment 9 Dmitry Marakasov freebsd_committer freebsd_triage 2016-12-28 18:04:36 UTC
The fix is committed to HEAD. Will close this after MFHs.
Comment 10 commit-hook freebsd_committer freebsd_triage 2016-12-28 18:05:22 UTC
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
Comment 11 commit-hook freebsd_committer freebsd_triage 2017-01-13 10:28:56 UTC
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
Comment 12 commit-hook freebsd_committer freebsd_triage 2017-01-13 10:28:59 UTC
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
Comment 13 Dmitry Marakasov freebsd_committer freebsd_triage 2017-01-13 10:29:27 UTC
Merged to stable/10 and stable/11