cups-browsed hangs at 100% CPU

Bug #1207203 reported by Jeremy Sanders
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cups-filters (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Ubuntu 13.04
cups: 1.6.2-1ubuntu5

I'm trying to connect to a remove cups server as a client. In /etc/cups/client.conf I have set

ServerName myserver.foo:631 (also tried without :631)

cups-browsed then runs at 100% CPU. It has been killed using the -9 option. Printing to the remote server does not work (it used to work in precise).

I've straced the process and it goes into an infinte loop here (IP address of server replaced with 111.111.111.111):

fcntl(7, F_SETFD, FD_CLOEXEC) = 0
fcntl(7, F_GETFL) = 0x2 (flags O_RDWR)
fcntl(7, F_SETFL, O_RDWR|O_NONBLOCK) = 0
connect(7, {sa_family=AF_INET, sin_port=htons(631), sin_addr=inet_addr("111.111.111.111")}, 16) = -1 EINPRO
GRESS (Operation now in progress)
fcntl(7, F_SETFL, O_RDWR) = 0
poll([{fd=7, events=POLLIN|POLLOUT}], 1, 250) = 1 ([{fd=7, revents=POLLOUT}])
getpeername(7, {sa_family=AF_INET, sin_port=htons(631), sin_addr=inet_addr("111.111.111.111")}, [16]) = 0
uname({sys="Linux", node="lap75107", ...}) = 0
sendto(7, "POST /admin/ HTTP/1.1\r\nContent-L"..., 195, 0, NULL, 0) = 195
sendto(7, "\2\0@\3\0\0\0\n\1G\0\22attributes-charset\0\5"..., 391, 0, NULL, 0) = 391
poll([{fd=7, events=POLLIN}], 1, 1000) = 1 ([{fd=7, revents=POLLIN|POLLERR|POLLHUP}])
poll([{fd=7, events=POLLIN}], 1, 60000) = 1 ([{fd=7, revents=POLLIN|POLLERR|POLLHUP}])
recvfrom(7, "HTTP/1.1 403 Forbidden\r\nDate: Th"..., 2048, 0, NULL, NULL) = 79
poll([{fd=7, events=POLLIN}], 1, 60000) = 1 ([{fd=7, revents=POLLIN|POLLERR|POLLHUP}])
recvfrom(7, 0x1ca74cc, 2048, 0, 0, 0) = -1 ECONNRESET (Connection reset by peer)
poll([{fd=7, events=POLLIN}], 1, 60000) = 1 ([{fd=7, revents=POLLIN|POLLHUP}])
recvfrom(7, "", 2048, 0, NULL, NULL) = 0
poll([{fd=7, events=POLLIN}], 1, 60000) = 1 ([{fd=7, revents=POLLIN|POLLHUP}])
recvfrom(7, "", 2048, 0, NULL, NULL) = 0
poll([{fd=7, events=POLLIN}], 1, 60000) = 1 ([{fd=7, revents=POLLIN|POLLHUP}])
recvfrom(7, "", 2048, 0, NULL, NULL) = 0
...

I tried editing cups-browsed.conf. I changed the protocol to cups from dnssd, which gave the same problem. Changing to n one stopped the hang, but then I couldn't access the remote server.

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

I cannot reproduce the problem.

Can you run the commands

sudo stop cups-browsed
sudo /usr/sbin/cups-browsed --debug

Can you post the screen output here? Can you also strace this command and post the strace output here?

Changed in cups (Ubuntu):
status: New → Incomplete
affects: cups (Ubuntu) → cups-filters (Ubuntu)
Revision history for this message
Jeremy Sanders (jeremysanders) wrote :

Here is the strace (should note this is for BrowseRemoteProtocols dnssd, not cups, but both hang).

Revision history for this message
Jeremy Sanders (jeremysanders) wrote :

Sorry - messed up in previous attachement. Here is running as root.

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

Fixed problem upstream by preventing cups-browsed from acting on a remote CUPS daemon specified in client.conf. It now always works with the local CUPS daemon, ignoring client.conf.

Changed in cups-filters (Ubuntu):
status: Incomplete → Triaged
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

You can already try my fix before the new package gets available: To do so, stop cups-browsed

sudo stop cups-browsed

Then start it overriding client.conf:

sudo CUPS_SERVER=localhost /usr/sbin/cups-browsed

or

sudo CUPS_SERVER=/var/run/cups/cups.sock /usr/sbin/cups-browsed

Now run "top" in another terminal and try printing from apps or a further terminal. Is all working without cups-browsed taking all CPU?

Please try both cups-browsed commands. Stop the first one with Ctrl+C before starting the second one. After your tests stop the cups-browsed command with Ctrl+C again and start the system's cups-browsed via

sudo start cups-browsed

Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (4.3 KiB)

This bug was fixed in the package cups-filters - 1.0.36-0ubuntu1

---------------
cups-filters (1.0.36-0ubuntu1) saucy; urgency=low

  [ Till Kamppeter ]
  * New upstream release 1.0.36:
     - Fixed libdl detection in configure. Thanks to Andreas Huettel and
       Yuta Satoh (Gentoo bug #478642).
     - cups-browsed: Allow BrowsePoll operation also access print queues
       on older CUPS servers. Thanks to David Mohr for the patch.
     - cups-browsed: Assure that it always applies to the local CUPS
       daemon and never to a remote one specified via client.conf
       (LP: #1207203).
     - pdftoopvp, pdftoijs, pdftoraster, bannertopdf: Made code working
       with Poppler 0.24.x (Upstream bug #1144).
     - gstoraster: Silenced compiler warnings.
     - gstoraster, pdftoraster: Added support for PPD-less printing
       controlled by IPP attributes (CUPS 1.7.x+ only).
     - gstoraster, gstopxl: Moved these filters from Ghostscript to
       cups-filters as upstream home.
     - libcupsfilters: Added new cupsRasterParseIPPOptions() API
       function for PPD-less printing controlled by IPP attributes
       (raster.h, CUPS 1.7.x+ only).
     - pdftopdf: Added support for page labels. "page-label" option and
       "CLASSIFICATION" environment variable. Thanks to Tim Waugh from
       Red Hat for the patch.
     - pdftops: If one or more of the PDF-to-PS renderers (Ghostscript,
       Poppler pdftops, Poppler pdftocairo, acroread) is not installed
       at build time, pre-fill the appropriate executable's path with the
       executable name to allow the use of this renderer when it gets
       installed later (Closes: #716842).
     - cups-browsed: Do not resolve host names of remote printers discovered
       via CUPS broadcasts (Upstream bug #1141).
     - Added man pages for cups-browsed and cups-browsed.conf. Thanks to
       Brian Potkin for the contribution (Closes: #714460).
     - Install also escp.h, it is useful for .drv files.
  * New upstream release 1.0.35:
     - pdftoraster: Silenced compiler warning (Upstream bug #1092).
     - bannertopdf: Fixed typo which prevented the host name to be shown
       (Upstream bug #1115).
     - README: Fixed info about the PPD keyword cupsManualCopies (Upstream bug
       #1086).
     - Modified the cost factors of the filters to avoid unneeded PDF
       conversion detours when the input data is PostScript. Instead of
       pstopdf->pdftopdf->pdftops and pstopdf->pdftopdf->gstoraster we
       get pstops and pstops->gstoraster now (Upstream bug #1138).
     - pdftops: Added experimental support for pdftocairo as PDF renderer.
       Note that PostScript level 1 output and PDF input with color
       spaces other than DeviceRGB, DeviceGray, sRGB or sGray is not
       supported. PDFs generated by Cairo (for example when printing from
       evince) uses only supported color spaces. Thanks to James Cloos
       for the patch (Upstream bug #1139).
     - cups-browsed: Changed default of browsing protocols fron none to
       both DNS-SD and CUPS.
     - pdftops: Let Poppler generally generate PostScript level 3 if the
       PPD identifies the printer as PS3 printer, make an exception...

Read more...

Changed in cups-filters (Ubuntu):
status: Triaged → 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.