KDCs complain about not having enough file handles for /var/lib/heimdal-kdc/heimdal

Bug #1191704 reported by Mark Suter
22
This bug affects 2 people
Affects Status Importance Assigned to Milestone
heimdal (Ubuntu)
Fix Released
High
Unassigned
Precise
Fix Released
High
Brian Murray
Quantal
Fix Released
High
Brian Murray
Raring
Fix Released
High
Brian Murray

Bug Description

[Impact]
When having multiple IP addresses configured, the heimdal-kdc package might become unusable under load, due to leaking of file descriptors. This means that all outstanding connections, just created or almost finished, are ignored.

[Test cases]
There's a small probing program attached that helps testing, by following these instructions:

## Install the KDC and a C compiler.
$ sudo apt-get install heimdal-kdc clang

## Add more interfaces.
$ for ip in 192.0.2.{1..32} ; do sudo ip addr add ${ip} dev eth0 ; done

## Restart the KDC so it listens on the interfaces.
$ sudo service heimdal-kdc restart

## There are no leaked sockets.
$ sudo lsof -nn -p $(pgrep kdc) | tee lsof-before.txt

## Build the test utility.
$ cc -o probe probe.c

## Hammer the KDC very briefly.
$ for ip in 192.0.2.{1..32} 127.0.0.1 ; do for i in {1..32} ; do ./probe ${ip} 88 & done & done

## We have leaked sockets, as shown by the "can't identify protocol" sockets.
$ sudo lsof -nn -p $(pgrep kdc) | tee lsof-after.txt

[Possible regressions]
No regressions expected. The patch has been in use by the original submitter's team for more than a year, and has been accepted by upstream for more than 8 months.

[Original Description]
There is a leak in the way the KDC handles file descriptors. Under load, this bug causes connections to be dropped and a lot of seemingly unrelated messages are logged: "Failed to open database: opening /var/lib/heimdal-kdc/heimdal: Too many open files"

Please pull the patch from upstream:

https://github.com/heimdal/heimdal/commit/3f71aca59193785880469fd0757a651e965a594e#kdc/connect.c

Revision history for this message
Margarita Manterola (marga-9) wrote :

Hi,

I've prepared the debdiffs for the package, applying the patch pointed in the previous comment. I'll attach precise here and quantal next.

Revision history for this message
James Page (james-page) wrote :

Hi Margarita

Thanks for preparing the patches for precise and quantal; much appreciated. However, I'd like to point you towards the documentation for the Ubuntu Stable Release Updates process:

  https://wiki.ubuntu.com/StableReleaseUpdates

In order for us to fix this issue in released versions of Ubuntu, we really need to follow this process. First step is to fix this issue in the current development release.

 In addition, I'd also recommend adding some DEP-3 headers to the patches so that its clear this fix is coming from upstream. Looking at the patches you have already prepared please could your review the versioning you are using against that detailed in the SRU process.

We also need a good test case so that the SRU can be verified.

I'm un-subscribing Ubuntu Sponsors for the time being; once you have reworked the patches starting with saucy please re-subscribe ubuntu-sponsors.

Thanks!

Revision history for this message
Margarita Manterola (marga-9) wrote :

Thanks James for the pointers, sorry for not following the guidelines correctly.

I'm attaching here an updated patch for the version in saucy, with the DEP-3 fields. Will create and attach the corresponding patches to the other distros in further comments.

I'll also add testcase/impact/regression information before asking for sponsorship again.

Revision history for this message
Margarita Manterola (marga-9) wrote :

I found that there was a follow-up patch for this patch, that should also be included.
https://github.com/heimdal/heimdal/commit/0055626fef8f950493b2cb49765ff8ba215d4079

I'll re-do all the patches and re-attach here.

Revision history for this message
Margarita Manterola (marga-9) wrote :

All patches re-done adding the extra change from the other commit. They include the descriptions and I think that I did the versions right.

Revision history for this message
Margarita Manterola (marga-9) wrote :
Revision history for this message
Margarita Manterola (marga-9) wrote :
Revision history for this message
Margarita Manterola (marga-9) wrote :
description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in heimdal (Ubuntu):
status: New → Confirmed
Revision history for this message
Margarita Manterola (marga-9) wrote :

I have added instructions for testing that make use of the attached example probing program. The testcase will fail in an unpatched program and not fail after being patched.

description: updated
Changed in heimdal (Ubuntu):
importance: Undecided → High
Revision history for this message
Brian Murray (brian-murray) wrote :

I'll take care of uploading this.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package heimdal - 1.6~git20120403+dfsg1-3ubuntu0.1

---------------
heimdal (1.6~git20120403+dfsg1-3ubuntu0.1) saucy; urgency=low

  * Add debian/patches/044_file_desc to prevent running out of file
    descriptors. LP: #1191704.
 -- Margarita Manterola <email address hidden> Wed, 21 Aug 2013 10:20:22 -0700

Changed in heimdal (Ubuntu):
status: Confirmed → Fix Released
Louis Bouchard (louis)
Changed in heimdal (Ubuntu Precise):
status: New → Triaged
Changed in heimdal (Ubuntu Quantal):
status: New → Triaged
Changed in heimdal (Ubuntu Raring):
status: New → Triaged
Changed in heimdal (Ubuntu Precise):
assignee: nobody → Louis Bouchard (louis-bouchard)
Changed in heimdal (Ubuntu Quantal):
assignee: nobody → Louis Bouchard (louis-bouchard)
Changed in heimdal (Ubuntu Raring):
assignee: nobody → Louis Bouchard (louis-bouchard)
Changed in heimdal (Ubuntu Precise):
importance: Undecided → High
Changed in heimdal (Ubuntu Quantal):
importance: Undecided → High
Changed in heimdal (Ubuntu Raring):
importance: Undecided → High
Changed in heimdal (Ubuntu Precise):
assignee: Louis Bouchard (louis-bouchard) → Brian Murray (brian-murray)
Changed in heimdal (Ubuntu Raring):
assignee: Louis Bouchard (louis-bouchard) → Brian Murray (brian-murray)
Changed in heimdal (Ubuntu Quantal):
assignee: Louis Bouchard (louis-bouchard) → Brian Murray (brian-murray)
Revision history for this message
Brian Murray (brian-murray) wrote :

These have all been uploaded to the appropriate queues.

Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Mark, or anyone else affected,

Accepted heimdal into raring-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/heimdal/1.6~git20120403+dfsg1-2ubuntu0.13.04.1 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 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 to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in heimdal (Ubuntu Raring):
status: Triaged → Fix Committed
tags: added: verification-needed
Changed in heimdal (Ubuntu Quantal):
status: Triaged → Fix Committed
Revision history for this message
Brian Murray (brian-murray) wrote :

Hello Mark, or anyone else affected,

Accepted heimdal into quantal-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/heimdal/1.6~git20120403+dfsg1-2ubuntu0.12.10.1 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 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 to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in heimdal (Ubuntu Precise):
status: Triaged → Fix Committed
Revision history for this message
Brian Murray (brian-murray) wrote :

Hello Mark, or anyone else affected,

Accepted heimdal into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/heimdal/1.6~git20120311.dfsg.1-2ubuntu0.1 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 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 to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Revision history for this message
Louis Bouchard (louis) wrote :

Verification completed ok for Precise, Quantal and Raring. Marking verification-done

tags: added: verification-done
removed: verification-needed
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of this Stable Release Update has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package heimdal - 1.6~git20120403+dfsg1-2ubuntu0.12.10.1

---------------
heimdal (1.6~git20120403+dfsg1-2ubuntu0.12.10.1) quantal; urgency=low

  * Add debian/patches/044_file_desc to prevent running out of file
    descriptors. LP: #1191704.
 -- Margarita Manterola <email address hidden> Thu, 22 Aug 2013 07:59:13 -0700

Changed in heimdal (Ubuntu Quantal):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package heimdal - 1.6~git20120403+dfsg1-2ubuntu0.13.04.1

---------------
heimdal (1.6~git20120403+dfsg1-2ubuntu0.13.04.1) raring; urgency=low

  * Add debian/patches/044_file_desc to prevent running out of file
    descriptors. LP: #1191704.
 -- Margarita Manterola <email address hidden> Wed, 21 Aug 2013 13:23:06 -0700

Changed in heimdal (Ubuntu Raring):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package heimdal - 1.6~git20120311.dfsg.1-2ubuntu0.1

---------------
heimdal (1.6~git20120311.dfsg.1-2ubuntu0.1) precise; urgency=low

  * Add debian/patches/044_file_desc to prevent running out of file
    descriptors. LP: #1191704.
 -- Margarita Manterola <email address hidden> Thu, 22 Aug 2013 08:14:23 -0700

Changed in heimdal (Ubuntu Precise):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.