Broken system lock counting
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
apt (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Xenial |
Fix Released
|
Undecided
|
Unassigned | ||
Artful |
Fix Released
|
Undecided
|
Unassigned | ||
Bionic |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[Impact]
System lock unrefing is broken, off-by-one error. Locking twice opens a second fd for the lock file, and the old fd gets lost and remains open for the remaining duration of the program
[Test case]
Executing the following script should show one lock file in the first line, and none in the last line.
def maybe_readlink(
try:
return os.readlink(path)
except:
return "<deleted>"
import os, apt_pkg
apt_pkg.init()
apt_pkg.
apt_pkg.
print([(p, maybe_readlink(
apt_pkg.
apt_pkg.
print([(p, maybe_readlink(
[Test output]
good, cosmic:
[('0', '/dev/pts/2'), ('1', '/dev/pts/2'), ('2', '/dev/pts/2'), ('3', '/var/lib/
[('0', '/dev/pts/2'), ('1', '/dev/pts/2'), ('2', '/dev/pts/2'), ('3', '<deleted>')]
bad, bionic:
[('0', '/dev/pts/0'), ('1', '/dev/pts/0'), ('2', '/dev/pts/0'), ('3', 'pipe:[40889331]'), ('4', '/var/lib/
[('0', '/dev/pts/0'), ('1', '/dev/pts/0'), ('2', '/dev/pts/0'), ('3', 'pipe:[40889331]'), ('4', '/var/lib/
[Regression potential]
A locking change can potentially break locking, but this one seems like an obvious off-by-one error.
Changed in apt (Ubuntu): | |
status: | New → Fix Committed |
Changed in apt (Ubuntu Bionic): | |
status: | New → Triaged |
Changed in apt (Ubuntu Artful): | |
status: | New → Confirmed |
Changed in apt (Ubuntu Xenial): | |
status: | New → Confirmed |
description: | updated |
description: | updated |
Changed in apt (Ubuntu Bionic): | |
status: | Triaged → In Progress |
Changed in apt (Ubuntu Artful): | |
status: | Confirmed → In Progress |
Changed in apt (Ubuntu Xenial): | |
status: | Confirmed → In Progress |
Hello Julian, or anyone else affected,
Accepted apt into xenial-proposed. The package will build now and be available at https:/ /launchpad. net/ubuntu/ +source/ apt/1.2. 27 in a few hours, and then in the -proposed repository.
Please help us by testing this new package. See https:/ /wiki.ubuntu. com/Testing/ EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.
If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification- needed- xenial to verification- done-xenial. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification- failed- xenial. In either case, without details of your testing we will not be able to proceed.
Further information regarding the verification process can be found at https:/ /wiki.ubuntu. com/QATeam/ PerformingSRUVe rification . Thank you in advance!