usb crashed with SIGSEGV in opendir() -- USB ports are in BIOS disabled --> cupsd crashes every time

Bug #1108719 reported by LAZA
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
cups (Ubuntu)
Fix Released
High
Unassigned
Precise
Fix Released
High
Unassigned
Raring
Won't Fix
High
Unassigned
Saucy
Fix Released
High
Unassigned

Bug Description

On 4 machines is USB for safety disabled, an HP DeskJet 500 is attached to one machine via LTP (IEEE 1284) and the other machines use the network share... - all working well.

But every time i open up CUPS for configuration or something the process
/usr/sbin/cupsd
crashes and an crash report is generated (attached).

.

Xubuntu 12.04.1

Linux icafe-a 3.2.0-36-generic #57-Ubuntu SMP Tue Jan 8 21:41:24 UTC 2013 i686 i686 i386 GNU/Linux

CUPS
Versions:
1.5.3-0ubuntu6 (/var/lib/apt/lists/de.archive.ubuntu.com_ubuntu_dists_precise-updates_main_binary-i386_Packages) (/var/lib/dpkg/status)

BTW: I was also not able to send the bug via apport, this crashes with "package not installed".

[IMPACT]

If on a machine (mainly servers and high-security environments) the USB is turned off in the BIOS or a very old pre-USB-era machine is used the attempt of CUPS to detect available printers makes the USB CUPS backend being called and the backend crashes then due to absense of USB . The crash itself is harmless, but it makes Apport popping up with a crash report which is annoying.

[TESTCASE]

Turn off the USB support completely in the BIOS setup of the machine, boot and run either

lpinfo -v

or

sudo /usr/lib/cups/backend/usb

A crash report will pop up. Close it, do not generate the actual bug report.

After installing the proposed package the backend will not crash any more and so no Apport pop-up will occur.

[Regression Potential]

The patch is very simple and adds only an error check to handle an error on initializing libusb properly. The probability of a regression caused by this is practically zero.

NOTE: As the archives for the new development cycle are not open yet I am posting this SRU proposal without a fixed package in the new development branch. The fix is committed to Debian's GIT repo of CUPS though and so it will appear in the new development cycle with the first sync of the cups package.

LAZA (laza74)
description: updated
Revision history for this message
LAZA (laza74) wrote :
Download full text (97.5 KiB)

ProblemType: Crash
Architecture: i386
CrashCounter: 1
Date: Tue Jan 29 10:24:52 2013
DistroRelease: Ubuntu 12.04
ExecutablePath: /usr/lib/cups/backend/usb
ExecutableTimestamp: 1355350942
ProcAttrCurrent: /usr/sbin/cupsd (enforce)
ProcCmdline: usb
ProcCwd: /
ProcEnviron:
 PATH=(custom, no user)
 LANG=de_DE.UTF8
ProcMaps:
 00110000-00127000 r-xp 00000000 08:01 1401074 /lib/i386-linux-gnu/libpthread-2.15.so
 00127000-00128000 r--p 00016000 08:01 1401074 /lib/i386-linux-gnu/libpthread-2.15.so
 00128000-00129000 rw-p 00017000 08:01 1401074 /lib/i386-linux-gnu/libpthread-2.15.so
 00129000-0012b000 rw-p 00000000 00:00 0
 0012b000-00132000 r-xp 00000000 08:01 1401070 /lib/i386-linux-gnu/librt-2.15.so
 00132000-00133000 r--p 00006000 08:01 1401070 /lib/i386-linux-gnu/librt-2.15.so
 00133000-00134000 rw-p 00007000 08:01 1401070 /lib/i386-linux-gnu/librt-2.15.so
 00134000-001f3000 r-xp 00000000 08:01 590073 /usr/lib/i386-linux-gnu/libgnutls.so.26.21.8
 001f3000-001f7000 r--p 000be000 08:01 590073 /usr/lib/i386-linux-gnu/libgnutls.so.26.21.8
 001f7000-001f8000 rw-p 000c2000 08:01 590073 /usr/lib/i386-linux-gnu/libgnutls.so.26.21.8
 001f8000-00222000 r-xp 00000000 08:01 1401078 /lib/i386-linux-gnu/libm-2.15.so
 00222000-00223000 r--p 00029000 08:01 1401078 /lib/i386-linux-gnu/libm-2.15.so
 00223000-00224000 rw-p 0002a000 08:01 1401078 /lib/i386-linux-gnu/libm-2.15.so
 00224000-002ec000 r-xp 00000000 08:01 590177 /usr/lib/i386-linux-gnu/libkrb5.so.3.3
 002ec000-002f2000 r--p 000c7000 08:01 590177 /usr/lib/i386-linux-gnu/libkrb5.so.3.3
 002f2000-002f3000 rw-p 000cd000 08:01 590177 /usr/lib/i386-linux-gnu/libkrb5.so.3.3
 002f3000-00303000 r-xp 00000000 08:01 590355 /usr/lib/i386-linux-gnu/libtasn1.so.3.1.12
 00303000-00304000 r--p 0000f000 08:01 590355 /usr/lib/i386-linux-gnu/libtasn1.so.3.1.12
 00304000-00305000 rw-p 00010000 08:01 590355 /usr/lib/i386-linux-gnu/libtasn1.so.3.1.12
 00305000-00315000 r-xp 00000000 08:01 590242 /usr/lib/i386-linux-gnu/libp11-kit.so.0.0.0
 00315000-00316000 r--p 0000f000 08:01 590242 /usr/lib/i386-linux-gnu/libp11-kit.so.0.0.0
 00316000-00317000 rw-p 00010000 08:01 590242 /usr/lib/i386-linux-gnu/libp11-kit.so.0.0.0
 00317000-0035e000 r-xp 00000000 08:01 1400858 /lib/i386-linux-gnu/libdbus-1.so.3.5.8
 0035e000-0035f000 r--p 00047000 08:01 1400858 /lib/i386-linux-gnu/libdbus-1.so.3.5.8
 0035f000-00360000 rw-p 00048000 08:01 1400858 /lib/i386-linux-gnu/libdbus-1.so.3.5.8
 00360000-00363000 r-xp 00000000 08:01 1401086 /lib/i386-linux-gnu/libdl-2.15.so
 00363000-00364000 r--p 00002000 08:01 1401086 /lib/i386-linux-gnu/libdl-2.15.so
 00364000-00365000 rw-p 00003000 08:01 1401086 /lib/i386-linux-gnu/libdl-2.15.so
 00365000-00378000 r-xp 00000000 08:01 1401066 /lib/i386-linux-gnu/libresolv-2.15.so
 00378000-00379000 ---p 00013000 08:01 1401066 /lib/i386-linux-gnu/libresolv-2.15.so
 00379000-0037a000 r--p 00013000 08:01 1401066 /lib/i386-linux-gnu/libresolv-2.15.so
 0037a000-0037b000 rw-p 00014000 08:01 1401066 /lib/i386-linux-gnu/libresolv-2.15.so
 0037b000-0037d000 rw-p 00000000 00:00 0
 0040b000-0040d000 r-xp 00000000 08:01 140...

LAZA (laza74)
summary: - USB ports are in BIOS disabled --> cupsd crashes every time
+ usb crashed with SIGSEGV in opendir() -- USB ports are in BIOS
+ disabled --> cupsd crashes every time
LAZA (laza74)
description: updated
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

What is the output of

lsusb

on your machine? Do you get any output? Does it crash? Please post the output here.

Can you reproduce the crash? Probably most easily you can reproduce it running

sudo /usr/lib/cups/backend/usb

If a crash report pops up, follow the steps until a new bug report gets generated. Please post a link to the new bug here.

Changed in cups (Ubuntu):
status: New → Incomplete
Revision history for this message
LAZA (laza74) wrote :

~$ sudo lsusb
unable to initialize libusb: -99

BUT:
~$ sudo dpkg -l | grep 'libusb'
ii libusb-0.1-4 2:0.1.12-20 userspace USB programming library
ii libusb-1.0-0 2:1.0.9~rc3-2ubuntu1 userspace USB programming library
ii libusbmuxd1 1.0.7-2ubuntu0.1 USB multiplexor daemon for iPhone and iPod Touch devices - library

~$ sudo /usr/lib/cups/backend/usb
DEBUG: list_devices

--> programm crashes --> apport pops up --> show details -->
--> Ungültiger Problembericht - Konnte Paket oder Quellpaket-Namen nicht bestimmen.
--> apport closes!

I attached the crash report (_usr_lib_cups_backend_usb.0.crash).

Revision history for this message
LAZA (laza74) wrote :

Sorry, forgot the translation for the (german) error window:

Invalid problem report - Could package or source package names not determine/identify.

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

Can you install the cups-dbg package and then run

ulimit -c unlimited
sudo /usr/lib/cups/backend/usb

"usb" will crash and produce a core file.

Run

sudo gdb -c core /usr/lib/cups/backend/usb

and at the prompt of gdb run

bt

and after that

quit

Please post all the screen output here.

Revision history for this message
LAZA (laza74) wrote :

Thanks for your fast response!

Here the ouput:

~$ sudo apt-get install cups-dbg
[sudo] password for icafe:
Paketlisten werden gelesen... Fertig
Abhängigkeitsbaum wird aufgebaut
Statusinformationen werden eingelesen... Fertig
Die folgenden NEUEN Pakete werden installiert:
  cups-dbg
0 aktualisiert, 1 neu installiert, 0 zu entfernen und 0 nicht aktualisiert.
Es müssen 1.536 kB an Archiven heruntergeladen werden.
Nach dieser Operation werden 2.219 kB Plattenplatz zusätzlich benutzt.
Hole:1 http://de.archive.ubuntu.com/ubuntu/ precise-updates/main cups-dbg i386 1.5.3-0ubuntu6 [1.536 kB]
Es wurden 1.536 kB in 2 s geholt (670 kB/s)
Vormals nicht ausgewähltes Paket cups-dbg wird gewählt.
(Lese Datenbank ... 152329 Dateien und Verzeichnisse sind derzeit installiert.)
Entpacken von cups-dbg (aus .../cups-dbg_1.5.3-0ubuntu6_i386.deb) ...
cups-dbg (1.5.3-0ubuntu6) wird eingerichtet ...

~$ ulimit -c unlimited

~$ sudo /usr/lib/cups/backend/usb
DEBUG: list_devices

~$ sudo gdb -c core /usr/lib/cups/backend/usb
GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2.1) 7.4-2012.04
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.launchpad.net/gdb-linaro/>...
Reading symbols from /usr/lib/cups/backend/usb...Reading symbols from /usr/lib/debug/.build-id/1e/8ca22c9b6dc7a5de728fa24fbaba456a35ede2.debug...done.
done.
[New LWP 6250]

warning: Can't read pathname for load map: Eingabe-/Ausgabefehler.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1".
Core was generated by `/usr/lib/cups/backend/usb'.
Program terminated with signal 11, Segmentation fault.
#0 0x006d945f in ?? () from /lib/i386-linux-gnu/libc.so.6
(gdb)

(gdb) bt
#0 0x006d945f in ?? () from /lib/i386-linux-gnu/libc.so.6
#1 0x006d94dd in opendir () from /lib/i386-linux-gnu/libc.so.6
#2 0x00c3ec2e in ?? () from /lib/i386-linux-gnu/libusb-1.0.so.0
#3 0x00c3704c in libusb_get_device_list () from /lib/i386-linux-gnu/libusb-1.0.so.0
#4 0x00c20bea in find_device (cb=0xc208d0 <list_cb>, data=0x0) at usb-libusb.c:847
#5 0x00c1f957 in main (argc=1, argv=0xbfa27e34) at usb.c:177
(gdb)

(gdb) quit

Changed in cups (Ubuntu):
status: Incomplete → Fix Committed
importance: Undecided → High
milestone: none → ubuntu-13.04
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Fix uploaded as cups_1.6.2-1ubuntu6. Most probably it will not go into today's release of Raring but will be made available as an update (SRU).

Revision history for this message
LAZA (laza74) wrote :

A backport into Precise (LTS for 5 years!) would be appreciated!

Thanks again for the fast response.

Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Hi! This is missing a Test Case and Regression Potential.

https://wiki.ubuntu.com/StableReleaseUpdates#Procedure

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

The fix for Raring is uploaded to the -proposed repository. As soon as it gets approved instructions for testing it will get posted here. Please test and give your feedback. This is required for the package to get an official update.

SRU team: debdiff attached.

description: updated
Changed in cups (Ubuntu):
milestone: ubuntu-13.04 → none
Changed in cups (Ubuntu Precise):
milestone: none → precise-updates
Changed in cups (Ubuntu Raring):
milestone: none → raring-updates
Changed in cups (Ubuntu Precise):
importance: Undecided → High
Changed in cups (Ubuntu Raring):
importance: Undecided → High
Changed in cups (Ubuntu Precise):
status: New → In Progress
Changed in cups (Ubuntu Raring):
status: New → In Progress
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

The fix for Precise is uploaded to the -proposed repository. As soon as it gets approved instructions for testing it will get posted here. Please test and give your feedback. This is required for the package to get an official update.

SRU team: debdiff attached.

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

The fix is also submitted upstream and committed to the GIT repository of CUPS at Debian. When the next CUPS package at Debian is released we will sync it to Saucy making the fix available.

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

cups package re-uploaded to also cover bug 1133794, new debdiff attached.

Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello LAZA, or anyone else affected,

Accepted cups into raring-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/cups/1.6.2-1ubuntu6 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 add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and 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 Raring):
status: In Progress → Fix Committed
tags: added: verification-needed
Changed in cups (Ubuntu Precise):
status: In Progress → Fix Committed
Revision history for this message
Brian Murray (brian-murray) wrote :

Hello LAZA, 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-0ubuntu7 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 add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and 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!

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

Package re-uploaded due to FTBFS. Please test cups 1.6.2-1ubuntu7 as described above as soon as it gets approved.

SRU team: New debdiff attached.

Revision history for this message
Brian Murray (brian-murray) wrote :

Hello LAZA, or anyone else affected,

Accepted cups into raring-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/cups/1.6.2-1ubuntu7 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 add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and 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!

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

Now I have also re-uploaded the Precise package because of the same FTBFS. Please test cups 1.5.3-0ubuntu8 as described above as soon as it gets approved.

SRU team: New debdiff attached.

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

This bug was fixed in the package cups - 1.6.2-7

---------------
cups (1.6.2-7) experimental; urgency=low

  * Update the patch adding libusb error handling to also discard its
    errors in the counting of warning messages; this should make the
    error-suite succeed in more cases.

 -- Didier Raboud <email address hidden> Fri, 03 May 2013 11:30:59 +0200

Changed in cups (Ubuntu Saucy):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote :

Hello LAZA, 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-0ubuntu8 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 add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and 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!

Revision history for this message
LAZA (laza74) wrote :

Test version: cups -- 1.5.3-0ubuntu8

1. install all updates

2. reproduce bug
sudo /usr/lib/cups/backend/usb
--> crashes as expected

3. install updated CUPS version

4. check version
~$ dpkg -l | grep 'cups'
ii bluez-cups 4.98-2ubuntu7
ii cups 1.5.3-0ubuntu8
ii cups-bsd 1.5.3-0ubuntu8
ii cups-client 1.5.3-0ubuntu8
ii cups-common 1.5.3-0ubuntu8
ii cups-dbg 1.5.3-0ubuntu8
ii cups-filters 1.0.18-0ubuntu0.1
ii cups-ppdc 1.5.3-0ubuntu8
ii ghostscript-cups 9.05~dfsg-0ubuntu4.2
ii libcups2 1.5.3-0ubuntu6
ii libcupscgi1 1.5.3-0ubuntu6
ii libcupsdriver1 1.5.3-0ubuntu6
ii libcupsfilters1 1.0.18-0ubuntu0.1
ii libcupsimage2 1.5.3-0ubuntu6
ii libcupsmime1 1.5.3-0ubuntu6
ii libcupsppdc1 1.5.3-0ubuntu6
ii python-cups 1.9.61-0ubuntu2
ii python-cupshelpers 1.3.8+20120201-0ubuntu8.1

5. reproduce bug
~$ ulimit -c unlimited
~$ sudo /usr/lib/cups/backend/usb
DEBUG: list_devices
WARNING: Unable to initialize USB access via libusb, libusb error -99

--> no crash
--> setting to 'verification-done'

tags: added: verification-done
removed: verification-needed
Revision history for this message
LAZA (laza74) wrote :

Rereading my comment, i saw, that i forget to update the libraries from cups.

Done this in Synaptic and re-testing the same - same error but no crash.

Thanks to all for the fast fix!

Revision history for this message
Scott Kitterman (kitterman) 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 :

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

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

  * debian/patches/usb-backend-do-not-crash-if-usb-disabled-in-bios.patch:
    Add patch to test suite to ignore the newly introduced warning message.
    This message gets regularly issued on build servers which use virtual
    machines without access to the host's USB and so the test suite fails due
    to an extra warning. Due to this there was a FTBFS in the previous release
    (LP: #1108719).
 -- Till Kamppeter <email address hidden> Fri, 10 May 2013 19:51:56 +0200

Changed in cups (Ubuntu Precise):
status: Fix Committed → Fix Released
Revision history for this message
Rolf Leggewie (r0lf) wrote :

raring has seen the end of its life and is no longer receiving any updates. Marking the raring task for this ticket as "Won't Fix".

Changed in cups (Ubuntu Raring):
status: Fix Committed → Won't Fix
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.