Description of problem: Mock builds that access /dev/tty no longer work, e.g. for reading gnupg pass phrases. I think this is a regression introduced by BUG609201, and mock changeset d250bd4ea6dfd8b34be567bcf7a14603476dc961. Version-Release number of selected component (if applicable): mock-1.1.8 How reproducible: Always Steps to Reproduce: 1. set up a mock chroot 2. set up a gpg keyring inside the chroot 3. copy an RPM file into the chroot 4. try to sign it with something like > rpm --define '_gpg_name xxxxxx' --addsign *.rpm Actual results: The rpm command hangs; the "enter pass phrase" prompt is never shown. Expected results: Access to /dev/tty should work just like outside the chroot, and the RPM signing command should work. Additional info: This used to work for prior versions of mock. I straced the command and I see that the rpm signing code is actually sending the "enter pass phrase" prompt, albeit to a FD that is not being monitored. If I revert the aforementioned change in the chroot, with # /bin/rm /dev/tty # /bin/mknod /dev/tty c 5 0 then the rpm --addsign command works again.
The failure of perl-Expect to build in the Fedora 15 mass rebuild also seems to be down to this problem: http://koji.fedoraproject.org/koji/taskinfo?taskID=2794455 http://koji.fedoraproject.org/koji/getfile?taskID=2796099&name=build.log A local mock build with 1.1.8 fails in the same way, but reverting the change d250bd4ea6dfd8b34be567bcf7a14603476dc961 results in a successful build as before.
Paul, After the revert, do you actually *have* /dev/tty in the chroot (and if so is it a special device file) or is it non-existant?
It's a char special device: $ ls -l /var/lib/mock/city-fan-rawhide-x86_64/root/dev total 64 crw-------. 1 root root 5, 1 Feb 14 15:45 console lrwxrwxrwx. 1 root root 13 Feb 14 15:45 fd -> /proc/self/fd crw-rw-rw-. 1 root root 1, 7 Feb 14 15:45 full crw-rw-rw-. 1 root root 1, 3 Feb 14 15:45 null lrwxrwxrwx. 1 root root 13 Feb 14 15:45 ptmx -> /dev/pts/ptmx drwxrwxr-x. 2 root root 4096 Feb 14 15:45 pts crw-rw-rw-. 1 root root 1, 8 Feb 14 15:45 random drwxrwxr-x. 2 root root 4096 Feb 14 15:45 shm lrwxrwxrwx. 1 root root 15 Feb 14 15:45 stderr -> /proc/self/fd/2 lrwxrwxrwx. 1 root root 15 Feb 14 15:45 stdin -> /proc/self/fd/0 lrwxrwxrwx. 1 root root 15 Feb 14 15:45 stdout -> /proc/self/fd/1 crw-rw-rw-. 1 root root 5, 0 Feb 14 15:46 tty cr--r--r--. 1 root root 1, 9 Feb 14 15:45 urandom crw-rw-rw-. 1 root root 1, 5 Feb 14 15:45 zero
In mock-1.1.9, we reverted the logic to create /dev/tty and /dev/ptmx inside the chroot /dev. This seems to have sidestepped the issue on many of our build failures (e.g. bash). Would you please try mock-1.1.9 and see if this change allows your build to complete? In the meantime I continue my research into what what we should have inside the chroot's /dev...
perl-TermReadKey builds OK but skips all tests due to missing /dev/tty. perl-Expect fails its test suite: Executing(%check): /bin/sh -e /var/tmp/rpm-tmp.OxFueA + umask 022 + cd /builddir/build/BUILD + cd Expect-1.21 + unset DISPLAY + /usr/bin/make test PERL_DL_NONLAZY=1 /usr/bin/perl "-Iblib/lib" "-Iblib/arch" test.pl pty_allocate(nonfatal): posix_openpt(): No such file or directory at /usr/lib/perl5/vendor_perl/IO/Pty.pm line 24. pty_allocate(nonfatal): getpt(): No such file or directory at /usr/lib/perl5/vendor_perl/IO/Pty.pm line 24. pty_allocate(nonfatal): openpty(): No such file or directory at /usr/lib/perl5/vendor_perl/IO/Pty.pm line 24. pty_allocate(nonfatal): open(/dev/ptmx): No such file or directory at /usr/lib/perl5/vendor_perl/IO/Pty.pm line 24. Cannot open a pty at test.pl line 34 1..42 Basic tests... make: *** [test_dynamic] Error 2 RPM build errors: error: Bad exit status from /var/tmp/rpm-tmp.OxFueA (%check) Bad exit status from /var/tmp/rpm-tmp.OxFueA (%check) Child returncode was: 1 This is with mock-1.1.9-1.fc14.
This package has changed ownership in the Fedora Package Database. Reassigning to the new owner of this component.
Another package that is now failing its test suite with mock 1.1.9 is libssh2: Executing(%check): /bin/sh -e /var/tmp/rpm-tmp.7sOoya + umask 022 + cd /builddir/build/BUILD + cd libssh2-1.2.7 + unset DISPLAY + cd tests + make check make simple make[1]: Entering directory `/builddir/build/BUILD/libssh2-1.2.7/tests' gcc -DHAVE_CONFIG_H -I. -I. -I../src -I../example -I../src -I../include -I../src -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c simple.c /bin/sh ../libtool --tag=CC --mode=link gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -o simple simple.o ../src/libssh2.la libtool: link: gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -o .libs/simple simple.o ../src/.libs/libssh2.so -Wl,-rpath -Wl,/usr/lib64 make[1]: Leaving directory `/builddir/build/BUILD/libssh2-1.2.7/tests' make check-TESTS make[1]: Entering directory `/builddir/build/BUILD/libssh2-1.2.7/tests' PASS: simple Failed requesting pty Fingerprint: 86 AD B2 21 33 60 65 3D 9A 29 86 DE 22 99 DA 18 CC BA D3 AC Authentication methods: publickey,password,keyboard-interactive Authentication by public key succeeded. FAIL: ssh2.sh =========================================== 1 of 2 tests failed Please report to libssh2-devel.se =========================================== make[1]: Leaving directory `/builddir/build/BUILD/libssh2-1.2.7/tests' make[1]: *** [check-TESTS] Error 1 make: *** [check-am] Error 2 "Failed requesting pty" points the finger at mock I think.
Yes, I agree. I've been poking at it a bit, looking at the perl-TermReadKey failure and when I attached gdb to a hung perl instance, it was stuck in tcsetattr(). So we've got something going wrong with our controlling tty setup. I'll post an email to the fedora-buildsys-list with a summary and my appeal for help in figuring out how we should setup /dev/tty and /dev/ptmx for all our supported build hosts.
I've made a set of changes to my local mock that I think will help this out. Basically I've changed how we enter the chroot. Previously we were calling os.setpgrp() before exec'ing rpmbuild. I've changed this to be a call to os.setsid() which means we start a new session and nuke the controlling tty. So rather than hanging, an open of /dev/tty should fail, since we have no controlling tty. I've successfully built perl-TermReadKey() and some others that were experiencing difficulties. Unless more problems come to light, I'll create a 1.1.10/1.0.17 build next week and push them up for testing.
mock-1.1.10-1.fc15 has been submitted as an update for Fedora 15. https://admin.fedoraproject.org/updates/mock-1.1.10-1.fc15
mock-1.1.10-1.fc14 has been submitted as an update for Fedora 14. https://admin.fedoraproject.org/updates/mock-1.1.10-1.fc14
mock-1.0.17-1.el5 has been submitted as an update for Fedora EPEL 5. https://admin.fedoraproject.org/updates/mock-1.0.17-1.el5
mock-1.1.10-1.fc13 has been submitted as an update for Fedora 13. https://admin.fedoraproject.org/updates/mock-1.1.10-1.fc13
mock-1.1.10-1.el6 has been submitted as an update for Fedora EPEL 6. https://admin.fedoraproject.org/updates/mock-1.1.10-1.el6
Package mock-1.1.10-1.el6: * should fix your issue, * was pushed to the Fedora EPEL 6 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=epel-testing mock-1.1.10-1.el6' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/mock-1.1.10-1.el6 then log in and leave karma (feedback).
mock-1.1.10-1.fc15 has been pushed to the Fedora 15 stable repository. If problems still persist, please make note of it in this bug report.
perl-Expect still fails its test suite with 1.1.10 due to failure to open tty: Executing(%check): /bin/sh -e /var/tmp/rpm-tmp.DaLElE + umask 022 + cd /builddir/build/BUILD + cd Expect-1.21 + unset DISPLAY + /usr/bin/make test PERL_DL_NONLAZY=1 /usr/bin/perl "-Iblib/lib" "-Iblib/arch" test.pl IO::Tty::pty_allocate(nonfatal): grantpt(): No such file or directory at /usr/lib64/perl5/vendor_perl/IO/Pty.pm line 24. IO::Tty::open_slave(nonfatal): ptsname_r(): No such file or directory at /usr/lib64/perl5/vendor_perl/IO/Pty.pm line 24. IO::Tty::open_slave(nonfatal): open(/dev/pts/9): No such file or directory at /usr/lib64/perl5/vendor_perl/IO/Pty.pm line 24. pty_allocate(nonfatal): posix_openpt(): No such file or directory at /usr/lib64/perl5/vendor_perl/IO/Pty.pm line 24. IO::Tty::pty_allocate(nonfatal): grantpt(): No such file or directory at /usr/lib64/perl5/vendor_perl/IO/Pty.pm line 24. IO::Tty::open_slave(nonfatal): open(/dev/pts/9): No such file or directory at /usr/lib64/perl5/vendor_perl/IO/Pty.pm line 24. pty_allocate(nonfatal): getpt(): No such file or directory at /usr/lib64/perl5/vendor_perl/IO/Pty.pm line 24. pty_allocate(nonfatal): openpty(): No such file or directory at /usr/lib64/perl5/vendor_perl/IO/Pty.pm line 24. IO::Tty::pty_allocate(nonfatal): grantpt(): No such file or directory at /usr/lib64/perl5/vendor_perl/IO/Pty.pm line 24. IO::Tty::open_slave(nonfatal): open(/dev/pts/9): No such file or directory at /usr/lib64/perl5/vendor_perl/IO/Pty.pm line 24. pty_allocate(nonfatal): open(/dev/ptmx): No such file or directory at /usr/lib64/perl5/vendor_perl/IO/Pty.pm line 24. Cannot open a pty at test.pl line 34 1..42 Basic tests... make: *** [test_dynamic] Error 2 error: Bad exit status from /var/tmp/rpm-tmp.DaLElE (%check) $ ls -l /var/lib/mock/city-fan-rawhide-x86_64/root/dev total 64 crw-------. 1 root root 5, 1 May 19 09:42 console lrwxrwxrwx. 1 root root 13 May 19 09:42 fd -> /proc/self/fd crw-rw-rw-. 1 root root 1, 7 May 19 09:42 full crw-rw-rw-. 1 root root 1, 3 May 19 09:42 null crw-rw-rw-. 1 root tty 5, 2 May 19 09:42 ptmx drwxrwxr-x. 2 root root 4096 May 19 09:42 pts crw-rw-rw-. 1 root root 1, 8 May 19 09:42 random drwxrwxr-x. 2 root root 4096 May 19 09:42 shm lrwxrwxrwx. 1 root root 15 May 19 09:42 stderr -> /proc/self/fd/2 lrwxrwxrwx. 1 root root 15 May 19 09:42 stdin -> /proc/self/fd/0 lrwxrwxrwx. 1 root root 15 May 19 09:42 stdout -> /proc/self/fd/1 crw-rw-rw-. 1 root tty 5, 0 May 19 09:42 tty cr--r--r--. 1 root root 1, 9 May 19 09:42 urandom crw-rw-rw-. 1 root root 1, 5 May 19 09:42 zero The libssh2 test suite fails as in Comment #7 and my previous workaround of disabling the failing test if /dev/tty was not present or not a character special device no longer works :-(
mock-1.1.10-1.fc14 has been pushed to the Fedora 14 stable repository. If problems still persist, please make note of it in this bug report.
mock-1.1.10-1.fc13 has been pushed to the Fedora 13 stable repository. If problems still persist, please make note of it in this bug report.
Is this really considered fixed now or is there any prospect of having a working /dev/tty in mock again? Should I open a new bug regarding the test failures for perl-Expect and libssh2?
It's fixed in the regard that it no longer hangs builds when trying to access /dev/tty (since there is no longer a controlling terminal in the chroot). If you consider having a controlling terminal available in the build system environment, then I guess we need a new bz.
I'm not sure whether it's the absence of a controlling terminal or something else that causes these packages' test suites to fail. If you're sure that's what it is then I'll open another bug.
mock-1.0.17-1.el5 has been pushed to the Fedora EPEL 5 stable repository. If problems still persist, please make note of it in this bug report.
mock-1.1.10-1.el6 has been pushed to the Fedora EPEL 6 stable repository. If problems still persist, please make note of it in this bug report.
(In reply to comment #21) > It's fixed in the regard that it no longer hangs builds when trying to access > /dev/tty (since there is no longer a controlling terminal in the chroot). > > If you consider having a controlling terminal available in the build system > environment, then I guess we need a new bz. I'm pleased to say that with mock 1.1.11, both perl-Expect and libssh complete their test suites successfully. perl-Term-ReadKey also passes though it claims /dev/tty is absent and thus skips most of the tests. Everything's buildable though so I'm happy :-)