usb printer backend hangs when usblp kernel module is loaded

Bug #997040 reported by Aurimas Fišeras
42
This bug affects 7 people
Affects Status Importance Assigned to Milestone
cups (Ubuntu)
Fix Released
High
Unassigned
Precise
Fix Released
High
Till Kamppeter
libusb-1.0 (Ubuntu)
Invalid
Undecided
Unassigned
Precise
Invalid
Undecided
Unassigned
libusbx (Ubuntu)
Invalid
Undecided
Unassigned
Precise
Invalid
Undecided
Unassigned
linux (Ubuntu)
Invalid
Undecided
Unassigned
Precise
Invalid
Undecided
Unassigned

Bug Description

After update from oneiric to precise Samsung SCX-4200 usb printer prints one page and stops responding to CUPS. Turning the printer off and on crashes usb backend.

[IMPACT]

Many users of USB-connected Samsung printers are not able to print any more after the upgrade from Lucid LTS or Oneiric to Precise LTS. In Precise the problem was solved by an ugly workaround of blacklisting the usblp kernel module in the first CUPS SRU. This solution breaks printing for other users, those who use proprietary printer drivers with CUPS backends based on the old /dev/usb/lp* device files and also users who send jobs by directly sending data to the /dev/usb/lp* device files. This worked under Lucid LTS.

The libusb-based USB backend of CUPS was far from completely implemented. It lacked the ability to communicate uni-directionally with devices which are not able to communicate bi-directionally, refrain from re-attaching the usblp kernel module after printing for some devices, reset the printer after printing the job, ... In the proposed package these adaptations for devices with quirks are done in the USB backend. Especially this backend now works with said Samsung printers, without blacklisting the usblp module. So this second SRU is an improved solution.

[TESTCASE]

Unfortunately, for reproducing this bug one needs the actual hardware.

Connect a Samsung printer to the USB port of the computer.

With stock Precise (without updates) you will not be able to print. After applying the already available updates (including the first SRU for CUPS) you will be able to print, but only because the usblp kernel module is blacklisted. Remove the blacklisting via

sudo mv /etc/modprobe.d/blacklist-cups-usblp.conf ~
sudo modprobe usblp

and you will not be able to print any more.

After installing the proposed package the kernel module is not blacklisted any more and you will still be able to print.

If you are on a Precise with all updates and you have a print queue with an URI containing /dev/usb/lp* you will not be able to print. This worked with stock Precise and works again with the proposed package.

You can easily test this with any Ubuntu-supported USB printer:

lpadmin -p test -E -v parallel:/dev/usb/lp0 -m <PPD file which works with this printer>
lpadmin -p test -o PageSize=A4
lp- d test ~/.bashrc

The printing on this queue works on stock Precise, does not work on Precise with all updates (usblp is blacklisted) and works again with the proposed package.

[Regression Potential]

The patch looks perhaps more dramatic than it is. This is because several code sections are put into "if" blocks, indenting all the (unchanged) code lines. This especially happens because now we suppress using the back channel for selected printers (and also printers which claim to be uni-directional only).

The code was developed in several steps and uploaded step-by-step to my PPA. There the reporters of the bugs covered by this SRU and some additional bugs (bug 902535, bug 995111) tested it intensively. They did not hit any regressions compared to stock Precise or the first CUPS SRU.

The code is also applied to the CUPS package in Quantal and this also did not cause any regression bug report yet.

I have tested the code on four HP printers (HP LaserJet 3390, HP Color LaserJet CM3530 MFP, HP PhotoSmart C8100, HP PhotoSmart C5200, all on direct USB) and one Epson printer (Epson Stylus Photo 880, both direct USB and parallel with Prolific USB -> Parallel adaptor) and all work fine, no regressions.

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: cups 1.5.2-9ubuntu1
ProcVersionSignature: Ubuntu 3.2.0-24.37-generic 3.2.14
Uname: Linux 3.2.0-24-generic i686
ApportVersion: 2.0.1-0ubuntu7
Architecture: i386
Date: Wed May 9 13:23:47 2012
Lpstat: device for Samsung_SCX-4200_Series: usb://Samsung/SCX-4200%20Series?serial=8T66BADQ207127T.&interface=1
Lsusb:
 Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
 Bus 001 Device 002: ID 046d:c03e Logitech, Inc. Premium Optical Wheel Mouse (M-BT58)
 Bus 001 Device 004: ID 04e8:341b Samsung Electronics Co., Ltd SCX-4200 series
MachineType: Hewlett-Packard HP Vectra
Papersize: letter
PpdFiles: Samsung_SCX-4200_Series: Samsung SCX-4200, 2.0.0
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-3.2.0-24-generic root=UUID=8bffe6fd-56b5-46d1-b332-ba7f756f4244 ro quiet splash acpi=force vt.handoff=7
SourcePackage: cups
UpgradeStatus: Upgraded to precise on 2012-05-09 (0 days ago)
dmi.bios.date: 11/23/99
dmi.bios.vendor: Phoenix Technologies Ltd.
dmi.bios.version: HZ.01.10US
dmi.board.name: HP Holmes System Board
dmi.board.vendor: Hewlett-Packard
dmi.board.version: D4066-60001
dmi.chassis.asset.tag: N/A
dmi.chassis.type: 3
dmi.chassis.vendor: Hewlett-Packard
dmi.chassis.version: N/A
dmi.modalias: dmi:bvnPhoenixTechnologiesLtd.:bvrHZ.01.10US:bd11/23/99:svnHewlett-Packard:pnHPVectra:pvrVLi8:rvnHewlett-Packard:rnHPHolmesSystemBoard:rvrD4066-60001:cvnHewlett-Packard:ct3:cvrN/A:
dmi.product.name: HP Vectra
dmi.product.version: VLi8
dmi.sys.vendor: Hewlett-Packard
modified.conffile..etc.cups.cupsd.conf.default: [deleted]
mtime.conffile..etc.cups.cupsd.conf: 2012-05-09T13:05:57.439873

Revision history for this message
Aurimas Fišeras (aurimas-gmail) wrote :
Revision history for this message
Aurimas Fišeras (aurimas-gmail) wrote :

.crash file form this crash

Revision history for this message
Aurimas Fišeras (aurimas-gmail) wrote :

One more thing: if I blacklist usblp, then the printer works as expected.

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

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

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

Please add my PPA to your system as described on

https://launchpad.net/~till-kamppeter/+archive/ppa

and update your system. This should give you an update of the CUPS packages (version 1.5.2-9ubuntu1.1~ppa2). Please cancel all jobs and turn off and turn on your printer again. Then try whether your problem gets solved.

Revision history for this message
Aurimas Fišeras (aurimas-gmail) wrote :

Updated CUPS does not crash anymore. However, the printer still stops responding after random number of successfully printed pages.

Blacklisting usblp still works.

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

Now please try uninstalling system-config-printer-udev by
entering the following command in a terminal window:

sudo dpkg -P --force-depends system-config-printer-udev

Then remove all jobs with

cancel -a

remove also the blacklisting and turn off and turn on your printer. Now try to print. Does it work
normally now? Can you print an arbitrary number of jobs?

If this still does not help, try uninstalling foo2zjs:

sudo dpkg -P --force-depends foo2zjs

Remove all jobs, turn off and turn on the printer again and try whether
this helps.

Revision history for this message
Aurimas Fišeras (aurimas-gmail) wrote :

Both packages are not present:
dpkg: warning: there's no installed package matching system-config-printer-udev
dpkg: warning: there's no installed package matching foo2zjs

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

Sorry, the foo2zjs package got renamed. Do

sudo dpkg -P --force-depends printer-driver-foo2zjs

Remove all jobs, turn off and turn on the printer again and try whether this helps.

Restore your system with

sudo apt-get install -f

Revision history for this message
Aurimas Fišeras (aurimas-gmail) wrote :

This package is not installed too:
dpkg: warning: there's no installed package matching printer-driver-foo2zjs

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

Can you update your system to get cups 1.5.2-9ubuntu1.1~ppa3 from my PPA? Please make sure that the usblp kernel module is not blacklisted and turn off and turn on your printer. Now test whether your remaining problems go away.

Revision history for this message
Aurimas Fišeras (aurimas-gmail) wrote :

Updated to cups 1.5.2-9ubuntu1.1~ppa3. Still the same problem - the printer stops responding after 1-3 successfully printed jobs.

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

This bug was fixed in the package cups - 1.5.3-1

---------------
cups (1.5.3-1) unstable; urgency=low

  [ Till Kamppeter ]
  * New upstream release
     - Numerous fixes on IPP (LP: #945028, LP: #973270, LP: #990734,
       LP: #992468, LP: #992982, LP: #1000172, LP: #1000758)
     - USB backend based on the maintained libusb 1.0.x with support for
       bi-directional communication
     - Fixes on SNMP-based supply level reporting
     - PostScript prtinter auto-configuration reliable now
     - Several fixes on PostScript, SSL, authenticated printing, and
       networking issues
  * debian/patches/ipp-fixes-1.5.3.patch,
    debian/patches/fix-empty-translations.patch,
    debian/patches/ppd-cache-fix-crash.patch,
    debian/patches/commandtops-make-robust-against-broken-postscript.patch,
    debian/patches/cups-polld-reconnect.patch,
    debian/patches/usb-backend-libusb-1.0.patch,
    debian/patches/usb-backend-backchannel-support.patch: Removed patches which
    got included upstream.
  * debian/patches/fix-supply-level-computation-for-percent-supply-unit.patch,
    debian/patches/fix-supply-levels-for-enumerated-prtmarkersupplieslevel.patch,
    debian/patches/fix-status-reports-when-supply-levels-grow.patch,
    debian/patches/add-status-reports-for-full-waste-trays-and-cleaner-unit-eol.patch,
    debian/patches/match-marker-colorants-which-use-non-standard-string.patch,
    debian/patches/truncate-marker-supply-names-at-comma.patch: Removed supply
    level report fixes. This got solved differently upstream.
  * debian/patches/do-not-suppress-inputslot-setting-with-empty-ap-d-inputslot.patch:
    Removed, problem solved differently upstream.
  * debian/patches/cups-avahi.patch: Manually regenerated to adapt to upstream
    changes.
  * debian/patches/ppd-poll-with-client-conf.patch,
    debian/patches/colord-support.patch,
    debian/patches/airprint-support.patch,
    debian/patches/no-conffile-timestamp.patch,
    debian/patches/drop_unnecessary_dependencies.patch,
    debian/patches/read-embedded-options-from-incoming-postscript-and-add-to-ipp-attrs.patch,
    debian/patches/show-compile-command-lines.patch: Refreshed using quilt.
  * debian/patches/usb-backend-busy-loop-fix.patch: Correct loops to repeat
    claiming interfaces on USB devices when they are busy. Before, hitting busy
    state made the device opening function error out without comment
    (LP: #987485).
  * debian/patches/usb-backend-detach-usblp-earlier-crash-guards.patch: Protect
    against crashes by checking error codes of libusb functions (LP: #997040)
    and detach usblp kernel module in an earlier stage when opening a device
    (LP: #987485, LP: #997040).
  * debian/patches/usb-backend-initialize-usblp-attached-state.patch: Initialize
    usblp_attached field in printer data structure to assure that detaching
    and re-attaching the usblp kernel module is always done correctly
    (LP: #902535, LP: #959676, LP: #960666, LP: #987485,
    LP: #995111, LP: #997040, LP: #1000253, LP: #1001028).
  * debian/patches/install-sh-remove-bashism.patch: Removed bashism.
  * debian/local/blacklist-cups-usblp.conf, debian/cups.postinst,
    debian/cups.install: Bla...

Read more...

Changed in cups (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

New CUPS package with the following (and some addtional) fixes uploaded to precise-proposed (proposed updates for 12.04 (Precise)):

 - Crash and busy loop fixes on the USB backend
 - "usblp" kernel module blacklisted again as it also causes problems with the new USB backend
 - Lots of fixes on the IPP backend and also on the IPP server part in the CUPS daemon
 - Other networking issues

These fixes should address most of the bugs reported shortly after the release of Precise, especially the problems with USB printing and network printing. As soon as the package is approved and made available for testing and additional comment with installation instructions will get posted here. Please test the new package then and report here whether this solves your problems. We will decide on the results whether the package will be made an official update for Precise.

Please remove/cancel all jobs and turn off and turn on your printer before testing.

debdiff attached.

Changed in cups (Ubuntu Precise):
status: New → Fix Committed
importance: Undecided → High
Changed in cups (Ubuntu):
importance: Undecided → High
Changed in cups (Ubuntu Precise):
milestone: none → precise-updates
Revision history for this message
Martin Pitt (pitti) wrote : Please test proposed package

Hello Aurimas, or anyone else affected,

Accepted cups into precise-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
Revision history for this message
Till Kamppeter (till-kamppeter) wrote : Re: usb printer backend crashes

Aurimas, can you please install the CUPS packages from -proposed (deactivate my PPA) and check whether with these packages the USB backend does not crash? We need to know this for making the CUPS packages in -proposed and official update.

Revision history for this message
Aurimas Fišeras (aurimas-gmail) wrote :

No crashes with CUPS from -proposed.

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

Aurimas, thank you for testing. Marking bug as verified.

tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (3.8 KiB)

This bug was fixed in the package cups - 1.5.3-0ubuntu1

---------------
cups (1.5.3-0ubuntu1) precise-proposed; urgency=low

  [ Till Kamppeter ]
  * New upstream release
     - Numerous fixes on IPP (LP: #945028, LP: #973270, LP: #990734,
       LP: #992468, LP: #992982, LP: #1000172, LP: #1000758)
     - USB backend based on the maintained libusb 1.0.x with support for
       bi-directional communication
     - Fixes on SNMP-based supply level reporting
     - PostScript prtinter auto-configuration reliable now
     - Several fixes on PostScript, SSL, authenticated printing, and
       networking issues
  * debian/patches/ipp-fixes-1.5.3.patch,
    debian/patches/fix-empty-translations.patch,
    debian/patches/ppd-cache-fix-crash.patch,
    debian/patches/commandtops-make-robust-against-broken-postscript.patch,
    debian/patches/cups-polld-reconnect.patch,
    debian/patches/usb-backend-libusb-1.0.patch,
    debian/patches/usb-backend-backchannel-support.patch: Removed patches which
    got included upstream.
  * debian/patches/fix-supply-level-computation-for-percent-supply-unit.patch,
    debian/patches/fix-supply-levels-for-enumerated-prtmarkersupplieslevel.patch,
    debian/patches/fix-status-reports-when-supply-levels-grow.patch,
    debian/patches/add-status-reports-for-full-waste-trays-and-cleaner-unit-eol.patch,
    debian/patches/match-marker-colorants-which-use-non-standard-string.patch,
    debian/patches/truncate-marker-supply-names-at-comma.patch: Removed supply
    level report fixes. This got solved differently upstream.
  * debian/patches/do-not-suppress-inputslot-setting-with-empty-ap-d-inputslot.patch:
    Removed, problem solved differently upstream.
  * debian/patches/cups-avahi.patch: Manually regenerated to adapt to upstream
    changes.
  * debian/patches/ppd-poll-with-client-conf.patch,
    debian/patches/colord-support.patch,
    debian/patches/airprint-support.patch,
    debian/patches/no-conffile-timestamp.patch,
    debian/patches/drop_unnecessary_dependencies.patch,
    debian/patches/read-embedded-options-from-incoming-postscript-and-add-to-ipp-attrs.patch,
    debian/patches/show-compile-command-lines.patch: Refreshed using quilt.
  * debian/patches/usb-backend-busy-loop-fix.patch: Correct loops to repeat
    claiming interfaces on USB devices when they are busy. Before, hitting busy
    state made the device opening function error out without comment
    (LP: #987485).
  * debian/patches/usb-backend-detach-usblp-earlier-crash-guards.patch: Protect
    against crashes by checking error codes of libusb functions (LP: #997040)
    and detach usblp kernel module in an earlier stage when opening a device
    (LP: #987485, LP: #997040).
  * debian/patches/usb-backend-initialize-usblp-attached-state.patch: Initialize
    usblp_attached field in printer data structure to assure that detaching
    and re-attaching the usblp kernel module is always done correctly
    (LP: #902535, LP: #959676, LP: #960666, LP: #987485,
    LP: #995111, LP: #997040, LP: #1000253, LP: #1001028).
  * debian/patches/install-sh-remove-bashism.patch: Removed bashism.
  * debian/local/blacklist-cups-usblp.conf, debian/cups.postinst,
    de...

Read more...

Changed in cups (Ubuntu Precise):
status: Fix Committed → Fix Released
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

I want to ask you to do another test, so that we can find out whether we can stop blacklisting the usblp kernel module:

I have uploaded a modified CUPS package to my PPA now. Please add my PPA to your system as described on

https://launchpad.net/~till-kamppeter/+archive/ppa

in the section "Adding this PPA to your system" and then install the new CUPS package, preferably by simply doing a full system update. The CUPS version must be 1.5.3-0ubuntu2~ppa2.

Now turn off and turn on your USB printer and re-plug the USB (with the printer turned on). Try to print. does it work now?

Independent whether printing works for you now or not, reactivate the usblp kernel module by running the following two commands in a terminal window:

sudo mv /etc/modprobe.d/blacklist-cups-usblp.conf ~
sudo modprobe usblp

Turn off and turn on your printer again and re-plug the USB (with the printer turned on). Try to print again. does it also work now?

If it works, you are done. If it worked in the first test and stopped in the second, return to the configuration of the first test by running the following commands in a terminal window:

sudo mv ~/blacklist-cups-usblp.conf /etc/modprobe.d/
sudo rmmod usblp

Revision history for this message
Aurimas Fišeras (aurimas-gmail) wrote :

Upgraded CUPS to 1.5.3-0ubuntu2~ppa2.

Printer status:
"Waiting for printer to become available."

dmesg shows this line repetedly:
[ 91.773332] usb 1-2: usbfs: process 838 (usb) did not claim interface 1 before use

Removed usblp from blacklist, modprobe'd it.
Printer status:
"Waiting for printer to become available."

dmesg shows:
[ 200.807475] usblp0: USB Bidirectional printer dev 2 if 1 alt 0 proto 2 vid 0x04E8 pid 0x341B
[ 200.807604] usbcore: registered new interface driver usblp
[ 204.024700] usblp0: removed
[ 204.024798] usb 1-2: usbfs: process 1113 (usb) did not claim interface 1 before use

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

Did you turn off and turn on the printer and cancel all pending print jobs before each test?

Revision history for this message
Aurimas Fišeras (aurimas-gmail) wrote :

Reran the test to the letter.
Same result with or without usblp - "Waiting for printer to become available."
Turning the printer on/off has no effect.

[ 498.400172] usb 1-2: USB disconnect, device number 2
[ 502.084102] usb 1-2: new full-speed USB device number 3 using uhci_hcd
[ 535.352175] usb 1-2: USB disconnect, device number 3
[ 538.072117] usb 1-2: new full-speed USB device number 4 using uhci_hcd
[ 551.654143] usb 1-2: usbfs: process 1114 (usb) did not claim interface 1 before use
...
[ 606.739712] usb 1-2: usbfs: process 1114 (usb) did not claim interface 1 before use
[ 610.516523] usblp0: USB Bidirectional printer dev 4 if 1 alt 0 proto 2 vid 0x04E8 pid 0x341B
[ 610.516650] usbcore: registered new interface driver usblp
[ 611.747549] usblp0: removed
[ 611.747633] usb 1-2: usbfs: process 1114 (usb) did not claim interface 1 before use
[ 631.328167] usb 1-2: USB disconnect, device number 4
[ 635.660105] usb 1-2: new full-speed USB device number 5 using uhci_hcd
[ 635.843492] usblp0: USB Bidirectional printer dev 5 if 1 alt 0 proto 2 vid 0x04E8 pid 0x341B
[ 652.160171] usb 1-2: USB disconnect, device number 5
[ 652.166071] usblp0: removed
[ 655.404096] usb 1-2: new full-speed USB device number 6 using uhci_hcd
[ 655.580538] usblp0: USB Bidirectional printer dev 6 if 1 alt 0 proto 2 vid 0x04E8 pid 0x341B
[ 668.570873] usblp0: removed
[ 668.570993] usb 1-2: usbfs: process 1155 (usb) did not claim interface 1 before use
...

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

My CUPS upload to my PPA (1.5.3-0ubuntu2~ppa2) is broken. In some hours the new version 1.5.3-0ubuntu2~ppa3 will be available. Please wait for this new version, update your system then, check whether you actually have 1.5.3-0ubuntu2~ppa3 and then do the tests of comment #20 again.

Revision history for this message
Aurimas Fišeras (aurimas-gmail) wrote :

Updated CUPS to 1.5.3-0ubuntu2~ppa3

Both tests produce the same result - "Waiting for printer to become available." No jobs printed.

However, dmesg doesn't show any errors:
[ 227.072164] usb 1-2: USB disconnect, device number 2
[ 231.776106] usb 1-2: new full-speed USB device number 3 using uhci_hcd
[ 323.436356] usblp0: USB Bidirectional printer dev 3 if 1 alt 0 proto 2 vid 0x04E8 pid 0x341B
[ 323.436482] usbcore: registered new interface driver usblp
[ 331.000185] usb 1-2: USB disconnect, device number 3
[ 331.006089] usblp0: removed
[ 336.944103] usb 1-2: new full-speed USB device number 4 using uhci_hcd
[ 337.127441] usblp0: USB Bidirectional printer dev 4 if 1 alt 0 proto 2 vid 0x04E8 pid 0x341B
[ 420.604752] usblp0: removed

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

Next testing round to get the USB backend working: In some hours cups 1.5.3-0ubuntu2~ppa4 will be available on my PPA, update your system to get it, check whether you actually got it, and do the tests of comment #20 again. For each failed test attach the error_log and /var/log/syslog, thanks.

Revision history for this message
Aurimas Fišeras (aurimas-gmail) wrote :

Test 1 with usblp blacklisted - "Waiting for printer to become available." Job not printed.

cat /var/log/syslog
Jun 13 17:19:54 mcprek4 kernel: [ 253.221086] type=1400 audit(1339597194.155:16): apparmor="STATUS" operation="profile_replace" name="/usr/lib/cups/backend/cups-pdf" pid=1415 comm="apparmor_parser"
Jun 13 17:19:54 mcprek4 kernel: [ 253.225846] type=1400 audit(1339597194.159:17): apparmor="STATUS" operation="profile_replace" name="/usr/sbin/cupsd" pid=1415 comm="apparmor_parser"
Jun 13 17:20:02 mcprek4 kernel: [ 261.296172] usb 1-2: USB disconnect, device number 2
Jun 13 17:20:08 mcprek4 kernel: [ 267.412107] usb 1-2: new full-speed USB device number 3 using uhci_hcd

Revision history for this message
Aurimas Fišeras (aurimas-gmail) wrote :

Test 2 without usblp blacklist - "Waiting for printer to become available." Job not printed.

/var/log/syslog

Jun 13 17:27:54 mcprek4 kernel: [ 97.973150] audit_printk_skb: 3 callbacks suppressed
Jun 13 17:27:54 mcprek4 kernel: [ 97.973171] type=1400 audit(1339597674.911:13): apparmor="STATUS" operation="profile_replace" name="/usr/lib/cups/backend/cups-pdf" pid=1190 comm="apparmor_parser"
Jun 13 17:27:54 mcprek4 kernel: [ 97.978194] type=1400 audit(1339597674.915:14): apparmor="STATUS" operation="profile_replace" name="/usr/sbin/cupsd" pid=1190 comm="apparmor_parser"
Jun 13 17:28:10 mcprek4 kernel: [ 113.240163] usb 1-2: USB disconnect, device number 2
Jun 13 17:28:10 mcprek4 kernel: [ 113.246123] usblp0: removed
Jun 13 17:28:24 mcprek4 kernel: [ 127.412105] usb 1-2: new full-speed USB device number 3 using uhci_hcd
Jun 13 17:28:24 mcprek4 kernel: [ 127.591485] usblp0: USB Bidirectional printer dev 3 if 1 alt 0 proto 2 vid 0x04E8 pid 0x341B
Jun 13 17:28:58 mcprek4 kernel: [ 161.068145] usblp0: removed

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

New version uploaded which does not do an initial reset on the printer (~ppa5). please do the same tests with this version.

Revision history for this message
Aurimas Fišeras (aurimas-gmail) wrote :

Test 1, when usblp is blacklisted - everything works.

Test 2, the printer prints several pages successfully, then stops responding. CUPS shows "Rendering completed". After power cycling the printer and restarting the job, printer prints several more pages before stopping.

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

Unfortunately, your error_log files do not contain the relevant information as for your CUPS the CUPS-internal default log rotating seems to be active. This restricts logs to a size of 1 MB discarding the needed information within minutes. Your logs cover only ~30 min.

So run

cupsctl MaxLogSize=0

and do all your tests again.

Note that MaxLogSize=0 is a Ubuntu default which we introduced as we did not get useful error_log files on bug reports. Ubuntu uses the central logrotate facility which restarts logging once in 24 hours and archives the logs of the last 7 days.

Revision history for this message
Aurimas Fišeras (aurimas-gmail) wrote :

Sorry for the irrelevant error_log file earlier today.

This one contains information about the hanging job 32951.

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

Next testing round: cups 1.5.3-0ubuntu2~ppa7 is uploaded to my PPA now and this respects uni-directional devices and gives some more messages in error_log.

Please repeat the tests with it (with and without blacklisting usblp) and attach syslog and error_log of the failing tests.

In addition, you can try to force uni-directional mode by

lpadmin -p <queue> -o usb-unidir-default=true

and restore to normal mode via

lpadmin -p <queue> -o usb-unidir-default=false

For <queue> the name of your print queue has to be inserted.

Please repeat your tests with forced uni-directional mode.

Revision history for this message
Aurimas Fišeras (aurimas-gmail) wrote :

With usblp blacklisted - everything works (did not test usb-unidir-default=true in this case).

When usblp is not blacklisted:
Jun 15 10:42:37 mcprek4 kernel: [ 65.370530] audit_printk_skb: 3 callbacks suppressed
Jun 15 10:42:37 mcprek4 kernel: [ 65.370550] type=1400 audit(1339746157.300:13): apparmor="STATUS" operation="profile_replace" name="/usr/lib/cups/backend/cups-pdf" pid=1172 comm="apparmor_parser"
Jun 15 10:42:37 mcprek4 kernel: [ 65.378893] type=1400 audit(1339746157.308:14): apparmor="STATUS" operation="profile_replace" name="/usr/sbin/cupsd" pid=1172 comm="apparmor_parser"
Jun 15 10:42:42 mcprek4 kernel: [ 70.584173] usb 1-1: USB disconnect, device number 2
Jun 15 10:42:42 mcprek4 kernel: [ 70.590193] usblp0: removed
Jun 15 10:42:46 mcprek4 kernel: [ 74.792106] usb 1-1: new full-speed USB device number 3 using uhci_hcd
Jun 15 10:42:46 mcprek4 kernel: [ 74.971457] usblp0: USB Bidirectional printer dev 3 if 1 alt 0 proto 2 vid 0x04E8 pid 0x341B
Jun 15 10:42:56 mcprek4 kernel: [ 84.342362] usblp0: removed
Jun 15 10:43:19 mcprek4 kernel: [ 107.611910] usblp0: USB Bidirectional printer dev 3 if 1 alt 0 proto 2 vid 0x04E8 pid 0x341B
Jun 15 10:44:36 mcprek4 kernel: [ 184.270747] usblp0: removed
Jun 15 10:44:56 mcprek4 kernel: [ 204.648783] usblp0: USB Bidirectional printer dev 3 if 1 alt 0 proto 2 vid 0x04E8 pid 0x341B
Jun 15 10:45:10 mcprek4 kernel: [ 218.640172] usb 1-1: USB disconnect, device number 3
Jun 15 10:45:10 mcprek4 kernel: [ 218.648305] usblp0: removed
Jun 15 10:45:16 mcprek4 kernel: [ 224.408175] usb 1-1: new full-speed USB device number 4 using uhci_hcd
Jun 15 10:45:16 mcprek4 kernel: [ 224.584529] usblp0: USB Bidirectional printer dev 4 if 1 alt 0 proto 2 vid 0x04E8 pid 0x341B
Jun 15 10:45:21 mcprek4 kernel: [ 229.610385] usblp0: removed
Jun 15 10:45:40 mcprek4 kernel: [ 248.777551] usblp0: USB Bidirectional printer dev 4 if 1 alt 0 proto 2 vid 0x04E8 pid 0x341B
Jun 15 10:49:58 mcprek4 kernel: [ 506.469079] usblp0: removed
Jun 15 10:50:18 mcprek4 kernel: [ 526.876918] usblp0: USB Bidirectional printer dev 4 if 1 alt 0 proto 2 vid 0x04E8 pid 0x341B
Jun 15 10:50:42 mcprek4 kernel: [ 550.728172] usb 1-1: USB disconnect, device number 4
Jun 15 10:50:42 mcprek4 kernel: [ 550.736298] usblp0: removed
Jun 15 10:50:47 mcprek4 kernel: [ 555.184117] usb 1-1: new full-speed USB device number 5 using uhci_hcd
Jun 15 10:50:47 mcprek4 kernel: [ 555.363460] usblp0: USB Bidirectional printer dev 5 if 1 alt 0 proto 2 vid 0x04E8 pid 0x341B
Jun 15 10:51:19 mcprek4 kernel: [ 587.104133] usblp0: removed
Jun 15 10:51:39 mcprek4 kernel: [ 607.552854] usblp0: USB Bidirectional printer dev 5 if 1 alt 0 proto 2 vid 0x04E8 pid 0x341B
Jun 15 10:51:43 mcprek4 kernel: [ 611.825536] usblp0: removed

Revision history for this message
Aurimas Fišeras (aurimas-gmail) wrote :

When usblp is not blacklisted and usb-unidir-default=true - same problem, printer eventually hangs.

syslog:
Jun 15 11:00:21 mcprek4 kernel: [ 1129.726816] type=1400 audit(1339747221.656:15): apparmor="STATUS" operation="profile_replace" name="/usr/lib/cups/backend/cups-pdf" pid=1462 comm="apparmor_parser"
Jun 15 11:00:21 mcprek4 kernel: [ 1129.735018] type=1400 audit(1339747221.664:16): apparmor="STATUS" operation="profile_replace" name="/usr/sbin/cupsd" pid=1462 comm="apparmor_parser"
Jun 15 11:00:29 mcprek4 kernel: [ 1137.744169] usb 1-1: USB disconnect, device number 5
Jun 15 11:00:33 mcprek4 kernel: [ 1141.952106] usb 1-1: new full-speed USB device number 6 using uhci_hcd
Jun 15 11:00:34 mcprek4 kernel: [ 1142.131455] usblp0: USB Bidirectional printer dev 6 if 1 alt 0 proto 2 vid 0x04E8 pid 0x341B
Jun 15 11:03:47 mcprek4 kernel: [ 1335.147632] usblp0: removed
Jun 15 11:03:58 mcprek4 kernel: [ 1346.555667] usblp0: USB Bidirectional printer dev 6 if 1 alt 0 proto 2 vid 0x04E8 pid 0x341B
Jun 15 11:04:30 mcprek4 kernel: [ 1378.233155] usblp0: removed
Jun 15 11:04:41 mcprek4 kernel: [ 1389.433557] usblp0: USB Bidirectional printer dev 6 if 1 alt 0 proto 2 vid 0x04E8 pid 0x341B
Jun 15 11:04:54 mcprek4 kernel: [ 1402.903747] usblp0: removed

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

Can you do this testing again and as soon as you get a hanging job, check whether the usblp kernel module is attached to the printer or not.

To do so,when starting the (cancel jobs, power-cycle printer) run the command:

ls -l /dev/usb/lp*

This should give at least one line of output (make sure usblp is not blacklisted). You can see which line corresponds to your printer via

sudo usb_printerid /dev/usb/lp0
sudo usb_printerid /dev/usb/lp1
...

Now print your jobs. You can observe that during data transfer of each job the line for your printer in

ls -l /dev/usb/lp*

disappears and reappears after completion of the data transfer to the printer.

As soon as a job hangs, DO NOT cancel it and run the commands

ls -l /dev/usb/lp*
ps auxwww | grep usb:

and post the output here. Does the line for your printer appear in the "ls -l /dev/usb/lp*" output?

Revision history for this message
Aurimas Fišeras (aurimas-gmail) wrote :

When the job hangs, I see:

ls -l /dev/usb/lp*
ls: cannot access /dev/usb/lp*: No such file or directory

ps auxwww | grep usb
lp 2243 0.8 1.1 37020 2804 ? Sl 14:30 0:01 Samsung_SCX-4200_Series 32966 anonymous Test Page 1 job-uuid=urn:uuid:d674bfa7-ab5d-3105-4062-fe488128f865 nousb-unidir job-originating-host-name=localhost time-at-creation=1339759834 time-at-processing=1339759834
root 2244 0.0 0.5 23708 1396 ? Sl 14:30 0:00 usb://Samsung/SCX-4200%20Series?serial=8T66BADQ207127T.&interface=1 32966 anonymous Test Page 1 job-uuid=urn:uuid:d674bfa7-ab5d-3105-4062-fe488128f865 nousb-unidir job-originating-host-name=localhost time-at-creation=1339759834 time-at-processing=1339759834
it 3526 0.0 0.3 5596 800 pts/1 S+ 14:33 0:00 grep --color=auto usb

Revision history for this message
Aurimas Fišeras (aurimas-gmail) wrote :

When the printer is idle:

ls -l /dev/usb/lp*
crw-rw---- 1 root lp 180, 0 Jun 15 14:34 /dev/usb/lp0

sudo usb_printerid /dev/usb/lp0
GET_DEVICE_ID string:
MFG:Samsung;CMD:GDI;MDL:SCX-4200 Series;CLS:PRINTER;MODE:PCL;STATUS:IDLE;

summary: - usb printer backend crashes
+ usb printer backend hangs when usblp kernel module is loaded
Changed in libusb-1.0 (Ubuntu):
status: New → Invalid
Changed in libusbx (Ubuntu Precise):
status: New → Invalid
Brad Figg (brad-figg)
Changed in linux (Ubuntu):
status: New → Confirmed
Changed in linux (Ubuntu Precise):
status: New → Confirmed
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Adding tasks for kernel and libusb 1.0.x ...

To the developers and packagers of kernel and libusb, the CUPS printing backend (source code attached) accesses printers with libusb 1.0.x. To be able to access in all situations, it detaches the kernel module from the printer right after libusb_open() (function open_device() in attached source file) and re-attaches it right before libusb_close() (function close_device() in attached file). Only after detaching the module it switches to the needed configuration (if needed), clkaims the interface, and selects the alt setting (function open_device()). Then it reqyests the device ID to check whether the desired printer is selected and after that does the I/O, taking into account if the interface's protocol is 1 or if there is no read endpoint that no read thread is started. After that the interface is released, the configuration is restored if it was switched in the beginning and the usblp module re-attached.

Printers are assigned to the print queues by their make/model/serial number in CUPS and to select the correct USB device the function find_device() in the attached file walks through all devices and searches for interfaces of class 7 and subclass 1 and requests the device ID from this one. It stops if the ID matches and send the job to this device.

If the usblp module is not loaded (blacklisted) all works fine. The detaching and re-attaching does not happen but all the rest is done as described. In this situation one can send arbitrarily many print jobs and they all get perfectly printed.

The problem comes when the usblp module is present. Only the walk through the devices to find the correct printer still works, so the method described above works perfectly if one opens the devices only for requesting the device ID. But if one does real I/O (sending a job) this works several times and then suddenly the I/O is not accepted any more. Right after reading the device ID, when starting to send data to (and request data from) the device, the device does not react and the I/O functions of libusb report a timeout. This is independent of whether one does bi-directional I/O (sending the job data and also reading what comes back from the printer) or uni-directional I/O (only sending data, no back channel).

You can see the timeout messages in the last two attached error_log files in the last job in each file. The timeout is always exactly 1 minute after trying to write data to or read data from the device.

Please ask the original poster of the bug for more information if needed.

bug 995111 is most probably the same problem, please also contact the poster of that bug.

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

Only to be sure, can you do the tests of comment #36 with cups 1.5.3-0ubuntu2~ppa9 from my PPA? Thanks.

Revision history for this message
Aurimas Fišeras (aurimas-gmail) wrote :

Updated CUPS to 1.5.3-0ubuntu2~ppa9.
Tested with usblp not blacklisted. After several successfully printed jobs, CUPS job hangs with "Rendering completed",

grep 32970 /var/log/cups/error_log returns same errors as before:
D [18/Jun/2012:16:22:17 +0300] [Job 32970] Got USB transaction timeout during read.
D [18/Jun/2012:16:22:29 +0300] [Job 32970] Got USB transaction timeout during write.

ls -l /dev/usb/lp*
ls: cannot access /dev/usb/lp*: No such file or directory

ps auxwww | grep usb
lp 3093 0.3 1.1 37020 2804 ? Sl 16:19 0:01 Samsung_SCX-4200_Series 32970 anonymous Test Page 1 job-uuid=urn:uuid:50cca4a5-31a5-335f-55e1-1c4855b2c7a8 nousb-unidir job-originating-host-name=localhost time-at-creation=1340025556 time-at-processing=1340025556
root 3094 0.0 0.5 23708 1396 ? Sl 16:19 0:00 usb://Samsung/SCX-4200%20Series?serial=8T66BADQ207127T.&interface=1 32970 anonymous Test Page 1 job-uuid=urn:uuid:50cca4a5-31a5-335f-55e1-1c4855b2c7a8 nousb-unidir job-originating-host-name=localhost time-at-creation=1340025556 time-at-processing=1340025556
it 3172 0.0 0.3 5596 796 pts/0 S+ 16:26 0:00 grep --color=auto usb

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

Aurimas, thank you very much for testing again. Now it really seems that there is a problem with libusb or the kernel.

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

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

Changed in libusb-1.0 (Ubuntu Precise):
status: New → Confirmed
Changed in libusbx (Ubuntu):
status: New → Confirmed
Revision history for this message
Stéphane Bidoul (Acsone) (sbi) wrote :

Hello,

It seems I'm having the same issue with a Canon IP 4200, with repeated error messages in /var/log/cups/error_log:
D [24/Jun/2012:20:03:56 +0200] [Job 4] Got USB transaction timeout during write
D [24/Jun/2012:20:03:56 +0200] [Job 4] Got USB transaction timeout during read

Sometime it prints a few pages before blocking, sometimes it does not print all.

I tested tonight with cups 1.5.3-0ubuntu2~ppa11.

Let me know if I can help testing or producing debug logs.

Best regards,

-sbi

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

Stéphane, can you try forced uni-directional mode as described in comment #33? Thanks.

Revision history for this message
Stéphane Bidoul (Acsone) (sbi) wrote :

I tested with forced uni-directional mode and the problem persists.

A few additional comments:
- I don't have the usblp module
- the problem appeared when upgrading from 10.04 to 12.04 (server)
- the same printer works fine on another machine on 11.10 (desktop)

-sbi

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

Can you all try cups 1.5.3-0ubuntu2~ppa12 from my PPA? This could solve the problem. Test it, with and without the blacklisting of usblp and with and without forcing uni-directional mode and tell whether it works. Especially I want to know whether it actually works without blacklisting and without forcing uni-directional now.

Independent whether it works, please attach your error_log.

Revision history for this message
Aurimas Fišeras (aurimas-gmail) wrote :

Updated CUPS to 1.5.3-0ubuntu2~ppa12.

With usblp not blacklisted and without forcing uni-directional, print jobs still hang with "USB transaction timeout during read/write".

Revision history for this message
Aurimas Fišeras (aurimas-gmail) wrote :

Forcing uni-directional mode doesn't make any difference - jobs still hang.

Revision history for this message
Aurimas Fišeras (aurimas-gmail) wrote :

Oops, wrong error logs.

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

Can you run the command

sudo chmod -x /lib/udev/udev-configure-printer

and after that do the tests again?

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

Job 32973 seems to have succeeded.
Job 32974 times out on the first chunk of print data sent.

What is the difference between the two jobs? Both are forced uni-directional, but what is different? Is one with usblp blacklisted and the other without?

Revision history for this message
Aurimas Fišeras (aurimas-gmail) wrote :

The only difference between Job 32973 and 32974 is that job 32973 is the first job printed after turning the printer off and on.

"USB transaction timeout during read/write" problem only appears on the second or later job.

Revision history for this message
Aurimas Fišeras (aurimas-gmail) wrote :

ls -l /lib/udev/udev-configure-printer
ls: cannot access /lib/udev/udev-configure-printer: No such file or directory

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

Aurimas, can you do the following additional tests:

Update to cups 1.5.3-0ubuntu2~ppa13, make sure that the usblp module is not blacklisted and that the module is loaded. Turn off your printer and turn it on again.

Now run

lpadmin -p <queue> -o usb-no-reattach-default=true

to make the USB backend not reattach the usblp kernel module after a print job. Does this solve your problem?

Try with both Plug'n'Print active

sudo chmod +x /lib/udev/udev-configure-printer

and suppressed

sudo chmod -x /lib/udev/udev-configure-printer

Get back to the old state via

lpadmin -p <queue> -R usb-no-reattach

Always replace "<queue>" by your print queue name.

Try also manually reloading the usblp module via "sudo rmmod usblp; sudo modprobe usblp" after a job has completely finished (all pages have come out) and before sending the next job.

Revision history for this message
Aurimas Fišeras (aurimas-gmail) wrote :

Updated CUPS to 1.5.3-0ubuntu2~ppa14.

Ran lpadmin -p <queue> -o usb-no-reattach-default=true

Successfully printed 10 jobs.

Skipped Plug'n'Print tests:
ls -l /lib/udev/udev-configure-printer
ls: cannot access /lib/udev/udev-configure-printer: No such file or directory

Ran lpadmin -p <queue> -R usb-no-reattach

Successfully printed another 10 jobs.

Interleaving "sudo rmmod usblp; sudo modprobe usblp" after each successful print job (with -R usb-no-reattach) eventually (after 3 successful jobs) led to a hanged job with "Got USB transaction timeout during read/write."

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

Aurimas, thank you for your testing. Now please do the following:

sudo apt-get install system-config-printer-udev

If the system tells you that the package is already installed do

sudo apt-get install --reinstall system-config-printer-udev

Make sure that the kernel module is not blacklisted and loaded. Turn off and turn on the printer. Work with

lpadmin -p <queue> -R usb-no-reattach

Now do test jobs again. DO NOT do "sudo rmmod usblp; sudo modprobe usblp" between successful jobs, do it only after a job which failed.

The difference to the previous test is mainly that you know will work with Plug'n'Print activated.

Revision history for this message
ormris (useingubuntu) wrote :

Hi All,
Just want to let you all know that I've got the same bug. I'll be testing from the PPA soon.

ormris

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

Note that for returning from the special debug modes (forced uni-directional, no re-attaching of the kernel module) you have to give the option names with "-default":

lpadmin -p <queue> -R usb-no-reattach-default
lpadmin -p <queue> -R usb-unidir-default

Please check whether the modes got actually reset looking for a line containing "Deleting <option>-default" in your error_log. After that do the appropriate test.

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

Please try cups 1.5.3-0ubuntu2~ppa15 from my PPA. Here the USB backend sends a reset command to the printer after completing a job. Perhaps this could prevent your printer from crashing after the first job.

Revision history for this message
Aurimas Fišeras (aurimas-gmail) wrote :

Updated to CUPS 1.5.3-0ubuntu2~ppa15.
Executed:
lpadmin -p <queue> -R usb-no-reattach-default
lpadmin -p <queue> -R usb-unidir-default

Successfully printed 15 jobs (without blacklisting usblp) - no hangs.

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

Aurimas, thank you very much. Then your problem is actually fixed by the improvements in the USB CUPS backends and blacklisting the usblp kernel module is not required for your case. Also no exception rules for your printer need to get applied in the backend.

Current CUPS in Quantal contains my improved backend, so the bug is fixed in Quantal. I plan a new Stable Release Update of CUPS in Precise to ship the new USB backend and also a fix for IPP problems, so stay tuned as we need your feedback of testing the new CUPS SRU. This feedback is required to make the new package an official update.

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

Problem seems to be fixed by the new USB CUPS backend, closing kernel and libusb tasks.

Changed in libusb-1.0 (Ubuntu Precise):
status: Confirmed → Invalid
Changed in libusbx (Ubuntu):
status: Confirmed → Invalid
Changed in linux (Ubuntu):
status: Confirmed → Invalid
Changed in linux (Ubuntu Precise):
status: Confirmed → Invalid
Changed in cups (Ubuntu Precise):
status: Fix Released → Triaged
milestone: precise-updates → ubuntu-12.04.1
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Uploaded proposed fix for Precise to the precise-proposed package repository. As soon as it gets approved we will post another comment here with instructions how to install and test it. Please test it that as your feedbvack here is required for making the package an official update.

For the SRU team: debdiff attached to bug 945028: https://bugs.launchpad.net/ubuntu/+source/cups/+bug/945028/+attachment/3219011/+files/cups_1.5.3-0ubuntu1_1.5.3-0ubuntu2.debdiff

SRU is for bug 945028, bug 973270, bug 987485, bug 997040, bug 1000253, and bug 1001028.

Changed in cups (Ubuntu Precise):
status: Triaged → Fix Committed
description: updated
tags: removed: verification-done
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Note, the removal of the blacklisting only works if you upgrade from stock Precise or from the first SRU of CUPS. It does not work when upgrading from my PPA. In this case run

sudo rm /etc/modprobe.d/blacklist-cups-usblp.conf

and turn off and turn on the printer.

description: updated
Changed in cups (Ubuntu Precise):
assignee: nobody → Till Kamppeter (till-kamppeter)
Revision history for this message
Stéphane Graber (stgraber) wrote :

Please use "In progress" instead of "Fix commited" as the status for bugs that have a fix in the queue but not yet accepted to -proposed, otherwise it's making our reports quite confusing...
The SRU script will automatically changed it to "Fix commited" when it lands in -proposed and then "Fix released" when it lands in -updates.

Thanks

Changed in cups (Ubuntu Precise):
status: Fix Committed → In Progress
Revision history for this message
Clint Byrum (clint-fewbar) wrote : Please test proposed package

Hello Aurimas, or anyone else affected,

Accepted cups into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/cups/1.5.3-0ubuntu2 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 change the bug tag from verification-needed to verification-done. If it does not, 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 cups (Ubuntu Precise):
status: In Progress → Fix Committed
tags: added: verification-needed
Revision history for this message
Aurimas Fišeras (aurimas-gmail) wrote :

Updated CUPS to 1.5.3-0ubuntu2 from precise-proposed.

Successfully printed 15+ jobs without any workarounds.

tags: added: verification-done
removed: verification-needed
Revision history for this message
Clint Byrum (clint-fewbar) 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 :
Download full text (3.7 KiB)

This bug was fixed in the package cups - 1.5.3-0ubuntu2

---------------
cups (1.5.3-0ubuntu2) precise-proposed; urgency=low

  * debian/patches/usb-backend-further-enhancements.patch: Added latest
    development work on the libusb-based USB backend:
     - Support for uni-directional devices, both protocol-1 devices and
       devices where no read endpoint is found (LP: #1000253, LP: #1001028).
     - Soft reset specific to the "PRINTER" device class. This allows a
       reset without reconnecting.
     - When closing the device, it will also get reset to its original
       configuration, before re-attaching the usblp kernel module. Do not
       restore the configuration setting when the old configuration was zero,
       as zero means "unconfigured".
     - Added option "usb-unidir" to force the backend into uni-directional
       mode. This allows to work around problems with bi-di communications,
       especially also a delay at the end of the job caused by closing the
       read channel (happens only for some devices, LP: #1001028). Also
       useful for debugging.
     - Added the quirk management of the usblp kernel module. So the problems
       of all printers which were worked around in the kernel module are
       also worked around in the libusb-based CUPS backend now (LP: #1000253).
     - Added new quirk type to quirk manager: Printers for which the usblp
       kernel module should not get reattached after printing a job
       (LP: #1000253).
     - Added additional quirks for the Prolific Technology USB -> Parallel
       adapter, as the adapter needs uni-directional mode to be forced and
       also does not like re-attaching the usblp kernel module after the
       job (last third of last page gets cut off, re-attaching probably
       sends a reset to the printer while there is still data to be printed
       in the printer's internal buffer, LP: #987485).
     - Added the command line option "usb-no-reattach". With the option set
       the usblp kernel module does not get reattached after a job has been
       printed. Some printers cut off the end of the job or even crash by
       re-attaching the module. This is a development/debug mode to test
       whether re-attaching was the culprit of a problem. Users should
       report such issues so that their printers can get added to the quirk
       list.
     - Do a printer reset after each job, this makes the Prolific USB ->
       Parallel adapter finally work (LP: #987485) and makes it unnecessary
       to blacklist the usblp kernel module for some printers (LP: #997040).
     - Some extra debug messages.
     - Added a missing libusb_free_config_descriptor().
    This patch is submitted upstream as CUPS STR #4128.
  * debian/patches/add-ipp-backend-of-cups-1.4.patch, debian/cups.config,
    debian/cups.lintian-overrides, debian/cups.postinst, debian/cups.prerm,
    debian/cups.templates: Add the IPP backend of CUPS 1.4.x to the current
    CUPS package as independent backend "ipp14". Some devices (like the
    LiveBox 2 and some Samsung printers) do not work with the current IPP
    backend (LP: #945028, LP: #973270).
  * debian/local/blacklist-cups-usblp.co...

Read more...

Changed in cups (Ubuntu Precise):
status: Fix Committed → Fix Released
Revision history for this message
terakin (terakinizers) wrote :

Thank you for fix release of cups. However, I am still having the same trouble even after applying the latest cups package.
I have two printers connected via USB, Canon PIXMA MP600 and PIXMA MP630. The symptom is:
* Printer device frequently disappears. We can only see /dev/usb/lp1, no lp0.
* Sometimes printing takes very long time, nearly 1 hour.
* Printing generally succeeds at the first printing after computer is turning on, but fails after that.
* blacklisting usblp and selecting some options (usb-no-reattach, usb-unidir-default=true/false) make no effect.
I have 64-bit Ubuntu 12.04 system and uses drivers provided by Canon, both in 32bit. This seems slightly unstable configuration, but it seems drivers just works fine according to error_log. One strange message from the log is "Got USB transaction timeout during read." (or write), which means usb module has timed out and printer connection has been lost in some reason.
Is anybody out there explain this ?

Revision history for this message
LiaM (liamk) wrote :

I'm still experiencing this error, or one that's very similar.
After upgrading to precise I am unable to print PDF files on a Canon Pixma4000.
The cups version is 1.5.3-0ubuntu3.
Printing a test page or text file works. However, trying to print a PDF file just hangs. The file remains in the queue with status "Processing."
The debug messages are attached.
I'm happy to try to debug this, since not being able to print is really getting to be a problem.

Any help would be *very* much appreciated!!!

Revision history for this message
terakin (terakinizers) wrote :

Still in problem even after installing most recent update (cups, 1.5.3-0ubuntu4).
The symptom is also the same.
* Printer is OK after several periods of powering on.
* Then, printer suddenly hangs without warning. I only can know this by notifying printer spool does not proceed.
* The only solution is to shut down the printer. My printer (Canon Pixma MP600) cannot shut down by "power" button after encoutering this trouble, only by plugging off the power code.
* Everything seems to be normal after re-enterying power switch of the printer. Spooled printing is also OK.
* This situation does not change even if I assign module "usblp" as a blacklisted one.

I cannot carve up the cause of this problem whether this is driver side and backend side. However, I suppose that the problem stems from backend, as same problem occurs after changing the driver. And it seems that some extra signal (possibly from cups?) makes the printer hangs up. However, it is also strange that the printer never time out after plugging off USB cable, or lettting it for several minutes.

What is the best way to solve (or, at least collect related information) this problem ...?

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

terakin, LiaM, can you run the command

lpadmin -p <printer> -o usb-unidir-default=true

in a terminal window, with "<printer>" replaced by the name of your
print queue (print queue names are shown by the "lpstat -v" command.
Then remove all stuck jobs from the print queue and turn off and turn on
the printer. Does the problem go away now?

If not, try the command

lpadmin -p <printer> -o usb-no-reattach-default=true

clear the print queue and power-cycle the printer. Does it work now? If
yes, try to remove the first workaround via

lpadmin -p <printer> -R usb-unidir-default

Does it still work?

To remove also the other workaround run

lpadmin -p <printer> -R usb-no-reattach-default

Please post also the output of the command

lsusb

This way we get the USB IDs of the printer to be able to add permanent
exception rules to the CUPS USB backend.

Revision history for this message
terakin (terakinizers) wrote :

Till,

After three days test running of printer including output of several dozens of pages, I confirmed that option "-o usb-unidir-default=true" just works for my printer, Canon Pixma MP600. In one case, I encountered printer just halt. In this case, I started printing with printer's power still off. And moreover, system went very unstable and I had to shut down the machine (and could not do safely). I convince that I can ignore this case and the option generally works.
Thank you for your definite suggestions!

... One more excuse. Actually, I tried this option before, and it didn't work in that time ... cups and related packages were not updated. So, I had "double bugs" in that time and that's why this option didn't work.

To post a comment you must log in.