cupsd takes 99% CPU when BrowsePoll is used, cups-polld not taken down when CUPS is stopped

Bug #30965 reported by Albert Cardona
18
Affects Status Importance Assigned to Milestone
cupsys (Ubuntu)
Fix Released
Medium
Martin Pitt

Bug Description

In kubuntu-powerpc Breezy, I edited the /etc/cups/cupsd.conf to add a BrowsePoll. Then I stopped the daemon by /etc/init.d/cupsys stop and restarted with id. start.
I can't print, and I see in a 'top' that the cupsd is consuming 99% chip resources.
Latest versions available (I did a dist-upgrade)
I have not rebooted the machine.

Revision history for this message
Albert Cardona (cardona) wrote :

This bug is still present in 6.06 beta as of 20060524

Revision history for this message
Albert Cardona (cardona) wrote :

Plus, in dapper, cupsd goes to 99% after a normal boot. And I can't print!

Revision history for this message
Albert Cardona (cardona) wrote :

Ok, came across a solution:

$ sudo apt-get --purge remove cupsys cups-pdf
$ cd /var/cache
$ sudo rm -rf cupsd/
$ cd /var/run
$ sudo rm -rf cupsd/

Something was stiking around from Breezy which prevents cupsd from running properly.

Revision history for this message
David Kågedal (dkagedal) wrote :

I have the same problem as the initial poster in Edgy. If I add a BrowsePoll line in my cupsd.conf, cupsd starts eating all the CPU it can get. If I remove the line and restart, it goes back to normal.

The server pointed to by the BrowsePoll line works fine, which I verified by running "CUPS_SERVER=<thehost> lpstat -a".

Also, when I stop cups, I get a "cups-polld" run by root that doesn't go away. Why does that process have to run as root.

stracing shows that cupsd is doing a lot of select(). The cups-polld seems to be actually talking to the other server.

This is the output of "dpkg -l cups\*"

un cups <none> (no description available)
un cups-pdf <none> (no description available)
un cupsomatic-ppd <none> (no description available)
ii cupsys 1.2.4-2ubuntu3 Common UNIX Printing System(tm) - server
ii cupsys-bsd 1.2.4-2ubuntu3 Common UNIX Printing System(tm) - BSD comman
ii cupsys-client 1.2.4-2ubuntu3 Common UNIX Printing System(tm) - client pro
ii cupsys-common 1.2.4-2ubuntu3 Common UNIX Printing System(tm) - common fil
ii cupsys-driver- 5.0.0-2ubuntu2 printer drivers for CUPS
pn cupsys-driver- <none> (no description available)
ii cupsys-driver- 5.0.0-2ubuntu2 printer drivers for CUPS
un cupsys-pstoras <none> (no description available)
un cupsys-pt <none> (no description available)

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

In Feisty (CUPS 1.2.7) the 100% CPU problem disappears, probably due to the following fix:

http://www.cups.org/str.php?L1994

The problem of cups-polld running as root and therefore not taken down when cupsys is stopped still persists. I recommend to expand the cupsys run-as-user patch to also let the sub-daemons (cups-polld and cups-lpd) drop their privileges as soon as possible. This way CUPS can kill these daemons and as a side effect the security of these daemons is improved.

Changed in cupsys:
status: Unconfirmed → Confirmed
Martin Pitt (pitti)
Changed in cupsys:
assignee: nobody → pitti
status: Confirmed → In Progress
Revision history for this message
Martin Pitt (pitti) wrote :

 cupsys (1.2.7-4ubuntu2) feisty; urgency=low
 .
   * debian/local/enable_sharing: Fix regex to find both 127.0.0.1 and
     'localhost' to fix enabling sharing the second time. Closes: LP#75903
   * debian/patches/09_runasuser.dpatch: Drop root privileges of cups-polld
     after creating the socket. This allows cupsd to kill polld on shutdown,
     and has the nice side effect of improving security. Closes: LP#30965

Still have to do the same for cups-lpd, so not closing yet.

Revision history for this message
Martin Pitt (pitti) wrote :

This should not be an issue any more in Gutsy, since the root dropping patches have been removed.

Changed in cupsys:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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