Bug 1614162
| Summary: | fix-info-dir hangs when installing to a chroot | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Daniel Mach <dmach> |
| Component: | texinfo | Assignee: | Jason Tibbitts <j> |
| Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 29 | CC: | kasal, kevin, novyjindrich, otaylor, pertusus, pmatilai, vcrhonek |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | texinfo-6.5-11.fc29 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2018-10-08 19:04:29 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Daniel Mach
2018-08-09 06:18:00 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 29 development cycle. Changing version to '29'. Not sure if it's related, but I hit another problem with texinfo: install-info: No such file or directory for /dev/null The message is probably expected, because there's not /dev mounted in the chroot. The completely empty chroot might be an important detail to reproduce the originally reported issue. Ran into this, and while I couldn't a consistent reproducer, it's pretty clear what is going on:
%transfiletriggerin -n info -- %{_infodir}
[ -f %{_infodir}/dir ] && create_arg="" || create_arg="--create"
%{_sbindir}/fix-info-dir $create_arg %{_infodir}/dir &>/dev/null
And 'fix-info-dir --create %{_infodir}' uses /dev/null as the "skeleton", assuming that it will act like an empty file. So the script is being run output'ing to /dev/null and also reading from /dev/null, and if the stars/buffering align wrong, it's going to read what it's writing and go into an infinite loop.
I think there's two possible responses:
- Say that someone setting up an install root needs to make sure there's a real /dev/null in it. Many scripts count on output to /dev/null
- Make the script not to rely on reading from /dev/null
(In reply to Owen Taylor from comment #3) > Ran into this, and while I couldn't a consistent reproducer... This seems to be reliable reproducer: # dnf --installroot=/tmp/foo --disablerepo='*' --releasever=29 --nogpgcheck --repofrompath=_rawhide,http://download.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/ install mrtg And then it can be reproduced again (after you kill the first infinite loop) if you chroot into /tmp/foo then and re-run the script: # /bin/sh /usr/sbin/fix-info-dir --create /usr/share/info/dir We are hitting this in composes now too... oddly only on armv7 / s390x builders, so I suspect there might be some race also? It seems to be because the script reads from /dev/null, and the transfiletriggerin redirects its output to /dev/null, so it gets in a loop when /dev/null doesn't exist. Been looking at the same problem breaking the rawhide appliance composes; they don't have a /dev set up so the thing ends up looping in exactly the same way. Note that it only loops if you redirect stderr to /dev/null.
While it's certainly reasonable to say that a proper /dev should be set up before running any RPM scriptlets, it takes all of two lines to make the script not expect to read from /dev/null. In order to make life easier for the releng folks who have been beating on this, I'm going to go ahead and push a patch to rawhide. I hope that doesn't upset anyone; if it does, I'll do the work to revert if it does. I have run this in the chroot above and verified that it both fails to infloop where the original would, and produces the same/correct output.
--- a/contrib/fix-info-dir
+++ b/contrib/fix-info-dir
@@ -123,6 +123,7 @@ if test "$CREATE_NODE"; then
fi
shift
else
+ SKIP_READ=yes
SKELETON=/dev/null
fi
@@ -187,7 +188,7 @@ DIR_FILE_END_OF_FILE
# Read one line from the file. This is so that we can echo lines with
# whitespace and quoted characters in them.
- while read fileline; do
+ while test -z "$SKIP_READ" && read fileline; do
# flag fancy features
if test ! -z "$echoline"; then # echo line
echo "$fileline"
Can we get a f29 update as well? This is hitting f29 composes also now... texinfo-6.5-11.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2018-d3e4a6577d texinfo-6.5-11.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-d3e4a6577d texinfo-6.5-11.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report. |