avahi leaks dbus connections to the system bus, breaking other apps depending on them

Bug #877967 reported by Timo Aaltonen
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
cups (Ubuntu)
Fix Released
High
Unassigned
Oneiric
Fix Released
High
Unassigned
Precise
Fix Released
High
Unassigned

Bug Description

every time the avahi client state is polled (?):

D [18/Oct/2011:16:27:25 +0300] Avahi client state: 1

a new connection to the dbus system bus is created, which shows in netstat -x -p output:

unix 3 [ ] STREAM CONNECTED 9177 1338/dbus-daemon /var/run/dbus/system_bus_socket
...

So the system will end up with 240 connections, breaking apps like update-manager which can't connect to the bus anymore. Also, I'm pretty sure this was due to the latest cups update in oneiric-updates, which changed the Avahi backend. I'll test with 1.5.0-8.

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: cups 1.5.0-8ubuntu1
ProcVersionSignature: Ubuntu 3.0.0-12.20-generic 3.0.4
Uname: Linux 3.0.0-12-generic x86_64
ApportVersion: 1.23-0ubuntu3
Architecture: amd64
Date: Wed Oct 19 10:52:32 2011
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Release amd64 (20110427.1)
Lpstat: device for mankeli: ipp://192.168.1.15
MachineType: Intel Corporation SandyBridge Platform
Papersize: a4
PpdFiles:
 mankeli: Generic PostScript Printer
 mankeli: Generic PostScript Printer
ProcEnviron:
 PATH=(custom, user)
 LANG=fi_FI.UTF-8
 SHELL=/bin/zsh
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-3.0.0-12-generic root=UUID=921d8d6a-73e4-4693-8a6a-10cbceb5b51c ro quiet splash vt.handoff=7
SourcePackage: cups
UpgradeStatus: Upgraded to oneiric on 2011-07-05 (105 days ago)
dmi.bios.date: 01/13/2011
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: ASNBCPT1.86C.0061.P00.1101131110
dmi.board.asset.tag: To be filled by O.E.M.
dmi.board.name: LosLunas CRB
dmi.board.vendor: Intel Corporation
dmi.board.version: To be filled by O.E.M.
dmi.chassis.asset.tag: To Be Filled By O.E.M.
dmi.chassis.type: 3
dmi.chassis.vendor: To Be Filled By O.E.M.
dmi.chassis.version: To Be Filled By O.E.M.
dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvrASNBCPT1.86C.0061.P00.1101131110:bd01/13/2011:svnIntelCorporation:pnSandyBridgePlatform:pvrTobefilledbyO.E.M.:rvnIntelCorporation:rnLosLunasCRB:rvrTobefilledbyO.E.M.:cvnToBeFilledByO.E.M.:ct3:cvrToBeFilledByO.E.M.:
dmi.product.name: SandyBridge Platform
dmi.product.version: To be filled by O.E.M.
dmi.sys.vendor: Intel Corporation

Revision history for this message
Timo Aaltonen (tjaalton) wrote :
Revision history for this message
Timo Aaltonen (tjaalton) wrote :

this logfile shows that after the daemon got restarted around 16:15, it begins to probe the avahi client state. I monitored the system bus with d-feet, and noticed that every time a new 'Avahi client state 1' line appeared on the logfile, a new connection would show up on d-feet.

Changed in cups (Ubuntu):
importance: Undecided → High
milestone: none → oneiric-updates
tags: added: regression-update
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Tim, can you have a look into this? It seems that your Avahi plugin opens new D-Bus connections periodically without closing them, using up all possible connections.

Revision history for this message
Tim Waugh (twaugh) wrote :

I think when you added the support for periodically retrying avahi connections, the guard condition wasn't set early enough.

Please take a look at commit 15bd402 in the fedorapeople.org repository. It sets the global AvahiCupsClientConnecting variable as soon as it sees that avahi_client_new() has successfully returned, rather than waiting for the first callback.

Martin Pitt (pitti)
Changed in cups (Ubuntu Precise):
milestone: oneiric-updates → none
Changed in cups (Ubuntu Oneiric):
milestone: none → oneiric-updates
Revision history for this message
Martin Pitt (pitti) wrote :

Thanks Tim!

Changed in cups (Ubuntu Precise):
status: New → Fix Committed
Martin Pitt (pitti)
Changed in cups (Ubuntu Oneiric):
status: New → In Progress
importance: Undecided → High
assignee: nobody → Martin Pitt (pitti)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package cups - 1.5.0-9

---------------
cups (1.5.0-9) unstable; urgency=low

  [ Till Kamppeter ]
  * debian/patches/do-not-suppress-inputslot-setting-with-empty-ap-d-inputslot.patch:
    CUPS adds the option setting "AP_D_InputSlot=" to every job. This overrides
    the InputSlot option and so the InputSlot setting and even the default
    setting for InputSlot in the PPD get never used, rendering InputSlot
    useless (LP: #872527).
  * debian/patches/cups-avahi.patch: Updated patch from upstream (Red Hat)
    to fix crashes of the CUPS daemon when using the timeout function call
    functionality (LP: #860691, LP: #860498).

  [ Martin Pitt ]
  * debian/local/apparmor-profile: Also allow cups to map libraries under
    /usr/local/. (LP: #860765)
  * cups-avahi.patch: Make sure to guard against retrying the Avahi connection
    whilst already doing so. Thanks to Tim Waugh for the patch! (LP: #877967)

  [ Michael Vogt ]
  * debian/control: Add Conflicts/Replaces: libcupsys2 to ensure that the apt
    resolver can calculate the upgrade in a multiarch scenario where a old
    libcupsys2 package is installed (LP: #874835)
 -- Martin Pitt <email address hidden> Wed, 19 Oct 2011 14:57:50 +0200

Changed in cups (Ubuntu Precise):
status: Fix Committed → Fix Released
Revision history for this message
Timo Aaltonen (tjaalton) wrote :

for the record, I see the same-ish behaviour with -8, it's just slower to fill the bus than with the update.

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Uploaded CUPS package with the fix for this bug and bug 872483 to -proposed. As soon as the package is approved for testing we will post another comment with further instructions. Please test then and tell us whether the update fixes your problem. A debdiff of the changes is attached.

Changed in cups (Ubuntu Oneiric):
status: In Progress → Fix Released
status: Fix Released → Fix Committed
Revision history for this message
Martin Pitt (pitti) wrote : Please test proposed package

Hello Timo, or anyone else affected,

Accepted cups into oneiric-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

tags: added: verification-needed
Martin Pitt (pitti)
Changed in cups (Ubuntu Oneiric):
assignee: Martin Pitt (pitti) → nobody
Revision history for this message
Timo Aaltonen (tjaalton) wrote :

Martin: seems fixed, thanks!

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Timo, thank you very much for verifying.

tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package cups - 1.5.0-8ubuntu4

---------------
cups (1.5.0-8ubuntu4) oneiric-proposed; urgency=low

  * debian/patches/usb-backend-reset-printer-before-printing.patch: When
    using the "usb" CUPS backend, reset the printer before each job as
    otherwise on some printers subsequent jobs will come out as garbage
    (LP: #872483).
  * cups-avahi.patch: Make sure to guard against retrying the Avahi connection
    whilst already doing so. Thanks to Tim Waugh for the patch! (LP: #877967)
 -- Till Kamppeter <email address hidden> Thu, 20 Oct 2011 12:27:43 +0200

Changed in cups (Ubuntu Oneiric):
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

Remote bug watches

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