Bug 1732450 - util-linux: Double fclose in rev with file argument
Summary: util-linux: Double fclose in rev with file argument
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: util-linux
Version: 31
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Karel Zak
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 1732406
TreeView+ depends on / blocked
 
Reported: 2019-07-23 12:32 UTC by Florian Weimer
Modified: 2019-08-19 13:50 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-08-19 13:50:00 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github karelzak util-linux issues 807 0 None None None 2019-07-23 12:32:39 UTC
Sourceware 24677 0 None None None 2019-07-23 12:32:39 UTC

Description Florian Weimer 2019-07-23 12:32:39 UTC
With upstream master glibc,

$ rev /etc/password

aborts during cleanup, after printing all the output.  There is both a glibc bug and a util-linux bug here.

I reverted the upstream commit temporarily in rawhide (see bug 1732406), and I plan to fix util-linux in rawhide, so that we are ready for the full glibc fix in Fedora 31.

Comment 1 Florian Weimer 2019-07-23 12:39:24 UTC
Hmm.  It looks like that util-linux-2.34-1.fc31 already has the relevant upstream commit.  I thought that it would be sufficient to paper over both bugs (fixing the util-linux bug and obscuring the glibc bug).  But that does not appear to be the case.  I will have to create yet another glibc build with the upstream candidate fix present, to check that it is sufficient to fix the crash.

Let's hope that no further util-linux change is needed.

Comment 2 Karel Zak 2019-07-23 13:26:54 UTC
Yes, sounds like util-linux upstream issue: https://github.com/karelzak/util-linux/issues/807

Comment 3 Karel Zak 2019-07-23 13:33:00 UTC
Note that in util-linux we follow Jim Meyering's (~coreutils) idea about explicit close(stdout) to report I/O issues to users. For more details see
https://www.gnu.org/ghm/2011/paris/slides/jim-meyering-goodbye-world.pdf

Comment 4 Florian Weimer 2019-07-23 13:41:27 UTC
(In reply to Karel Zak from comment #3)
> Note that in util-linux we follow Jim Meyering's (~coreutils) idea about
> explicit close(stdout) to report I/O issues to users. For more details see
> https://www.gnu.org/ghm/2011/paris/slides/jim-meyering-goodbye-world.pdf

close_stdout is buggy, it should perform a dup3 followed by a close on the new handle, which is enough to check for the NFS flush.  See this gnulib discussion:

https://lists.gnu.org/r/bug-gnulib/2019-04/msg00059.html

Comment 5 Ben Cotton 2019-08-13 16:58:06 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 31 development cycle.
Changing version to '31'.

Comment 6 Ben Cotton 2019-08-13 18:57:25 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 31 development cycle.
Changing version to 31.

Comment 7 Florian Weimer 2019-08-19 13:50:00 UTC
Rawhide and Fedora 31 have been fixed.


Note You need to log in before you can comment on or make changes to this bug.