Bug 350441

Summary: pcsc-lite uses 100% cpu
Product: [Fedora] Fedora Reporter: Mads Kiilerich <mads>
Component: pcsc-liteAssignee: Bob Relyea <rrelyea>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 8CC: horsley1953, nsoranzo, stijn
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Fedora 9 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-05-19 10:49:00 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Mads Kiilerich 2007-10-24 13:11:44 UTC
Description of problem:
Starting pcscd after installing openct causes pcscd to use 100% cpu

Version-Release number of selected component (if applicable):
pcsc-lite-1.3.3-1.fc7
openct-0.6.14-1.fc7

How reproducible:
100% - without any cardreader attached

Steps to Reproduce:
1. install pcsc-lite not openct: 0% cpu
2. install pcsc-lite and openct: 100% cpu
  
Additional info:
[root@localhost ~]# strace -o log /usr/sbin/pcscd --foreground --debug
pcscdaemon.c:319:main() pcscd set to foreground with debug send to stderr
debuglog.c:211:DebugLogSetLevel() debug level=debug
pcscdaemon.c:533:main() pcsc-lite 1.3.3 daemon ready.
hotplug_libusb.c:394:HPEstablishUSBNotifications() Driver openct-ifd.bundle does
not support IFD_GENERATE_HOTPLUG
^C
pcscdaemon.c:614:signal_trap() Preparing for suicide
hotplug_libusb.c:368:HPRescanUsbBus() Hotplug stopped
readerfactory.c:1363:RFCleanupReaders() entering cleaning function
pcscdaemon.c:558:at_exit() cleaning /var/run

Strace output hangs after:
close(5)                                = 0
mmap2(NULL, 10489856, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0xb75af000
mprotect(0xb75af000, 4096, PROT_NONE)   = 0
clone(child_stack=0xb7faf4b4,
flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID,
parent_tidptr=0xb7fafbd8, {entry_number:6, base_addr:0xb7fafb90, limit:1048575,
seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0,
useable:1}, child_tidptr=0xb7fafbd8) = 3297
select(5, [4], NULL, NULL, NULL

Comment 1 Mads Kiilerich 2007-10-24 13:17:30 UTC
Correction: It is pcsc-lite-openct-0.6.14-1.fc7 that trigs the problem, not openct.

It doesn't matter if openct service has been started or not

Comment 2 Mads Kiilerich 2007-10-24 13:23:16 UTC
and ctapi-cyberjack-pcsc causes the same ...

Comment 3 Ville Skyttä 2007-10-24 17:06:16 UTC
In that case, sounds like it's a problem with pcsc-lite, not openct.

FWIW, I cannot reproduce, works fine for me with
pcsc-lite-openct-0.6.14-1.fc7.x86_64, pcsc-lite-1.3.3-1.fc7.x86_64, Aladdin
eToken PRO.

Comment 4 Mads Kiilerich 2007-10-25 15:12:02 UTC
Yes, it is probably a pcsc-lite problem then.

Can I provide anything to help identify why it happens on my system only?
strace? gdb? debug flags?

Comment 5 Mads Kiilerich 2007-11-05 15:28:25 UTC
Same problem on "F8"
pcsc-lite-1.3.3-1.fc8
pcsc-lite-openct-0.6.14-3.fc8


Comment 6 Joshua Lamorie 2007-11-11 06:23:23 UTC
I have the same problem on Fedora 8, fresh install.  I have an Aladdin USB
eToken, but I haven't tried plugging it in yet.  The following shows up in
/var/log/messages.

messages:Nov 10 00:28:05 localhost pcscd: winscard.c:219:SCardConnect() Reader
E-Gate 0 0 Not Found
messages:Nov 10 00:28:05 localhost pcscd:last message repeated 4 times
messages:Nov 10 08:54:58 localhost pcscd:
hotplug_libusb.c:394:HPEstablishUSBNotifications() Driver openct-ifd.bundle does
not support IFD_GENERATE_HOTPLUG

However, when I do the following 

/usr/sbin/lsof |grep pcscd 

I notice that the following lines keep showing up (each line from a separate
execution of the above command).

pcscd     8783      root    6r  unknown                               
/proc/bus/usb/006 (stat: No such file or directory)
pcscd     8783      root    6       REG       0,17       52        282
/proc/bus/usb/005 lstat: No such file or directory)
pcscd     8783      root    6u  unknown                               
/proc/8783/fd/6 (readlink: No such file or directory)
pcscd     8783      root    6       DIR       0,17        0        251
/proc/bus/usb/004 lstat: No such file or directory)

So, does this mean that pcscd is polling for a USB device to be attached?  Is it
looking for "Reader E-Gate"?



Comment 7 Blagovest Lazarov 2007-11-19 16:25:59 UTC
I have exactly the same problem. pcscd works but uses 100% cpu.
Fresh instalation Fedora 8

pcsc-lite-openct-0.6.14-3.fc8
pcsc-lite-libs-1.3.3-1.fc8
pcsc-lite-doc-1.3.3-1.fc8
pcsc-lite-devel-1.3.3-1.fc8
openct-0.6.14-3.fc8

Nov 19 18:19:08 home pcscd: pcscdaemon.c:533:main() pcsc-lite 1.3.3 daemon ready.
Nov 19 18:19:08 home pcscd: hotplug_libusb.c:394:HPEstablishUSBNotifications()
Driver ifd-cyberjack.bundle does not support IFD_GENERATE_HOTPLUG


Comment 8 Bob Relyea 2007-11-19 19:00:34 UTC
Ah, We've added a new ifd which doesn't support IFD_GENERATE_HOTPLUG.

There is an already known bug the pcsc-lite goes to 100% cpu when old IFD's that
don't support hotplug are added.

We need a bug against ifd-cypberjack.bundle to get it to support
IFD_GENERATE_HOTPLUG if we are to make it install by default.

(the pcsc-lite issue also needs to be fixed as well).

Comment 9 Stijn Hoop 2008-02-12 09:44:50 UTC
Just to confirm: I see this issue on Fedora 8 as well, removing the packages
mentioned in comment 1 and comment 2 "fixes" the problem:

pcsc-lite-openct
ctapi-cyberjack-pcsc


Luckily we have no need for these two packages (yet).

Is bug 374291 related by the way?

Comment 10 Zachary Napora 2008-04-21 01:29:24 UTC
*** Bug 374291 has been marked as a duplicate of this bug. ***

Comment 11 Tom Horsley 2008-05-18 01:14:50 UTC
Just a note: I didn't see any smartcard related services eating my CPU
when I booted a freshly installed fedora 9, so it seems to be fixed
in F9.

Comment 12 Mads Kiilerich 2008-05-19 10:49:00 UTC
I can confirm that the reported problem seems to be fixed in Fedora 9. 

I however not tested if pcsc-lite actually works.