Bug 500460

Summary: libfprint fails to read commands from SGS Thomson reader (ThinkPad T43)
Product: [Fedora] Fedora Reporter: Will Woods <wwoods>
Component: libfprintAssignee: Pierre-YvesChibon <pingou>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 11CC: awilliam, belegdol, bnocera, giallu, jlaska, justinburland, matt.britt, pingou, staubach
Target Milestone: ---Keywords: CommonBugs
Target Release: ---Flags: jlaska: fedora_requires_release_note?
Hardware: All   
OS: Linux   
Whiteboard: https://fedoraproject.org/wiki/Common_F11_bugs#libfprint-nonzero
Fixed In Version: 0.1.0-7.pre2.fc11.1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-06-24 15:42:20 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On:    
Bug Blocks: 446451    
Attachments:
Description Flags
libfprint-no-err-on-nonzero-cmd-bytes.patch none

Description Will Woods 2009-05-12 15:37:26 EDT
libfprint-0.1.0-6.pre1.fc11.i586 fails to read anything from the fingerprint reader on my ThinkPad T43. Every time it tries, it gets the following error messages:

upekts:error [__handle_incoming_msg] non-zero bytes in cmd response
upekts:error [initsm_read_msg_response_cb] expected response, got 0 seq=0 in state 13

It seems that my fingerprint reader puts non-zero bytes in two (otherwise ignored) bytes of the command response. I patched libfprint to treat that as a warning instead of an error, and now the fingerprint reader works. It emits this error every time a command response is read:

upekts:warning [__handle_incoming_msg] non-zero bytes in cmd response: fb ff

The two bytes are always fb ff.

lsusb -vvv output for my reader:

Bus 004 Device 002: ID 0483:2016 SGS Thomson Microelectronics Fingerprint Reader
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0         8
  idVendor           0x0483 SGS Thomson Microelectronics
  idProduct          0x2016 Fingerprint Reader
  bcdDevice            0.01
  iManufacturer           1 STMicroelectronics
  iProduct                2 Biometric Coprocessor
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           39
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0004  1x 4 bytes
        bInterval              20
Device Status:     0x0000
  (Bus Powered)
Comment 1 Will Woods 2009-05-12 15:38:36 EDT
Created attachment 343650 [details]
libfprint-no-err-on-nonzero-cmd-bytes.patch

Patch applied to fix the problem
Comment 2 Adam Williamson 2009-05-25 16:52:33 EDT
this was previously discussed upstream (and a similar patch proposed) but the thread seems to have just died:

http://osdir.com/ml/linux.fprint/2008-07/msg00008.html
Comment 3 Adam Williamson 2009-05-25 16:55:43 EDT
Google finds several people reporting slightly different things in those bytes:

upekts:error [read_msg] non-zero bytes in cmd response
upekts:error [read_msg28] expected response, got -1 seq=20
upekts:error [read_msg] non-zero bytes in cmd response
upekts:error [read_msg28] expected response, got -1 seq=30

here's one such - http://osdir.com/ml/linux.fprint/2008-04/msg00011.html
here's another - http://forums.opensuse.org/hardware/412754-usb-fingerprint-mouse-problem.html
Comment 4 Will Woods 2009-05-26 11:18:56 EDT
Not quite. Stock libfprint does not report the content of those two mysterious bytes at all; the message is just "non-zero bytes in cmd response". The "expected response, got ..." error message shows the return value of the function (which is -1 - i.e. failure - because of the non-zero bytes).

The patch in comment #1 changes the message to "non-zero bytes in cmd response: %02x %02x", which shows the two bytes. 

So we don't actually know yet if those other users are getting different values in those two bytes. But it's irrelevant, since the point of this patch is to ignore those values *regardless* of their value.
Comment 5 Adam Williamson 2009-05-27 00:44:02 EDT
yeah, I realized that after making my post :\ sorry about that.
Comment 6 Bug Zapper 2009-06-09 11:42:30 EDT
This bug appears to have been reported against 'rawhide' during the Fedora 11 development cycle.
Changing version to '11'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 7 Julian Sikorski 2009-06-09 15:22:44 EDT
I'm getting swarmed with these as soon as gnome-about-me attempts to enroll a fingerprint:
** Message: enroll_stage_cb: result -1
** Message: start enrollment device 0 finger 7
upekts:error [__handle_incoming_msg] non-zero bytes in cmd response
upekts:error [initsm_read_msg_response_cb] expected response, got 0 seq=0 in state 9
Comment 8 Julian Sikorski 2009-06-09 16:03:24 EDT
https://koji.fedoraproject.org/koji/taskinfo?taskID=1402305

A scratch build with patch from comment #1 included.
Comment 9 Julian Sikorski 2009-06-09 17:06:43 EDT
I can confirm that the patch fixes the problem:
[root@localhost liveuser]# /usr/libexec/fprintd -t
Launching FprintObject
** Message: D-Bus service launched with name: net.reactivated.Fprint
** Message: entering main loop
** Message: user 'liveuser' claiming the device: 0
** Message: now monitoring fd 7
** Message: device 0 claim status 0
** Message: start enrollment device 0 finger 7
upekts:warning [__handle_incoming_msg] non-zero bytes in cmd response: e3 fb
** Message: enroll_stage_cb: result 3
** Message: enroll_stage_cb: result 3
** Message: enroll_stage_cb: result 1
** Message: no longer monitoring fd 7
** Message: released device 0
Comment 10 Peter Staubach 2009-06-17 16:01:14 EDT
The attached patch also solves my problem on a Toshiba Tecra M5.
Comment 11 Fedora Update System 2009-06-20 11:16:32 EDT
libfprint-0.1.0-7.pre2.fc11.1 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/libfprint-0.1.0-7.pre2.fc11.1
Comment 12 Matt Britt 2009-06-21 23:22:38 EDT
Confirming patch works on another Thinkpad T43 (SGS Thomson reader).
Comment 13 Justin Burland 2009-06-24 06:01:14 EDT
installing libfprint-0.1.0-7.pre2.fc11.1.i586.rpm solved my issue on a IBM x41
Comment 14 Fedora Update System 2009-06-24 15:42:15 EDT
libfprint-0.1.0-7.pre2.fc11.1 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 15 Gianluca Sforna 2009-07-02 10:24:59 EDT
uhm, I had to install it from updates-testing, there something strange going on with bodhi or the mirrors :(
Comment 16 Fedora Update System 2009-07-03 15:48:10 EDT
libfprint-0.1.0-7.pre2.fc11.1 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.