gutenprint52+usb crashed with SIGSEGV in __GI___pthread_mutex_lock()

Bug #1297326 reported by Michael DePaulo on 2014-03-25
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gutenprint (Ubuntu)
Medium
Unassigned

Bug Description

This crash occurs as soon as I login to the Unity desktop.

I am running trusty under VMware Workstation 10.0.1 on a Windows 8.1 64-bit host. I have VMware Workstation's "Printer" feaure "connected", so VMware is sharing my host OS's printers with the trusty VM.

ProblemType: Crash
DistroRelease: Ubuntu 14.04
Package: printer-driver-gutenprint 5.2.10~pre2-0ubuntu1
ProcVersionSignature: Ubuntu 3.13.0-19.40-generic 3.13.6
Uname: Linux 3.13.0-19-generic i686
ApportVersion: 2.13.3-0ubuntu1
Architecture: i386
Date: Tue Mar 25 10:24:41 2014
ExecutablePath: /usr/lib/cups/backend/gutenprint52+usb
InstallationDate: Installed on 2014-03-06 (19 days ago)
InstallationMedia: Ubuntu 14.04 LTS "Trusty Tahr" - Alpha i386 (20140304)
ProcCmdline: gutenprint52+usb
ProcEnviron:
 PATH=(custom, no user)
 LANG=en.UTF8
SegvAnalysis:
 Segfault happened at: 0xb74ea036 <__GI___pthread_mutex_lock+22>: mov 0xc(%esi),%eax
 PC (0xb74ea036) ok
 source "0xc(%esi)" (0x00000024) not located in a known VMA region (needed readable region)!
 destination "%eax" ok
SegvReason: reading NULL VMA
Signal: 11
SourcePackage: gutenprint
StacktraceTop:
 __GI___pthread_mutex_lock (mutex=0x18) at ../nptl/pthread_mutex_lock.c:66
 pthread_mutex_lock (mutex=0x18) at forward.c:192
 libusb_get_device_list () from /lib/i386-linux-gnu/libusb-1.0.so.0
 ?? ()
 ?? ()
Title: gutenprint52+usb crashed with SIGSEGV in __GI___pthread_mutex_lock()
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups:

Michael DePaulo (mikedep333) wrote :
information type: Private → Public

StacktraceTop:
 __GI___pthread_mutex_lock (mutex=0x18) at ../nptl/pthread_mutex_lock.c:66
 pthread_mutex_lock (mutex=mutex@entry=0x18) at forward.c:192
 libusb_get_device_list (ctx=0x0, list=list@entry=0xbfc7d86c) at ../../libusb/core.c:671
 find_and_enumerate (ctx=<optimized out>, list=list@entry=0xbfc7d86c, backend=backend@entry=0x0, match_serno=match_serno@entry=0x0, printer_type=printer_type@entry=0, scan_only=scan_only@entry=1) at ../../../../src/cups/backend_common.c:378
 print_help (argv0=<optimized out>, backend=backend@entry=0x0) at ../../../../src/cups/backend_common.c:517

Changed in gutenprint (Ubuntu):
importance: Undecided → Medium
tags: removed: need-i386-retrace
Till Kamppeter (till-kamppeter) wrote :

Does this crash occur every time when you log in?

Changed in gutenprint (Ubuntu):
status: New → Incomplete
Solomon Peachy (pizza-7) wrote :

At first glance it appears that the crash is in the bowels of libusb's enumeration code and has nothing to do with the backend itself.

Please log into the non-graphical console, and run three things for me on the command line:

lsusb
/usr/lib/cups/backend/usb
/usr/lib/cups/backend/gutenprint52+usb -D

Where this goes next depends on the output of those commands.

Michael DePaulo (mikedep333) wrote :

@Till yes it happens every time I log in.

@pizza-7 Are you sure the 2nd command is correct?
I ran all 3 commands from gnome-terminal so I could copy & paste.

mike@executor-u-t:~$ lsusb
unable to initialize libusb: -99
mike@executor-u-t:~$ /usr/lib/cups/backend/usb
bash: /usr/lib/cups/backend/usb: Permission denied
mike@executor-u-t:~$ /usr/lib/cups/backend/gutenprint52+usb -D
DEBUG: Multi-Call Dye-sublimation CUPS Backend version 0.42G
DEBUG: Copyright 2007-2014 Solomon Peachy
DEBUG: This free software comes with ABSOLUTELY NO WARRANTY!
DEBUG: Licensed under the GNU GPL. Run with '-G' for more details.
DEBUG:
DEBUG: ** running with libusb 1.0.17 (10830)
DEBUG: CUPS Usage:
DEBUG: DEVICE_URI=someuri gutenprint52+usb job user title num-copies options [ filename ]
DEBUG:
DEBUG: Standalone Usage:
DEBUG: gutenprint52+usb
DEBUG: [ -D ] [ -G ] [ -S serialnum ] [ -B backendname ]
DEBUG: [ -V extra_vid ] [ -P extra_pid ] [ -T extra_type ]
DEBUG: [ [ backend_specific_args ] | [ - | infile ] ]
DEBUG: -B canonselphy # Canon SELPHY CP/ES version 0.81
DEBUG: -B kodak6800 # Kodak 6800/6850 version 0.32
DEBUG: [ -c filename ] # Get tone curve
DEBUG: [ -C filename ] # Set tone curve
DEBUG: -B kodak605 # Kodak 605 version 0.18
DEBUG: [ -C filename ] # Set tone curve
DEBUG: [ -m ] # Query media
DEBUG: [ -s ] # Query status
DEBUG: -B kodak1400 # Kodak 1400/805 version 0.31
DEBUG: [ -C filename ] # Set tone curve
DEBUG: -B shinkos2145 # Shinko/Sinfonia CHC-S2145 (S2) version 0.31
DEBUG: [ -b 0|1 ] # Disable/Enable control panel
DEBUG: [ -c filename ] # Get user/NV tone curve
DEBUG: [ -C filename ] # Set user/NV tone curve
DEBUG: [ -e ] # Query error log
DEBUG: [ -f ] # Use fast return mode
DEBUG: [ -F ] # Flash Printer LED
DEBUG: [ -l filename ] # Get current tone curve
DEBUG: [ -L filename ] # Set current tone curve
DEBUG: [ -m ] # Query media
DEBUG: [ -i ] # Query printer info
DEBUG: [ -r ] # Reset user/NV tone curve
DEBUG: [ -R ] # Reset printer to factory defaults
DEBUG: [ -s ] # Query status
DEBUG: [ -u ] # Query user string
DEBUG: [ -U sometext ] # Set user string
DEBUG: [ -X jobid ] # Abort a printjob
DEBUG: -B sonyupdr150 # Sony UP-DR150/UP-DR200 version 0.13
DEBUG: -B mitsu70x # Mitsubishi CP-D70/D707 version 0.12
DEBUG: [ -s ] # Query status
DEBUG: -B dnpds40 # DNP DS40/DS80/DSRX1 version 0.30
DEBUG: [ -i ] # Query printer info
DEBUG: [ -s ] # Query status
DEBUG: [ -n ] # Query counters
DEBUG: [ -N A|B|M ] # Clear counter A/B/M
DEBUG: [ -p num ] # Set counter P
Segmentation fault (core dumped)

Michael DePaulo (mikedep333) wrote :

I forgot to mention that I did install VMware Tools from this version of VMware Workstation. I can try uninstalling them.

Also, "hpfax" crashes during each login too. Launchpad suggested I mark it as a duplicate of bug 1007226, and I did. However, it may not be a duplicate after all because 1007226 is much older.

Solomon Peachy (pizza-7) wrote :

In particular, I suspect that VMWare's "Printer feaure" is responsible, but I have no idea how it's exposed within the VM. The gutenprint backend uses similar enumeration logic as the CUPS USB backend, so I'm particularly interested if the latter works when the former does not.

Solomon Peachy (pizza-7) wrote :

Can you run those commands as root?

The fact that 'lsusb' is failing shows taht something more serious than a failing backend is going wrong.

Please uninstall the VMWare tools too, at least as an experiment.

Solomon Peachy (pizza-7) wrote :

The gutenprint backend crash is due to not catching the failure of libusb_init().

Why libusb_init is failing is another matter entirely...

Oh, one more thing; can you run 'ls -l /usr/lib/cups/backend/' for me?

Michael DePaulo (mikedep333) wrote :
Download full text (7.7 KiB)

I am going to try reformatting this VM with the latest nightly desktop CD for the sake of testing. Still, here's the output with and without VMware Tools as root:

With VMware tools installed:
root@executor-u-t:~# lsusb
unable to initialize libusb: -99
root@executor-u-t:~# /usr/lib/cups/backend/usb
DEBUG: Loading USB quirks from "/usr/share/cups/usb".
DEBUG: Loaded 107 quirks.
DEBUG: list_devices
DEBUG: Unable to initialize USB access via libusb, libusb error -99
root@executor-u-t:~# /usr/lib/cups/backend/gutenprint52+usb -D
DEBUG: Multi-Call Dye-sublimation CUPS Backend version 0.42G
DEBUG: Copyright 2007-2014 Solomon Peachy
DEBUG: This free software comes with ABSOLUTELY NO WARRANTY!
DEBUG: Licensed under the GNU GPL. Run with '-G' for more details.
DEBUG:
DEBUG: ** running with libusb 1.0.17 (10830)
DEBUG: CUPS Usage:
DEBUG: DEVICE_URI=someuri gutenprint52+usb job user title num-copies options [ filename ]
DEBUG:
DEBUG: Standalone Usage:
DEBUG: gutenprint52+usb
DEBUG: [ -D ] [ -G ] [ -S serialnum ] [ -B backendname ]
DEBUG: [ -V extra_vid ] [ -P extra_pid ] [ -T extra_type ]
DEBUG: [ [ backend_specific_args ] | [ - | infile ] ]
DEBUG: -B canonselphy # Canon SELPHY CP/ES version 0.81
DEBUG: -B kodak6800 # Kodak 6800/6850 version 0.32
DEBUG: [ -c filename ] # Get tone curve
DEBUG: [ -C filename ] # Set tone curve
DEBUG: -B kodak605 # Kodak 605 version 0.18
DEBUG: [ -C filename ] # Set tone curve
DEBUG: [ -m ] # Query media
DEBUG: [ -s ] # Query status
DEBUG: -B kodak1400 # Kodak 1400/805 version 0.31
DEBUG: [ -C filename ] # Set tone curve
DEBUG: -B shinkos2145 # Shinko/Sinfonia CHC-S2145 (S2) version 0.31
DEBUG: [ -b 0|1 ] # Disable/Enable control panel
DEBUG: [ -c filename ] # Get user/NV tone curve
DEBUG: [ -C filename ] # Set user/NV tone curve
DEBUG: [ -e ] # Query error log
DEBUG: [ -f ] # Use fast return mode
DEBUG: [ -F ] # Flash Printer LED
DEBUG: [ -l filename ] # Get current tone curve
DEBUG: [ -L filename ] # Set current tone curve
DEBUG: [ -m ] # Query media
DEBUG: [ -i ] # Query printer info
DEBUG: [ -r ] # Reset user/NV tone curve
DEBUG: [ -R ] # Reset printer to factory defaults
DEBUG: [ -s ] # Query status
DEBUG: [ -u ] # Query user string
DEBUG: [ -U sometext ] # Set user string
DEBUG: [ -X jobid ] # Abort a printjob
DEBUG: -B sonyupdr150 # Sony UP-DR150/UP-DR200 version 0.13
DEBUG: -B mitsu70x # Mitsubishi CP-D70/D707 version 0.12
DEBUG: [ -s ] # Query status
DEBUG: -B dnpds40 # DNP DS40/DS80/DSRX1 version 0.30
DEBUG: [ -i ] # Query printer info
DEBUG: [ -s ] # Query status
DEBUG: [ -n ] # Query counters
DEBUG: [ -N A|B|M ] # Clear counter A/B/M
DEBUG: [ -p num ] # Set counter P
Segmentation fault (core dumped)
root@executor-u-t:~# ls -l /usr/lib/cups/backend/
total 696
-rwxr-xr-x 1 root root 128852 Dec 19 21:43 bluetooth
-rwxr--r-- 3 root root 17768 Mar 19 12:32 dnssd
-rwxr-xr-x 1 root root 90788 Mar 18 18:36 gutenprint52+usb
-rwxr-xr-x 1 root root 18040 Ma...

Read more...

Michael DePaulo (mikedep333) wrote :
Download full text (7.6 KiB)

I reran the commands from the 2014-03-26 32-bit desktop CD (where the VMware Tools were never installed) and after installing from that CD and installing all available updates (without ever installing VMware Tools.) There appears to be no difference.

From the desktop CD:
root@ubuntu:~# lsusb
unable to initialize libusb: -99
root@ubuntu:~# /usr/lib/cups/backend/usb
DEBUG: Loading USB quirks from "/usr/share/cups/usb".
DEBUG: Loaded 107 quirks.
DEBUG: list_devices
DEBUG: Unable to initialize USB access via libusb, libusb error -99
root@ubuntu:~# /usr/lib/cups/backend/gutenprint52+usb -D
DEBUG: Multi-Call Dye-sublimation CUPS Backend version 0.42G
DEBUG: Copyright 2007-2014 Solomon Peachy
DEBUG: This free software comes with ABSOLUTELY NO WARRANTY!
DEBUG: Licensed under the GNU GPL. Run with '-G' for more details.
DEBUG:
DEBUG: ** running with libusb 1.0.17 (10830)
DEBUG: CUPS Usage:
DEBUG: DEVICE_URI=someuri gutenprint52+usb job user title num-copies options [ filename ]
DEBUG:
DEBUG: Standalone Usage:
DEBUG: gutenprint52+usb
DEBUG: [ -D ] [ -G ] [ -S serialnum ] [ -B backendname ]
DEBUG: [ -V extra_vid ] [ -P extra_pid ] [ -T extra_type ]
DEBUG: [ [ backend_specific_args ] | [ - | infile ] ]
DEBUG: -B canonselphy # Canon SELPHY CP/ES version 0.81
DEBUG: -B kodak6800 # Kodak 6800/6850 version 0.32
DEBUG: [ -c filename ] # Get tone curve
DEBUG: [ -C filename ] # Set tone curve
DEBUG: -B kodak605 # Kodak 605 version 0.18
DEBUG: [ -C filename ] # Set tone curve
DEBUG: [ -m ] # Query media
DEBUG: [ -s ] # Query status
DEBUG: -B kodak1400 # Kodak 1400/805 version 0.31
DEBUG: [ -C filename ] # Set tone curve
DEBUG: -B shinkos2145 # Shinko/Sinfonia CHC-S2145 (S2) version 0.31
DEBUG: [ -b 0|1 ] # Disable/Enable control panel
DEBUG: [ -c filename ] # Get user/NV tone curve
DEBUG: [ -C filename ] # Set user/NV tone curve
DEBUG: [ -e ] # Query error log
DEBUG: [ -f ] # Use fast return mode
DEBUG: [ -F ] # Flash Printer LED
DEBUG: [ -l filename ] # Get current tone curve
DEBUG: [ -L filename ] # Set current tone curve
DEBUG: [ -m ] # Query media
DEBUG: [ -i ] # Query printer info
DEBUG: [ -r ] # Reset user/NV tone curve
DEBUG: [ -R ] # Reset printer to factory defaults
DEBUG: [ -s ] # Query status
DEBUG: [ -u ] # Query user string
DEBUG: [ -U sometext ] # Set user string
DEBUG: [ -X jobid ] # Abort a printjob
DEBUG: -B sonyupdr150 # Sony UP-DR150/UP-DR200 version 0.13
DEBUG: -B mitsu70x # Mitsubishi CP-D70/D707 version 0.12
DEBUG: [ -s ] # Query status
DEBUG: -B dnpds40 # DNP DS40/DS80/DSRX1 version 0.30
DEBUG: [ -i ] # Query printer info
DEBUG: [ -s ] # Query status
DEBUG: [ -n ] # Query counters
DEBUG: [ -N A|B|M ] # Clear counter A/B/M
DEBUG: [ -p num ] # Set counter P
Segmentation fault (core dumped)
root@ubuntu:~# ls -l /usr/lib/cups/backend/
total 558
-rwxr-xr-x 1 root root 128852 Dec 20 02:43 bluetooth
-rwxr--r-- 3 root root 17768 Mar 19 16:32 dnssd
-rwxr-xr-x 1 root root 90788 Mar 1...

Read more...

Solomon Peachy (pizza-7) wrote :

There is an upstream fix for the crash; it will be in the next gutenprint release. Alternatively you can get the patch here if you don't want to wait for upstream to spit out a new release:

 http://gimp-print.cvs.sourceforge.net/viewvc/gimp-print/print/src/cups/backend_common.c?r1=1.31&r2=1.32&view=patch

Second, the permissions for the 'gutenprint52+usb' backend are incorrect, and I believe this is the fault of the Ubuntu package itself. They currently are 0755...

 -rwxr-xr-x 1 root root 90788 Mar 18 18:36 gutenprint52+usb

But should be 0700. This is what the upstream gutenprint package installs:

-rwx------ 1 root root 102005 Mar 27 14:28 gutenprint52+usb

I am not able to make changes to the Ubuntu package, so this will have to suffice.

Still, the root cause is that libusb is basically broken on your system, but at least the crash won't occur any more.

Solomon, thank you very much for the fix. I am preparing a new Ubuntu package with the fix now.

Changed in gutenprint (Ubuntu):
status: Incomplete → In Progress
Changed in gutenprint (Ubuntu):
status: In Progress → Fix Committed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gutenprint - 5.2.10~pre2-0ubuntu2

---------------
gutenprint (5.2.10~pre2-0ubuntu2) trusty; urgency=medium

  * debian/patches/usb-backend-no-crash-on-libusb-failure.patch: Upstream
    patch to fix the gutenprint52+usb CUPS backend crashing on failure
    of USB access via libusb (LP: #1297326).
  * debian/rules, debian/printer-driver-gutenprint.lintian-overrides: Set
    gutenprint52+usb CUPS backend to 700 permissions so that CUPS runs it as
    root (LP: #1297326).
  * debian/rules: Touch the *.ppd-updater files in override_dh_fixperms, as
    in override_dh_install-arch the change does not stay.
 -- Till Kamppeter <email address hidden> Tue, 18 Mar 2014 23:13:37 +0100

Changed in gutenprint (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers