Report forwarded
to debian-bugs-dist@lists.debian.org, sys@skroutz.gr, APT Development Team <deity@lists.debian.org>: Bug#772641; Package apt.
(Tue, 09 Dec 2014 14:00:06 GMT) (full text, mbox, link).
Acknowledgement sent
to Apollon Oikonomopoulos <apoikos@debian.org>:
New Bug report received and forwarded. Copy sent to sys@skroutz.gr, APT Development Team <deity@lists.debian.org>.
(Tue, 09 Dec 2014 14:00:06 GMT) (full text, mbox, link).
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: apt: "E: Setting TIOCSCTTY for slave fd <fd> failed" when run as a
session leader
Date: Tue, 9 Dec 2014 15:57:05 +0200
Package: apt
Version: 1.0.9.4
Severity: serious
Justification: Regression, breaks other software (e.g. puppet)
Dear Maintainer,
apt 1.0.9.4 does not work correctly when run as a session leader,
reporting a failed ioctl on the pty used by dpkg. When called by puppet,
it emits the following output:
Error: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install ntpdate' returned : Reading package lists...
Building dependency tree...
Reading state information...
Recommended packages:
lockfile-progs
The following NEW packages will be installed:
ntpdate
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/74.1 kB of archives.
After this operation, 233 kB of additional disk space will be used.
E: Setting TIOCSCTTY for slave fd 18 failed! - ioctl (1: Operation not permitted)
Selecting previously unselected package ntpdate.
(Reading database ... 46412 files and directories currently installed.)
Preparing to unpack .../ntpdate_1%3a4.2.6.p5+dfsg-3.1+b1_amd64.deb ...
Unpacking ntpdate (1:4.2.6.p5+dfsg-3.1+b1) ...
Processing triggers for man-db (2.7.0.2-3) ...
E: Setting TIOCSCTTY for slave fd 18 failed! - ioctl (1: Operation not permitted)
Setting up ntpdate (1:4.2.6.p5+dfsg-3.1+b1) ...
Apart from the error message, it also appears that apt is trying to close its
own control terminal, thus SIGHUP'ing itself, signaling an unclean exit:
23631 open("/dev/pts/2", O_RDWR|O_CLOEXEC) = 19
...
23631 close(19) = 0
23631 close(18) = 0
23631 --- SIGHUP {si_signo=SIGHUP, si_code=SI_KERNEL} ---
23631 +++ killed by SIGHUP +++
This has the side-effect of puppet marking the package installation as failed
and all downstream dependencies as unsatisfied.
This behavior was introduced in commit 299aea924c and can be trivially
reproduced using setsid:
# setsid -w apt-get install sm </dev/null
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
sm
0 upgraded, 1 newly installed, 0 to remove and 203 not upgraded.
Need to get 0 B/21,3 kB of archives.
After this operation, 108 kB of additional disk space will be used.
dpkg-preconfigure: unable to re-open stdin: No such file or directory
E: Setting TIOCSCTTY for slave fd 38 failed! - ioctl (1: Operation not permitted)
Selecting previously unselected package sm.
(Reading database ... 411612 files and directories currently installed.)
Preparing to unpack .../archives/sm_0.22.1-2_amd64.deb ...
Unpacking sm (0.22.1-2) ...
Processing triggers for hicolor-icon-theme (0.13-1) ...
Processing triggers for man-db (2.7.0.2-3) ...
Processing triggers for menu (2.1.47) ...
Processing triggers for mime-support (3.57) ...
Processing triggers for desktop-file-utils (0.22-1) ...
E: Setting TIOCSCTTY for slave fd 38 failed! - ioctl (1: Operation not permitted)
Setting up sm (0.22.1-2) ...
Processing triggers for menu (2.1.47) ...
setsid: child 5136 did not exit normally: Success
Regards,
Apollon
-- Package-specific info:
-- (no /etc/apt/preferences present) --
-- (/etc/apt/sources.list present, but not submitted) --
-- System Information:
Debian Release: 8.0
APT prefers testing
APT policy: (500, 'testing'), (90, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 3.16.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=el_GR.UTF-8, LC_CTYPE=el_GR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages apt depends on:
ii debian-archive-keyring 2014.3
ii gnupg 1.4.18-4
ii libapt-pkg4.12 1.0.9.4
ii libc6 2.19-13
ii libgcc1 1:4.9.1-19
ii libstdc++6 4.9.1-19
apt recommends no packages.
Versions of packages apt suggests:
pn apt-doc <none>
ii aptitude 0.6.11-1+b1
ii dpkg-dev 1.17.21
ii python-apt 0.9.3.11
-- debconf-show failed
Information forwarded
to debian-bugs-dist@lists.debian.org, APT Development Team <deity@lists.debian.org>: Bug#772641; Package apt.
(Thu, 11 Dec 2014 00:39:04 GMT) (full text, mbox, link).
Acknowledgement sent
to David Kalnischkies <david@kalnischkies.de>:
Extra info received and forwarded to list. Copy sent to APT Development Team <deity@lists.debian.org>.
(Thu, 11 Dec 2014 00:39:04 GMT) (full text, mbox, link).
Hi,
On Tue, Dec 09, 2014 at 03:57:05PM +0200, Apollon Oikonomopoulos wrote:
> apt 1.0.9.4 does not work correctly when run as a session leader,
> reporting a failed ioctl on the pty used by dpkg. When called by puppet,
> it emits the following output:
[…]
> Apart from the error message, it also appears that apt is trying to close its
> own control terminal, thus SIGHUP'ing itself, signaling an unclean exit:
There was a time in which I had read "Why isn't X the year of the Linux
Desktop" articles and the answer was always "because of terminals".
I couldn't understood what could be so wrong with terminals. I loved them.
Then, I started hacking on the PTY handling in apt…
And all of a sudden I understand…
But enough about my first world problems:
The setup is like this: the apt process itself is keeping
a reference open to the pseudo terminal slave as Linux is upset
otherwise (see 299aea924ccef428219ed6f1a026c122678429e6).
That is all nice and dandy up to the point where the apt process has no
controlling terminal, so that opening the pseudo terminal slave will
make this terminal our controlling terminal! In our cleanup at the end
we close the pseudo terminal, which in that case is a "terminal" mistake
as its our controlling terminal, which quite literally means: we hang
ourselves.
So, the proper thing to do is to rule with our hard iron fist and show
our primitive little slave that it isn't right for him to have
aspirations behond what its puppet-master intended for him.
In other words: We add O_NOCTTY to the open(2) call to stop the slave
terminal from becoming our controlling terminal.
Attached is a patch which hopefully does exactly this. It is against
experimental, but that shouldn't matter (expect for the testcase
I think). I have run it on Linux amd64 (and armel) hardware as well
as on a kfreebsd kvm, so I have some hope that it isn't regessing, but
it would be nice if you could try it with puppet just to be sure that we
are really fixing the problem completely or if I have justed resolved
the problem in the setsid testcase.
Thanks in any case for the report and the testcase, especially the
later helped tremendously in reproducing the problem!
Best regards
David Kalnischkies
Information forwarded
to debian-bugs-dist@lists.debian.org, APT Development Team <deity@lists.debian.org>: Bug#772641; Package apt.
(Thu, 11 Dec 2014 12:39:06 GMT) (full text, mbox, link).
Acknowledgement sent
to Apollon Oikonomopoulos <apoikos@debian.org>:
Extra info received and forwarded to list. Copy sent to APT Development Team <deity@lists.debian.org>.
(Thu, 11 Dec 2014 12:39:06 GMT) (full text, mbox, link).
Hi,
On 01:35 Thu 11 Dec , David Kalnischkies wrote:
> Attached is a patch which hopefully does exactly this. It is against
> experimental, but that shouldn't matter (expect for the testcase
> I think). I have run it on Linux amd64 (and armel) hardware as well
> as on a kfreebsd kvm, so I have some hope that it isn't regessing, but
> it would be nice if you could try it with puppet just to be sure that we
> are really fixing the problem completely or if I have justed resolved
> the problem in the setsid testcase.
Just tested a patched 1.0.9.4 with puppet and it fixes the issue.
Thanks for the quick response!
Apollon
Added tag(s) patch.
Request was from Niels Thykier <niels@thykier.net>
to control@bugs.debian.org.
(Thu, 11 Dec 2014 18:03:05 GMT) (full text, mbox, link).
Information forwarded
to debian-bugs-dist@lists.debian.org, APT Development Team <deity@lists.debian.org>: Bug#772641; Package apt.
(Fri, 12 Dec 2014 11:00:10 GMT) (full text, mbox, link).
Acknowledgement sent
to Samuel Wolf <samuelwolf85@googlemail.com>:
Extra info received and forwarded to list. Copy sent to APT Development Team <deity@lists.debian.org>.
(Fri, 12 Dec 2014 11:00:10 GMT) (full text, mbox, link).
Information forwarded
to debian-bugs-dist@lists.debian.org, APT Development Team <deity@lists.debian.org>: Bug#772641; Package apt.
(Thu, 18 Dec 2014 13:51:09 GMT) (full text, mbox, link).
Acknowledgement sent
to Faidon Liambotis <paravoid@debian.org>:
Extra info received and forwarded to list. Copy sent to APT Development Team <deity@lists.debian.org>.
(Thu, 18 Dec 2014 13:51:09 GMT) (full text, mbox, link).
To: David Kalnischkies <david@kalnischkies.de>, 772641@bugs.debian.org
Cc: Apollon Oikonomopoulos <apoikos@debian.org>
Subject: Re: Bug#772641: apt: "E: Setting TIOCSCTTY for slave fd <fd> failed"
when run as a session leader
Date: Thu, 18 Dec 2014 15:12:15 +0200
Dear apt maintainers,
On Thu, Dec 11, 2014 at 01:35:27AM +0100, David Kalnischkies wrote:
> Attached is a patch which hopefully does exactly this. It is against
> experimental, but that shouldn't matter (expect for the testcase
> I think). I have run it on Linux amd64 (and armel) hardware as well
> as on a kfreebsd kvm, so I have some hope that it isn't regessing, but
> it would be nice if you could try it with puppet just to be sure that we
> are really fixing the problem completely or if I have justed resolved
> the problem in the setsid testcase.
Since David's patch works and this is an severity: serious/RC bug that
affects multiple people, how would you like to proceed? I see that while
David is not listed as an Uploader, he has a track record of
contributing to apt and has even signed off the latest upload.
I'd be happy to either sponsor an upload by David or NMU with his patch.
David, what do you think?
Let me know.
Thanks,
Faidon
Reply sent
to David Kalnischkies <david@kalnischkies.de>:
You have taken responsibility.
(Tue, 23 Dec 2014 21:39:27 GMT) (full text, mbox, link).
Notification sent
to Apollon Oikonomopoulos <apoikos@debian.org>:
Bug acknowledged by developer.
(Tue, 23 Dec 2014 21:39:27 GMT) (full text, mbox, link).
Source: apt
Source-Version: 1.0.9.5
We believe that the bug you reported is fixed in the latest version of
apt, which is due to be installed in the Debian FTP archive.
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to 772641@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
David Kalnischkies <david@kalnischkies.de> (supplier of updated apt package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Format: 1.8
Date: Tue, 23 Dec 2014 13:22:42 +0100
Source: apt
Binary: apt libapt-pkg4.12 libapt-inst1.5 apt-doc libapt-pkg-dev libapt-pkg-doc apt-utils apt-transport-https
Architecture: source all amd64
Version: 1.0.9.5
Distribution: unstable
Urgency: medium
Maintainer: APT Development Team <deity@lists.debian.org>
Changed-By: David Kalnischkies <david@kalnischkies.de>
Description:
apt - commandline package manager
apt-doc - documentation for APT
apt-transport-https - https download transport for APT
apt-utils - package management related utility programs
libapt-inst1.5 - deb package format runtime library
libapt-pkg-dev - development files for APT's libapt-pkg and libapt-inst
libapt-pkg-doc - documentation for APT development
libapt-pkg4.12 - package management runtime library
Closes: 768797769609771967771982772641772678772732772913773061
Changes:
apt (1.0.9.5) unstable; urgency=medium
.
[ David Kalnischkies ]
* dispose http(s) 416 error page as non-content (Closes: 768797)
* do not make PTY slave the controlling terminal (Closes: 772641)
* always run 'dpkg --configure -a' at the end of our dpkg callings
(Closes: 769609)
* pass-through stdin fd instead of content if not a terminal (Closes: 773061)
.
[ James McCoy ]
* tighten filtering of kernel images in apt.auto-removal (Closes: 772732)
.
[ Jean-Pierre Giraud ]
* French manpages translation update (Closes: 771967)
.
[ Zhou Mo ]
* Chinese (simplified) program translation update (Closes: 771982)
.
[ Kenshi Muto ]
* Japanese program translation update (Closes: 772678)
.
[ Theppitak Karoonboonyanan ]
* Thai program translation update (Closes: 772913)
Checksums-Sha1:
1d746a7cc8aa9f6c1ac75b083a7a10b9ef000d34 2353 apt_1.0.9.5.dsc
3d40f1d09af0f9f60e6bded40b956d36d0773de2 1840376 apt_1.0.9.5.tar.xz
fc13886cc1ac7578647e837f1583f1aee63650a1 302336 apt-doc_1.0.9.5_all.deb
b0716d3fd69d42c0274df577d3827fd5dc1e3f21 780448 libapt-pkg-doc_1.0.9.5_all.deb
0c96cf47a99c4a04dc783f659ff42d7f36297939 790116 libapt-pkg4.12_1.0.9.5_amd64.deb
127cda241c5d73700083fe732344f9866afa1ac8 167972 libapt-inst1.5_1.0.9.5_amd64.deb
1923c3d7202353701455f21a9da3d5ec50cae45c 1107724 apt_1.0.9.5_amd64.deb
66468584689007e5eb22914d1f5c5635fd4aac8b 193078 libapt-pkg-dev_1.0.9.5_amd64.deb
77c3fbfa9c766e15e296cac7042ec5ef56da72d5 366964 apt-utils_1.0.9.5_amd64.deb
3fbf0285019639fd2ae6b7058a1399ea6ba64588 136292 apt-transport-https_1.0.9.5_amd64.deb
Checksums-Sha256:
20bad5f666ff8c025fd22917903848abf658a9beec731afb3bfd9bd327187ea8 2353 apt_1.0.9.5.dsc
7af925d497a777552857d36e9f64536985342840379b89655952e7a862cfb3be 1840376 apt_1.0.9.5.tar.xz
6496795c201813f46d37ea64f78d50d32dd9163c74507f21daab32664f49b293 302336 apt-doc_1.0.9.5_all.deb
f68a484bb1716ae7a6df075b0484df1ca81c52a59572c6d7d9ff70143d5cb2e6 780448 libapt-pkg-doc_1.0.9.5_all.deb
413b0b1f0f1759b533ca2012a7948e08d173b2e25ec174cc572b683873a6c98a 790116 libapt-pkg4.12_1.0.9.5_amd64.deb
2c8e2fd5142b1615d906ee0eaaf58c555f738cddbd5074b3371e65cfbf14b068 167972 libapt-inst1.5_1.0.9.5_amd64.deb
4a0a69877daee2f2d0152fdfef06631b89f95a267f2148c3938ce46f081a0924 1107724 apt_1.0.9.5_amd64.deb
aebb947692dc48a0c289200ac1edaf35828b0dd57d002f4371bfb62e63d211cf 193078 libapt-pkg-dev_1.0.9.5_amd64.deb
3dfb54fc06da549e0d99db7f8038d328645e47a4f61de4d76e315f2f2586d93f 366964 apt-utils_1.0.9.5_amd64.deb
0e3b474f8d2a02f19a7a48568165160388a14e4b0f4bdee7e57182c42966c673 136292 apt-transport-https_1.0.9.5_amd64.deb
Files:
59b53c665e22a6bce02905f8a12b2b8c 2353 admin important apt_1.0.9.5.dsc
1957a16630136e2f34a5a864e719f662 1840376 admin important apt_1.0.9.5.tar.xz
7a9780af14b3483c05557eb030444a06 302336 doc optional apt-doc_1.0.9.5_all.deb
62256afd52af8dab29ef505fa7d9d63d 780448 doc optional libapt-pkg-doc_1.0.9.5_all.deb
ccb89186a3668267c723405ebe8fde13 790116 libs important libapt-pkg4.12_1.0.9.5_amd64.deb
56f633d775d5dc46246bcd3d0eef5269 167972 libs important libapt-inst1.5_1.0.9.5_amd64.deb
6ab282c0647eb502855d2ff4bde10676 1107724 admin important apt_1.0.9.5_amd64.deb
9dcc0f6c78c9f62d50daa72e01b0179e 193078 libdevel optional libapt-pkg-dev_1.0.9.5_amd64.deb
8fa3ed1a5a593b9d597e0c0c892cd739 366964 admin important apt-utils_1.0.9.5_amd64.deb
3f0b141537b3d554b3228f17f58742ec 136292 admin optional apt-transport-https_1.0.9.5_amd64.deb
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
iQIcBAEBCAAGBQJUmc4YAAoJEJjKuzq9TKWe2eIQAOOLkD7dAFs3wvM7YmjYwN4Y
ps39SDEoTJHlgQYv/Nhg9kL3n5F8u0GQ8n5FxNJp0Uv58YcQ/fEHV61i8O/qx+A7
9XWfqwOoObeQOMKsg5KlM8+LKUKk5ZdbP5ypd9hBguIeCZNfP/KYmm9TnnjioquE
Q/HcW7kLaZwcxiTgc6suIYyUPCjnqdCqKY0E7VClbTR2Cozl2tDEaGWVTLMFRStl
Xx3yrDga3w9+FHwsyU3GoVS7Aj1M/B3qAq4hkkuoLWksRxlIMGXJ1cjFlTx4t8nb
fyiyRl86qnDjUJYDzWfftUvxgiSAlKW6mCkXz+3oS+d8k3okF79Pat1FEPVoEotd
xuDlHT455D8mxCD7clYAvLhFDtg3BCW5YEGOVHJbWfnQaUwj40cCzgU2j2QxccLe
AJAo0l9aVhuAaWfR4Pno/Up+QRIv7FOzHrSwSrAwYMZZud/kkyi6DGrf/rSXB0iX
YORgDpGbOCV0opX0hYwKJcj42Ky9ak9PStsS+z4jmYDBH9tEHbpdI7kcsO4Elkq5
0nB88GIeAwFjxLb8SpEP7MHMqcqxTDcQKyKyBNI0+H8gYUDdBvki6YDNFqEqbH0u
bIQnow0TZoCHNwjNRFFLZs2TkTZO28qsfIGJ8zXCaPJhTW0mru7yG5Fbnp20NFdg
OKkC75/NnvRTp4uZR6Vx
=agvD
-----END PGP SIGNATURE-----
Bug archived.
Request was from Debbugs Internal Request <owner@bugs.debian.org>
to internal_control@bugs.debian.org.
(Mon, 26 Jan 2015 07:27:11 GMT) (full text, mbox, link).
Debbugs is free software and licensed under the terms of the GNU General
Public License version 2. The current version can be obtained
from https://bugs.debian.org/debbugs-source/.