USB backend never ends if the printer is not connected

Bug #1890572 reported by Alejandro Claro on 2020-08-06
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
CUPS
New
Unknown
cups (Ubuntu)
Low
Unassigned

Bug Description

USB backend never ends if the printer is not connected. We have been able to identify a infinity loop in print_device function in usb-libusb.c file:

```
  fprintf(stderr, "DEBUG: Printing on printer with URI: %s\n", uri);
  while ((g.printer = find_device(print_cb, uri)) == NULL)
  {
    _cupsLangPrintFilter(stderr, "INFO",
    _("Waiting for printer to become available."));
    sleep(5);
  }
```

It's also easy to test by invoking the backend by hand:

```
# export DEVICE_URI='usb://Printer/Model?serial=?'
# /usr/lib/cups/backend/usb 0 root title 1 '' data.file

DEBUG: Loading USB quirks from "/usr/share/cups/usb".
DEBUG: Loaded 159 quirks.
DEBUG: Printing on printer with URI: usb://Printer/Model?serial=?
DEBUG: libusb_get_device_list=6
INFO: Waiting for printer to become available.
DEBUG: libusb_get_device_list=6
INFO: Waiting for printer to become available.
DEBUG: libusb_get_device_list=6
INFO: Waiting for printer to become available.
DEBUG: libusb_get_device_list=6
INFO: Waiting for printer to become available.
DEBUG: libusb_get_device_list=6
INFO: Waiting for printer to become available.
...

```

Setting a job timeout policy or manually stopping work are not options for us. We may have jobs that take hours to complete.

Alejandro Claro (aclaro) on 2020-08-06
description: updated
description: updated
description: updated
description: updated
Alejandro Claro (aclaro) wrote :

We have prepared a patch for the package in Ubuntu 18.04 (CUPS 2.2.7). We would like to request to include a solution like this for at least Ubuntu 18.04.

We also made a pull request in the official CUPS repository:

https://github.com/apple/cups/issues/5817
https://github.com/apple/cups/pull/5818

However, we don't have plans to upgrade or change the distribution we use (Ubuntu 18.04), and this issue is affecting us considerably.

The attachment "usb-libusb.c.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Mathew Hodson (mhodson) on 2020-10-03
Changed in cups (Ubuntu):
importance: Undecided → Low
Changed in cups:
status: Unknown → New
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

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