pcscd cannot load a usb device. Error with libccid.so: undefined symbol: libusb_handle_events_completed

Bug #1745690 reported by Yavor Nikolov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pcsc-lite (Ubuntu)
Fix Released
Undecided
Ludovic Rousseau

Bug Description

I have a problem using my Smart Card with the latest ubuntu version (17.10). (It works fine with Ubuntu 14.04).

$ sudo service pcscd status

● pcscd.service - PC/SC Smart Card Daemon
   Loaded: loaded (/lib/systemd/system/pcscd.service; indirect; vendor preset: enabled)
   Active: inactive (dead) since Fri 2018-01-26 23:19:46 EET; 4min 58s ago
  Process: 6503 ExecStart=/usr/sbin/pcscd --foreground --auto-exit (code=exited, status=0/SUCCESS)
 Main PID: 6503 (code=exited, status=0/SUCCESS)
      CPU: 15ms

Jan 26 23:11:01 ubuntu systemd[1]: Started PC/SC Smart Card Daemon.
Jan 26 23:11:01 ubuntu pcscd[6503]: 00000000 dyn_unix.c:58:DYN_LoadLibrary() /usr/lib/pcsc/drivers/ifd-ccid.bundle/Contents/Linux/libccid.so: /usr/lib/pcsc/drivers/ifd-ccid.bundle/Contents/Linux/libccid.so: undefined symbol: libusb_handle_events_completed
Jan 26 23:11:01 ubuntu pcscd[6503]: 00000144 readerfactory.c:1081:RFInitializeReader() RFLoadReader failed: 0x80100014
Jan 26 23:11:01 ubuntu pcscd[6503]: 00000058 readerfactory.c:376:RFAddReader() ACS ACR 38U-CCID init failed.
Jan 26 23:11:01 ubuntu pcscd[6503]: 00000011 hotplug_libudev.c:523:HPAddDevice() Failed adding USB device: ACS ACR 38U-CCID
Jan 26 23:14:38 ubuntu pcscd[6503]: 99999999 dyn_unix.c:58:DYN_LoadLibrary() /usr/lib/pcsc/drivers/ifd-ccid.bundle/Contents/Linux/libccid.so: /usr/lib/pcsc/drivers/ifd-ccid.bundle/Contents/Linux/libccid.so: undefined symbol: libusb_handle_events_completed
Jan 26 23:14:38 ubuntu pcscd[6503]: 00000039 readerfactory.c:1081:RFInitializeReader() RFLoadReader failed: 0x80100014
Jan 26 23:14:38 ubuntu pcscd[6503]: 00000009 readerfactory.c:376:RFAddReader() ACS ACR 38U-CCID init failed.
Jan 26 23:14:38 ubuntu pcscd[6503]: 00000007 hotplug_libudev.c:523:HPAddDevice() Failed adding USB device: ACS ACR 38U-CCID

The problem is similar to something which someone else is facing: https://superuser.com/questions/1173940/debian-stretch-smartcard-reader-error-scardestablishcontext-service-not-availa

Revision history for this message
Ludovic Rousseau (ludovic-rousseau-gmail) wrote :

The CCID driver does not find the symbol "libusb_handle_events_completed". This symbol should be provided by the libusb library.

Have you rebuild libusb or libccid yourself?

Revision history for this message
Yavor Nikolov (yavor-nikolov) wrote :

No, I haven't rebuilt libusb or libccid myself. Maybe the dynamic loading mechanism doesn't find libusb. Or it doesn't look for it at all - as it complains about not being able to find the symbol in libccid.so specifically.

Revision history for this message
Yavor Nikolov (yavor-nikolov) wrote :

Wow, I managed to find the problem. Ludovic, you were actually pointing to the right thing to check:
$ ldd /usr/lib/pcsc/drivers/ifd-ccid.bundle/Contents/Linux/libccid.so
 linux-vdso.so.1 => (0x00007fff5e54f000)
 libusb-1.0.so.0 => /usr/local/lib/libusb-1.0.so.0 (0x00007fbee743d000)
 libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fbee721e000)
 libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fbee6e3e000)
 librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fbee6c36000)
 /lib64/ld-linux-x86-64.so.2 (0x00007fbee7867000)

For some reason I had a libusb installed to "/usr/local" which was taking precedence over the standard lubusb installation. I removed the local library and things work fine now.

Thank you!

Changed in pcsc-lite (Ubuntu):
status: New → Invalid
Revision history for this message
Ludovic Rousseau (ludovic-rousseau-gmail) wrote :

You had libusb installed in "/usr/local" and at the same time "No, I haven't rebuilt libusb or libccid myself." :-)

Closing the bug as it was a misconfiguration on your side.

Changed in pcsc-lite (Ubuntu):
assignee: nobody → Ludovic Rousseau (ludovic-rousseau-gmail)
status: Invalid → Fix Released
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.