Bug 247433 - pcscd up to 80% of CPI
pcscd up to 80% of CPI
Status: CLOSED DUPLICATE of bug 229263
Product: Fedora
Classification: Fedora
Component: pcsc-lite (Show other bugs)
7
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Bob Relyea
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-07-09 06:25 EDT by Giuseppe Paterno
Modified: 2007-11-30 17:12 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-10-10 11:22:44 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
strace of pcscd showing the usb scan (30.98 KB, application/octet-stream)
2007-10-10 07:31 EDT, Giuseppe Paterno
no flags Details

  None (edit)
Description Giuseppe Paterno 2007-07-09 06:25:01 EDT
Description of problem:
PCSCD is taking 80%-99% of CPU without any reason or messages.
The only message I got in /var/log/messages is:
pcscd: prothandler.c:109:PHSetProtocol() Protocol T=0 requested but unsupported
by the card

Smart Card reader is GEMPC card PCMCIA using ccid driver. File reader.conf is
--------------------------------------------------------------------------
# /etc/reader.conf.d/gempc.conf
# Gemplus reader with serial communication
#  - n is the serial port to use n in [0..3]
#  - reader is the reader name. It is needed for multi-slot readers.
#    Possible reader values are: GemPCPinPad, GemCorePOSPro, GemCoreSIMPro,
#    GemPCTwin (default value)
# example: /dev/ttyS0:GemPCPinPad
FRIENDLYNAME      "GemPCTwin serial"
DEVICENAME        /dev/ttyS2
LIBPATH           /usr/lib/pcsc/drivers/serial/libccidtwin.so.1.2.1
CHANNELID         2
--------------------------------------------------------------------------

The smartcard is an OpenPGP.
pcsc-lite is 1.3.3-1.fc7
ccid is 1.2.1-1fc7

smartcard is working fine.
System is working fine.

vmstat as follows:
procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
 3  0    176  10892  42636 337032    0    0   114    94  866  915 42 11 44  2  0
 2  0    176   8796  42656 339172    0    0     0  2236 1307  394 65 35  0  0  0
 4  0    176  28240  42668 319580    0    0     0     0 1284  376 65 36  0  0  0
 3  0    176  26376  42668 321552    0    0     6     0 1277  388 63 37  0  0  0
 6  0    176  25776  42680 322132    0    0    12  2918 1322  371 62 38  0  0  0
 3  1    176  25388  42680 322604    0    0    18     0 1259  366 61 39  0  0  0
Comment 1 Bob Relyea 2007-07-09 12:20:31 EDT
Do you have any other reader drivers installed, and if so what versions?
Comment 2 Giuseppe Paterno 2007-07-10 03:24:16 EDT
No, CCID is the only activated reader in readers.conf
There's openct installed as rpm, but is commented out.
Note that if I remove the pcmcia reader to use the UMTS card, pcsc will stay
80-95% of cpu. Of course I stop it when using UTMS, because it's useless.

Comment 3 Ludovic Rousseau 2007-07-20 06:10:16 EDT
The real question is what is the output of the command:
$ file /usr/lib/pcsc/drivers/
Comment 4 Giuseppe Paterno 2007-10-10 06:14:49 EDT
This is the output:

~$  find /usr/lib/pcsc/drivers/
/usr/lib/pcsc/drivers/
/usr/lib/pcsc/drivers/openct-ifd.bundle
/usr/lib/pcsc/drivers/openct-ifd.bundle/Contents
/usr/lib/pcsc/drivers/openct-ifd.bundle/Contents/Info.plist
/usr/lib/pcsc/drivers/openct-ifd.bundle/Contents/PkgInfo
/usr/lib/pcsc/drivers/openct-ifd.bundle/Contents/Linux
/usr/lib/pcsc/drivers/openct-ifd.bundle/Contents/Linux/openct-ifd.so
/usr/lib/pcsc/drivers/serial
/usr/lib/pcsc/drivers/serial/libccidtwin.so.1.2.1
/usr/lib/pcsc/drivers/ifd-egate.bundle
/usr/lib/pcsc/drivers/ifd-egate.bundle/Contents
/usr/lib/pcsc/drivers/ifd-egate.bundle/Contents/Info.plist
/usr/lib/pcsc/drivers/ifd-egate.bundle/Contents/Linux
/usr/lib/pcsc/drivers/ifd-egate.bundle/Contents/Linux/libifd_egate.so
/usr/lib/pcsc/drivers/ifd-ccid.bundle
/usr/lib/pcsc/drivers/ifd-ccid.bundle/Contents
/usr/lib/pcsc/drivers/ifd-ccid.bundle/Contents/Info.plist
/usr/lib/pcsc/drivers/ifd-ccid.bundle/Contents/Linux
/usr/lib/pcsc/drivers/ifd-ccid.bundle/Contents/Linux/libccid.so.1.2.1

The real problem is that pcscd keep scanning the usb bus in an infinitive loop.
An interim (workaround) solution would be a "sleep" between the scan of the usb
bus. Maybe the long term solution would be based on udev (but i'm not a developer).
Comment 5 Giuseppe Paterno 2007-10-10 07:31:14 EDT
Created attachment 222331 [details]
strace of pcscd showing the usb scan

This is the strace of pcscd showing that the usb scanning is in infinitive
loop.
this take me 100% of cpu, and in my laptop fans are ON all the times and my
(poor) battery is lasting no more than 30mins.
Comment 6 Ludovic Rousseau 2007-10-10 07:53:27 EDT
You are using 3 drivers for USB readers:
- openct-ifd
- ifd-egate
- ifd-ccid

I suggest to move all three *.bundle directories to somewhere else and then move them back one at a time 
and restart pcscd after each addition of a driver to see if CPU load is high.

It looks like a known bug in the ifd-egate and/or openct-ifd driver. See also bugs 229263 and 232983
Comment 7 Giuseppe Paterno 2007-10-10 11:22:44 EDT
Hi Ludovic, you're great. 
Removing openct worked fine and now the CPU has reasonable level.
Maybe we can mark this bug as dups of the above bug #229263


*** This bug has been marked as a duplicate of 229263 ***
Comment 8 Ludovic Rousseau 2007-10-10 16:32:56 EDT
(In reply to comment #7)
> Hi Ludovic, you're great. 

Yes, I know.

I have no objection if Red Hat wants to hire me :-)
Just use my private e-mail.

Note You need to log in before you can comment on or make changes to this bug.