Bug#812087: pcscd takes 100 % cpu each time I insert a mass storage USB key

2016-03-28 Thread gustavo panizzo
On Mon, Mar 28, 2016 at 06:13:46 +0200, Ludovic Rousseau wrote:
> On Wed, 09 Mar 2016 10:20:27 +0800 gustavo panizzo  wrote:
> >Hello
> 
> Hi Gustavo,

Hello

> 
> >I just want to provide more information about the issue, I have an
> >SmartCard reader (ok, it is usb internally) and a g10 smartcard.
> >I can reproduce the issue plugging my phone as MTP device.
> >
> >If I had my phone connected while I started pcscd when I unplug it, pcscd
> >takes 100% of the CPU too.
> 
> What is your smartcard reader exactly?
> 
> Can you send me the result of the lsusb command?

I was on holiday, I will have access to the machine tomorrow

> 
> Thanks

thank you

--
1AE0 322E B8F7 4717 BDEA BF1D 44BB 1BA7 9F6C 6333

keybase: http://keybase.io/gfa



Bug#812087: pcscd takes 100 % cpu each time I insert a mass storage USB key

2016-03-28 Thread Ludovic Rousseau

On Wed, 09 Mar 2016 10:20:27 +0800 gustavo panizzo  wrote:

Hello


Hi Gustavo,


I just want to provide more information about the issue, I have an
SmartCard reader (ok, it is usb internally) and a g10 smartcard.
I can reproduce the issue plugging my phone as MTP device.

If I had my phone connected while I started pcscd when I unplug it, pcscd
takes 100% of the CPU too.


What is your smartcard reader exactly?

Can you send me the result of the lsusb command?

Thanks

--
Dr. Ludovic Rousseau



Bug#812087: pcscd takes 100 % cpu each time I insert a mass storage USB key

2016-03-08 Thread gustavo panizzo
Package: pcscd
Version: 1.8.15-1
Followup-For: Bug #812087

Hello

I just want to provide more information about the issue, I have an
SmartCard reader (ok, it is usb internally) and a g10 smartcard.
I can reproduce the issue plugging my phone as MTP device.

If I had my phone connected while I started pcscd when I unplug it, pcscd
takes 100% of the CPU too.



-- System Information:
Debian Release: stretch/sid
  APT prefers testing-updates
  APT policy: (500, 'testing-updates'), (500, 'testing-proposed-updates'), 
(500, 'testing'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.3.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages pcscd depends on:
ii  init-system-helpers 1.28
ii  libc6   2.19-22
ii  libccid [pcsc-ifd-handler]  1.4.22-1
ii  libpcsclite11.8.15-1
ii  libudev1228-6
ii  lsb-base9.20160110

pcscd recommends no packages.

Versions of packages pcscd suggests:
ii  systemd  228-6

-- no debconf information



Bug#812087: pcscd takes 100 % cpu each time I insert a mass storage USB key

2016-03-01 Thread Ludovic Rousseau

Hello,

I got no news from my latest email.

Do you still have the 100% CPU load for pcscd?
Can you help me fix the problem?

Thanks

Le 25/01/2016 17:33, Ludovic Rousseau a écrit :

Hello Alexander and Eric,

Le 25/01/2016 01:13, Alexander Mikhailian a écrit :

Package: pcscd
Version: 1.8.15-1
Followup-For: Bug #812087

Dear Maintainer,

I have the same problem with pcscd, and I did not even have to insert a
USB mass storage device, when I plug my notebook into the dock station,
fans go off like mad and pcscd takes on CPU cycles.


This bug is quiet strange.

Alexander, have you tried to generate libusb debug using:
$ sudo LIBUSB_DEBUG=99 /usr/sbin/pcscd -dfa

You may have to downgrade libusb-1.0-0 to version 1.0.19 from stable.



Another idea is to rebuild pcscd with hotplug debug enabled. No need to install 
pcscd so you can't break your installation.

1. Get the source code of pcsc-lite, for example from 
https://alioth.debian.org/frs/?group_id=30105_id=2019#pcsclite-_1.8.15-title-content

2. install the build dependencies using:
$ sudo apt-get build-dep pcscd

3. edit the file PCSC/src/hotplug_libudev.c and change the line 66 from
#undef DEBUG_HOTPLUG
to
#define DEBUG_HOTPLUG

4. configure pcsc-lite using "./configure"

5. run pcscd using:
$ sudo ./src/pcscd -dfa

6. try to reproduce the 100% CPU consumption problem

This may generate a lot of logs if the problem is with libudev.

Bye




--
 Dr. Ludovic Rousseau



Bug#812087: pcscd takes 100 % cpu each time I insert a mass storage USB key

2016-01-25 Thread Ludovic Rousseau

Hello Alexander and Eric,

Le 25/01/2016 01:13, Alexander Mikhailian a écrit :

Package: pcscd
Version: 1.8.15-1
Followup-For: Bug #812087

Dear Maintainer,

I have the same problem with pcscd, and I did not even have to insert a
USB mass storage device, when I plug my notebook into the dock station,
fans go off like mad and pcscd takes on CPU cycles.


This bug is quiet strange.

Alexander, have you tried to generate libusb debug using:
$ sudo LIBUSB_DEBUG=99 /usr/sbin/pcscd -dfa

You may have to downgrade libusb-1.0-0 to version 1.0.19 from stable.



Another idea is to rebuild pcscd with hotplug debug enabled. No need to install 
pcscd so you can't break your installation.

1. Get the source code of pcsc-lite, for example from 
https://alioth.debian.org/frs/?group_id=30105_id=2019#pcsclite-_1.8.15-title-content

2. install the build dependencies using:
$ sudo apt-get build-dep pcscd

3. edit the file PCSC/src/hotplug_libudev.c and change the line 66 from
#undef DEBUG_HOTPLUG
to
#define DEBUG_HOTPLUG

4. configure pcsc-lite using "./configure"

5. run pcscd using:
$ sudo ./src/pcscd -dfa

6. try to reproduce the 100% CPU consumption problem

This may generate a lot of logs if the problem is with libudev.

Bye

--
 Dr. Ludovic Rousseau



Bug#812087: pcscd takes 100 % cpu each time I insert a mass storage USB key

2016-01-24 Thread Alexander Mikhailian
Package: pcscd
Version: 1.8.15-1
Followup-For: Bug #812087

Dear Maintainer,

I have the same problem with pcscd, and I did not even have to insert a
USB mass storage device, when I plug my notebook into the dock station,
fans go off like mad and pcscd takes on CPU cycles.

-- System Information:
Debian Release: stretch/sid
  APT prefers testing
  APT policy: (900, 'testing'), (500, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.2.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_IE.UTF-8, LC_CTYPE=en_IE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)

Versions of packages pcscd depends on:
ii  init-system-helpers   1.24
ii  libacr38u [pcsc-ifd-handler]  1.7.11-1
ii  libc6 2.21-6
ii  libccid [pcsc-ifd-handler]1.4.22-1
ii  libpcsclite1  1.8.15-1
ii  libudev1  228-4
ii  lsb-base  9.20160110

pcscd recommends no packages.

Versions of packages pcscd suggests:
pn  systemd  



Bug#812087: pcscd takes 100 % cpu each time I insert a mass storage USB key

2016-01-22 Thread eric2.valette

  
  
On 01/22/2016 01:11 PM, VALETTE Eric
  OLNC/OLPS wrote:

On
  01/20/2016 03:07 PM, Ludovic Rousseau wrote:
  
  

It does not look like the problem is the Broadcom reader.


Can you generate a log as documented in
https://pcsclite.alioth.debian.org/pcsclite.html#support ?

Start the log and then connect your problematic mass-storage USB
key.


Thanks


  
  
  Here is the requested log file. Note that I'm not sure the trace
  will help:
  
      1) As soon as I launch it, I have continuous traces but
  process does not even appaers in the top first twenty line,
  
      2) As soon as I plug the USB key, it reaches 100% CPU and top
  first place but do not show anything diffrent in the log.
  
  
  will try a strace...
  
  
  -- eric
  
  


I have a pattern change in strace a soon as I plug the key.

NB: in few second after plug I got a 60 MB file
-- eric
  _

Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc
pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler
a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration,
Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.

This message and its attachments may contain confidential or privileged information that may be protected by law;
they should not be distributed, used or copied without authorisation.
If you have received this email in error, please notify the sender and delete this message and its attachments.
As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified.
Thank you.


[pid 18790] recvmsg(11, {msg_name(12)={sa_family=AF_NETLINK, pid=213, 
groups=0002}, 
msg_iov(1)=[{"libudev\0\376\355\312\376(\0\0\0(\0\0\0\265\2\0\0\5w\305\345'\370\365\f"...,
 8192}], msg_controllen=32, [{cmsg_len=28, cmsg_level=SOL_SOCKET, 
cmsg_type=SCM_CREDENTIALS, {pid=18861, uid=0, gid=0}}], msg_flags=0}, 0) = 733
[pid 18790] mmap(NULL, 134217728, PROT_NONE, 
MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0) = 0x7ff11000
[pid 18790] munmap(0x7ff11400, 67108864) = 0
[pid 18790] mprotect(0x7ff11000, 135168, PROT_READ|PROT_WRITE) = 0
[pid 18790] gettid()= 18790
[pid 18790] getrandom("\205\16\310\326D\217P\r\vg\331\v\323\342\314\342", 16, 
GRND_NONBLOCK) = 16
[pid 18790] getrandom("\255\204\213\20Zs\341\323\356&\347\36\376@T\310", 16, 
GRND_NONBLOCK) = 16
[pid 18790] getrandom("\357Z\317\30d\332?Yi\367\273W\276\301K\365", 16, 
GRND_NONBLOCK) = 16
[pid 18790] open("/sys/bus/usb/devices/2-1.3/busnum", O_RDONLY) = 20
[pid 18790] fstat(20, {st_mode=S_IFREG|0444, st_size=4096, ...}) = 0
[pid 18790] mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, 
-1, 0) = 0x7ff129b0b000
[pid 18790] read(20, "2\n", 4096)   = 2
[pid 18790] close(20)   = 0
[pid 18790] munmap(0x7ff129b0b000, 4096) = 0
[pid 18790] open("/sys/bus/usb/devices/2-1.3/devnum", O_RDONLY) = 20
[pid 18790] fstat(20, {st_mode=S_IFREG|0444, st_size=4096, ...}) = 0
[pid 18790] mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, 
-1, 0) = 0x7ff129b0b000
[pid 18790] read(20, "7\n", 4096)   = 2
[pid 18790] close(20)   = 0
[pid 18790] munmap(0x7ff129b0b000, 4096) = 0
[pid 18790] open("/sys/bus/usb/devices/2-1.3/speed", O_RDONLY) = 20
[pid 18790] fstat(20, {st_mode=S_IFREG|0444, st_size=4096, ...}) = 0
[pid 18790] mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, 
-1, 0) = 0x7ff129b0b000
[pid 18790] read(20, "480\n", 4096) = 4
[pid 18790] close(20)   = 0
[pid 18790] munmap(0x7ff129b0b000, 4096) = 0
[pid 18790] open("/sys/bus/usb/devices/2-1.3/descriptors", O_RDONLY) = 20
[pid 18790] read(20, "\22\1\0\2\0\0\0@\376\23\0\35\20\1\1\2\3\1\t\2 
\0\1\1\0\200d\t\4\0\0\2"..., 1024) = 50
[pid 18790] close(20)   = 0
[pid 18790] write(15, "\1", 1 
[pid 18795] <... restart_syscall resumed> ) = 1
[pid 18790] <... write resumed> )   = 1
[pid 18795] futex(0x1cd1610, FUTEX_WAIT_PRIVATE, 2, NULL 
[pid 18790] futex(0x1cd1610, FUTEX_WAKE_PRIVATE, 1 
[pid 18795] <... futex resumed> )   = -1 EAGAIN (Resource temporarily 
unavailable)
[pid 18790] <... futex resumed> )   = 0
[pid 18795] read(14,  
[pid 18790] futex(0x7ff128d054c0, FUTEX_WAKE_PRIVATE, 1 
[pid 18795] <... read resumed> "\1", 1) = 1
[pid 18791] <... futex resumed> )   = 0
[pid 18790] <... futex resumed> )   = 1
[pid 18795] futex(0x1cd1610, FUTEX_WAKE_PRIVATE, 1 
[pid 18791] 

Bug#812087: pcscd takes 100 % cpu each time I insert a mass storage USB key

2016-01-22 Thread Ludovic Rousseau

Le 22/01/2016 13:11, eric2.vale...@orange.com a écrit :

On 01/20/2016 03:07 PM, Ludovic Rousseau wrote:


It does not look like the problem is the Broadcom reader.

Can you generate a log as documented in 
https://pcsclite.alioth.debian.org/pcsclite.html#support ?
Start the log and then connect your problematic mass-storage USB key.

Thanks



Here is the requested log file. Note that I'm not sure the trace will help:
 1) As soon as I launch it, I have continuous traces but process does not 
even appaers in the top first twenty line,


You have 1 (or 2) application that is continuously (every 200 ms) asking PC/SC 
for card status. That is a very bad PC/SC behaviour.
You should try to identify the bogus application and fix it.


 2) As soon as I plug the USB key, it reaches 100% CPU and top first place 
but do not show anything diffrent in the log.

will try a strace...


[pid 18790] poll([{fd=6, events=POLLIN}, {fd=5, events=POLLIN}], 2, -1) = 1 
([{fd=5, revents=POLLIN}])
[pid 18790] recvmsg(11, 0x7ff128ae9dd0, 0) = -1 EAGAIN (Resource temporarily 
unavailable)
[pid 18790] poll([{fd=6, events=POLLIN}, {fd=5, events=POLLIN}], 2, -1) = 1 
([{fd=5, revents=POLLIN}])
[pid 18790] recvmsg(11, 0x7ff128ae9dd0, 0) = -1 EAGAIN (Resource temporarily 
unavailable)
[pid 18790] poll([{fd=6, events=POLLIN}, {fd=5, events=POLLIN}], 2, -1) = 1 
([{fd=5, revents=POLLIN}])
[pid 18790] recvmsg(11, 0x7ff128ae9dd0, 0) = -1 EAGAIN (Resource temporarily 
unavailable)
[pid 18790] poll([{fd=6, events=POLLIN}, {fd=5, events=POLLIN}], 2, -1) = 1 
([{fd=5, revents=POLLIN}])
[pid 18790] recvmsg(11, 0x7ff128ae9dd0, 0) = -1 EAGAIN (Resource temporarily 
unavailable)

Maybe a problem in libusb.

Do you have kernel errors in dmesg output?

What is the output of "lsusb -v" with the USB key plugged in?

Bye

--
 Dr. Ludovic Rousseau



Bug#812087: pcscd takes 100 % cpu each time I insert a mass storage USB key

2016-01-22 Thread eric2.valette

On 01/22/2016 03:06 PM, Ludovic Rousseau wrote:

Le 22/01/2016 13:11, eric2.vale...@orange.com a écrit :

On 01/20/2016 03:07 PM, Ludovic Rousseau wrote:


It does not look like the problem is the Broadcom reader.

Can you generate a log as documented in 
https://pcsclite.alioth.debian.org/pcsclite.html#support ?

Start the log and then connect your problematic mass-storage USB key.

Thanks



Here is the requested log file. Note that I'm not sure the trace will 
help:
 1) As soon as I launch it, I have continuous traces but process 
does not even appaers in the top first twenty line,


You have 1 (or 2) application that is continuously (every 200 ms) 
asking PC/SC for card status. That is a very bad PC/SC behaviour.

You should try to identify the bogus application and fix it.
I guess I have installed a binary blob packages given my a key 
manufacturer :-( SACSrv il you kinow wht it is... Will kill it and retry


 2) As soon as I plug the USB key, it reaches 100% CPU and top 
first place but do not show anything diffrent in the log.


will try a strace...


[pid 18790] poll([{fd=6, events=POLLIN}, {fd=5, events=POLLIN}], 2, 
-1) = 1 ([{fd=5, revents=POLLIN}])
[pid 18790] recvmsg(11, 0x7ff128ae9dd0, 0) = -1 EAGAIN (Resource 
temporarily unavailable)
[pid 18790] poll([{fd=6, events=POLLIN}, {fd=5, events=POLLIN}], 2, 
-1) = 1 ([{fd=5, revents=POLLIN}])
[pid 18790] recvmsg(11, 0x7ff128ae9dd0, 0) = -1 EAGAIN (Resource 
temporarily unavailable)
[pid 18790] poll([{fd=6, events=POLLIN}, {fd=5, events=POLLIN}], 2, 
-1) = 1 ([{fd=5, revents=POLLIN}])
[pid 18790] recvmsg(11, 0x7ff128ae9dd0, 0) = -1 EAGAIN (Resource 
temporarily unavailable)
[pid 18790] poll([{fd=6, events=POLLIN}, {fd=5, events=POLLIN}], 2, 
-1) = 1 ([{fd=5, revents=POLLIN}])
[pid 18790] recvmsg(11, 0x7ff128ae9dd0, 0) = -1 EAGAIN (Resource 
temporarily unavailable)


Maybe a problem in libusb.

Do you have kernel errors in dmesg output?

No. Nothing unusual except USB storage medium traces.


What is the output of "lsusb -v" with the USB key plugged in?

Attached...

-- eric


_

Ce message et ses pieces jointes peuvent contenir des informations 
confidentielles ou privilegiees et ne doivent donc
pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce 
message par erreur, veuillez le signaler
a l'expediteur et le detruire ainsi que les pieces jointes. Les messages 
electroniques etant susceptibles d'alteration,
Orange decline toute responsabilite si ce message a ete altere, deforme ou 
falsifie. Merci.

This message and its attachments may contain confidential or privileged 
information that may be protected by law;
they should not be distributed, used or copied without authorisation.
If you have received this email in error, please notify the sender and delete 
this message and its attachments.
As emails may be altered, Orange is not liable for messages that have been 
modified, changed or falsified.
Thank you.


Bus 002 Device 004: ID 0a5c:5800 Broadcom Corp. BCM5880 Secure Applications 
Processor
Device Descriptor:
  bLength18
  bDescriptorType 1
  bcdUSB   1.10
  bDeviceClass0 (Defined at Interface level)
  bDeviceSubClass 0 
  bDeviceProtocol 0 
  bMaxPacketSize064
  idVendor   0x0a5c Broadcom Corp.
  idProduct  0x5800 BCM5880 Secure Applications Processor
  bcdDevice1.01
  iManufacturer   1 Broadcom Corp
  iProduct2 5880
  iSerial 3 0123456789ABCD
  bNumConfigurations  1
  Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength  139
bNumInterfaces  2
bConfigurationValue 0
iConfiguration  0 
bmAttributes 0xc0
  Self Powered
MaxPower  100mA
Interface Descriptor:
  bLength 9
  bDescriptorType 4
  bInterfaceNumber0
  bAlternateSetting   0
  bNumEndpoints   3
  bInterfaceClass   254 Application Specific Interface
  bInterfaceSubClass  0 
  bInterfaceProtocol  0 
  iInterface  4 Broadcom USH
  ** UNRECOGNIZED:  10 25 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81  EP 1 IN
bmAttributes2
  Transfer TypeBulk
  Synch Type   None
  Usage Type   Data
wMaxPacketSize 0x0040  1x 64 bytes
bInterval   0
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x01  EP 1 OUT
bmAttributes2
  Transfer Type

Bug#812087: pcscd takes 100 % cpu each time I insert a mass storage USB key

2016-01-22 Thread Eric Valette



>> You can identify a process using PC/SC using:
>> $ sudo fuser /usr/lib/x86_64-linux-gnu/libpcsclite.so.1
> sudo fuser /usr/lib/x86_64-linux-gnu/libpcsclite.so.1
> [sudo] password for ceva6380:
> /usr/lib/x86_64-linux-gnu/libpcsclite.so.1.0.0: 14662m
> 19 r-x-ceva6380:~->ps ax | grep 14662
> 14662 ?Sl11:53 /usr/bin/iceweasel
> 22156 pts/5S+ 0:00 grep 14662
>
>
> Quite strange!!!


Not strange the fact that is may use pcscd, but that it polls at this 
high frequence. I indeed added my PKI via oppropriate library to both FF 
and TB...



Will try to downgrade libusb do when back at work.

-- eric



Bug#812087: pcscd takes 100 % cpu each time I insert a mass storage USB key

2016-01-22 Thread Ludovic Rousseau

Le 22/01/2016 15:18, eric2.vale...@orange.com a écrit :

On 01/22/2016 03:06 PM, Ludovic Rousseau wrote:

Le 22/01/2016 13:11, eric2.vale...@orange.com a écrit :

On 01/20/2016 03:07 PM, Ludovic Rousseau wrote:


It does not look like the problem is the Broadcom reader.

Can you generate a log as documented in 
https://pcsclite.alioth.debian.org/pcsclite.html#support ?
Start the log and then connect your problematic mass-storage USB key.

Thanks



Here is the requested log file. Note that I'm not sure the trace will help:
 1) As soon as I launch it, I have continuous traces but process does not 
even appaers in the top first twenty line,


You have 1 (or 2) application that is continuously (every 200 ms) asking PC/SC 
for card status. That is a very bad PC/SC behaviour.
You should try to identify the bogus application and fix it.

I guess I have installed a binary blob packages given my a key manufacturer :-( 
SACSrv il you kinow wht it is... Will kill it and retry


You can identify a process using PC/SC using:
$ sudo fuser /usr/lib/x86_64-linux-gnu/libpcsclite.so.1


Maybe a problem in libusb.


What version of libusb are you using?

Run pcscd as:
$ sudo LIBUSB_DEBUG=99 /usr/sbin/pcscd -dfa

Bye

--
 Dr. Ludovic Rousseau



Bug#812087: pcscd takes 100 % cpu each time I insert a mass storage USB key

2016-01-22 Thread eric2.valette

  
  
On 01/22/2016 03:52 PM, Ludovic
  Rousseau wrote:

Le
  22/01/2016 15:18, eric2.vale...@orange.com a écrit :
  
  On 01/22/2016 03:06 PM, Ludovic Rousseau
wrote:

Le 22/01/2016 13:11,
  eric2.vale...@orange.com a écrit :
  
  On 01/20/2016 03:07 PM, Ludovic
Rousseau wrote:


  
  It does not look like the problem is the Broadcom reader.
  
  
  Can you generate a log as documented in
  https://pcsclite.alioth.debian.org/pcsclite.html#support ?
  
  Start the log and then connect your problematic
  mass-storage USB key.
  
  
  Thanks
  
  


Here is the requested log file. Note that I'm not sure the
trace will help:

 1) As soon as I launch it, I have continuous traces but
process does not even appaers in the top first twenty line,

  
  
  You have 1 (or 2) application that is continuously (every 200
  ms) asking PC/SC for card status. That is a very bad PC/SC
  behaviour.
  
  You should try to identify the bogus application and fix it.
  

I guess I have installed a binary blob packages given my a key
manufacturer :-( SACSrv il you kinow wht it is... Will kill it
and retry

  
  
  You can identify a process using PC/SC using:
  
  $ sudo fuser /usr/lib/x86_64-linux-gnu/libpcsclite.so.1
  

sudo fuser /usr/lib/x86_64-linux-gnu/libpcsclite.so.1
[sudo] password for ceva6380: 
/usr/lib/x86_64-linux-gnu/libpcsclite.so.1.0.0: 14662m
19 r-x-ceva6380:~->ps ax | grep 14662
14662 ?    Sl    11:53 /usr/bin/iceweasel
22156 pts/5    S+ 0:00 grep 14662


Quite strange!!!

  
  
Maybe a problem in libusb.
  

  
  
  What version of libusb are you using?
  

dpkg -l libusb*
Desired=Unknown/Install/Remove/Purge/Hold
|
Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name  Version  
Architecture  Description
+++-=-=-=-
ii  libusb-0.1-4:amd64    2:0.1.12-28  
amd64 userspace USB programming library
ii  libusb-1.0-0:amd64    2:1.0.20-1   
amd64 userspace USB programming library
ii  libusb-1.0-0-dev:amd64    2:1.0.20-1   
amd64 userspace USB programming library development
files
ii  libusb-1.0-doc    2:1.0.20-1   
all   documentation for userspace USB programming
ii  libusb-dev    2:0.1.12-28  
amd64 userspace USB programming library development
files
ii  libusbmuxd-dev:amd64  1.0.10-2 
amd64 USB multiplexor daemon for iPhone and iPod
Touch devices - devel
ii  libusbmuxd-tools  1.0.10-2 
amd64 USB multiplexor daemon for iPhone and iPod
Touch devices - tools
ii  libusbmuxd4:amd64 1.0.10-2 
amd64 USB multiplexor daemon for iPhone and iPod
Touch devices - library
2 r-x-ceva6380:~->su


  
  Run pcscd as:
  
  $ sudo LIBUSB_DEBUG=99 /usr/sbin/pcscd -dfa
  
  
  Bye
  
  

attached log  : no specific usb trace while pcscd is at 100% cpu.

-- 
Eric Valette
Orange Lab Product and Services
Homebox Etudes Architecture et Développement 
Architecte Livebox et Set Top Box
tél : (+33) 2 99 12 45 71
mél : 

  _

Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc
pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler
a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration,
Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.

This message and its attachments may contain confidential or privileged information that may be protected by law;
they should not be distributed, used or copied without 

Bug#812087: pcscd takes 100 % cpu each time I insert a mass storage USB key

2016-01-22 Thread Ludovic Rousseau

Le 22/01/2016 16:05, eric2.vale...@orange.com a écrit :

On 01/22/2016 03:52 PM, Ludovic Rousseau wrote:

Le 22/01/2016 15:18, eric2.vale...@orange.com a écrit :

On 01/22/2016 03:06 PM, Ludovic Rousseau wrote:

Le 22/01/2016 13:11, eric2.vale...@orange.com a écrit :

On 01/20/2016 03:07 PM, Ludovic Rousseau wrote:


It does not look like the problem is the Broadcom reader.

Can you generate a log as documented in 
https://pcsclite.alioth.debian.org/pcsclite.html#support ?
Start the log and then connect your problematic mass-storage USB key.

Thanks



Here is the requested log file. Note that I'm not sure the trace will help:
 1) As soon as I launch it, I have continuous traces but process does not 
even appaers in the top first twenty line,


You have 1 (or 2) application that is continuously (every 200 ms) asking PC/SC 
for card status. That is a very bad PC/SC behaviour.
You should try to identify the bogus application and fix it.

I guess I have installed a binary blob packages given my a key manufacturer :-( 
SACSrv il you kinow wht it is... Will kill it and retry


You can identify a process using PC/SC using:
$ sudo fuser /usr/lib/x86_64-linux-gnu/libpcsclite.so.1

sudo fuser /usr/lib/x86_64-linux-gnu/libpcsclite.so.1
[sudo] password for ceva6380:
/usr/lib/x86_64-linux-gnu/libpcsclite.so.1.0.0: 14662m
19 r-x-ceva6380:~->ps ax | grep 14662
14662 ?Sl11:53 /usr/bin/iceweasel
22156 pts/5S+ 0:00 grep 14662


Quite strange!!!


Not really.
You (or an installation script) has configured a PKCS#11 token in iceveasel.
See 
https://github.com/OpenSC/OpenSC/wiki/Installing-OpenSC-PKCS%2311-Module-in-Firefox,-Step-by-Step




Maybe a problem in libusb.


What version of libusb are you using?

dpkg -l libusb*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name  Version Architecture  Description
+++-=-=-=-
ii  libusb-0.1-4:amd642:0.1.12-28 amd64 
userspace USB programming library
ii  libusb-1.0-0:amd642:1.0.20-1 amd64 
userspace USB programming library
ii  libusb-1.0-0-dev:amd642:1.0.20-1 amd64 
userspace USB programming library development files
ii  libusb-1.0-doc2:1.0.20-1 all   
documentation for userspace USB programming
ii  libusb-dev2:0.1.12-28 amd64 
userspace USB programming library development files
ii  libusbmuxd-dev:amd64  1.0.10-2 amd64 USB 
multiplexor daemon for iPhone and iPod Touch devices - devel
ii  libusbmuxd-tools  1.0.10-2 amd64 USB 
multiplexor daemon for iPhone and iPod Touch devices - tools
ii  libusbmuxd4:amd64 1.0.10-2 amd64 USB 
multiplexor daemon for iPhone and iPod Touch devices - library
2 r-x-ceva6380:~->su



Run pcscd as:
$ sudo LIBUSB_DEBUG=99 /usr/sbin/pcscd -dfa

Bye


attached log  : no specific usb trace while pcscd is at 100% cpu.


Strange.
I also have the Debian package for libusb (1.0.19 from stable) and I get libusb 
logs.

Can you downgrade libusb to version 1.0.19 and test again?

bye

--
 Dr. Ludovic Rousseau



Bug#812087: pcscd takes 100 % cpu each time I insert a mass storage USB key

2016-01-20 Thread Ludovic Rousseau

Le 20/01/2016 13:03, Eric Valette a écrit :

Package: pcscd
Version: 1.8.15-1
Severity: critical
Justification: breaks unrelated software

Twice in two days, I noticed my laptop fan was going carsy allthough I
was only doing many mail activity.

Twice I found that pcscd was eating a complete CPU and remembered that
each time I had inserted a regular mass storage USB key (two different keys)
not my crypto key.

  -
top - 12:56:25 up  3:14,  5 users,  load average: 2.03, 1.56, 1.31
Tasks: 242 total,   2 running, 239 sleeping,   0 stopped,   1 zombie
%Cpu(s): 34.1 us, 21.1 sy,  0.0 ni, 44.8 id,  0.0 wa,  0.0 hi,  0.1 si,  0.0 st
KiB Mem :  8219052 total,  3472188 free,  2336828 used,  2410036 buff/cache
KiB Swap: 16383996 total, 16383996 free,0 used.  5812264 avail Mem

   PID USER  PR  NIVIRTRESSHR S  %CPU %MEM TIME+ COMMAND
  1687 root  20   0  394560   2916   2120 S 100.3  0.0 147:37.75 pcscd
14477 ceva6380  20   0  424288  57364  37792 R  99.7  0.7   2:59.83 konsole
  2921 ceva6380  20   0 1410776 448992  87860 S  15.9  5.5   6:48.46 icedove
  4463 ceva6380  20   0 1435116 363080  97112 S   1.7  4.4   4:12.69 iceweasel


Do you have some pcscd related logs in /var/log/* ?

Bye

--
 Dr. Ludovic Rousseau



Bug#812087: pcscd takes 100 % cpu each time I insert a mass storage USB key

2016-01-20 Thread eric2.valette

On 01/20/2016 01:31 PM, Ludovic Rousseau wrote:

Le 20/01/2016 13:03, Eric Valette a écrit :

Package: pcscd
Version: 1.8.15-1
Severity: critical
Justification: breaks unrelated software

Twice in two days, I noticed my laptop fan was going carsy allthough I
was only doing many mail activity.

Twice I found that pcscd was eating a complete CPU and remembered that
each time I had inserted a regular mass storage USB key (two 
different keys)

not my crypto key.

  -
top - 12:56:25 up  3:14,  5 users,  load average: 2.03, 1.56, 1.31
Tasks: 242 total,   2 running, 239 sleeping,   0 stopped,   1 zombie
%Cpu(s): 34.1 us, 21.1 sy,  0.0 ni, 44.8 id,  0.0 wa,  0.0 hi, 0.1 
si,  0.0 st
KiB Mem :  8219052 total,  3472188 free,  2336828 used,  2410036 
buff/cache
KiB Swap: 16383996 total, 16383996 free,0 used.  5812264 
avail Mem


   PID USER  PR  NIVIRTRESSHR S  %CPU %MEM TIME+ COMMAND
  1687 root  20   0  394560   2916   2120 S 100.3  0.0 147:37.75 
pcscd
14477 ceva6380  20   0  424288  57364  37792 R  99.7  0.7 2:59.83 
konsole
  2921 ceva6380  20   0 1410776 448992  87860 S  15.9  5.5 6:48.46 
icedove
  4463 ceva6380  20   0 1435116 363080  97112 S   1.7  4.4 4:12.69 
iceweasel


Do you have some pcscd related logs in /var/log/* ?

Bye



Note that in the laptop there is a build in  broadcom credit card format 
crypto key reader (that you see in the log), but I do not use it 
although for testing purpose I have enabled the driver. But the bug is 
only if I insert a USB key.





daemon.log:Jan 18 15:17:11 r-x-ceva6380 pcscd[11283]:  
ifdhandler.c:144:CreateChannelByNameOrChannel() failed
daemon.log:Jan 18 15:17:11 r-x-ceva6380 pcscd[11283]: 0032 
readerfactory.c:1097:RFInitializeReader() Open Port 0x20 Failed 
(usb:0a5c/5800:libudev:0:/dev/bus/usb/002/004)
daemon.log:Jan 18 15:17:11 r-x-ceva6380 pcscd[11283]: 0004 
readerfactory.c:372:RFAddReader() Broadcom Corp 5880 [Broadcom USH] 
(0123456789ABCD) init failed.
daemon.log:Jan 19 13:52:56 r-x-ceva6380 pcscd[1604]:  
ifdhandler.c:144:CreateChannelByNameOrChannel() failed
daemon.log:Jan 19 13:52:56 r-x-ceva6380 pcscd[1604]: 0027 
readerfactory.c:1097:RFInitializeReader() Open Port 0x20 Failed 
(usb:0a5c/5800:libudev:0:/dev/bus/usb/002/004)
daemon.log:Jan 19 13:52:56 r-x-ceva6380 pcscd[1604]: 0005 
readerfactory.c:372:RFAddReader() Broadcom Corp 5880 [Broadcom USH] 
(0123456789ABCD) init failed.
daemon.log:Jan 20 09:42:05 r-x-ceva6380 pcscd[1687]:  
ifdhandler.c:144:CreateChannelByNameOrChannel() failed
daemon.log:Jan 20 09:42:05 r-x-ceva6380 pcscd[1687]: 0026 
readerfactory.c:1097:RFInitializeReader() Open Port 0x20 Failed 
(usb:0a5c/5800:libudev:0:/dev/bus/usb/002/004)
daemon.log:Jan 20 09:42:05 r-x-ceva6380 pcscd[1687]: 0004 
readerfactory.c:372:RFAddReader() Broadcom Corp 5880 [Broadcom USH] 
(0123456789ABCD) init failed.
daemon.log:Jan 20 12:56:47 r-x-ceva6380 systemd[1]: pcscd.service: Main 
process exited, code=killed, status=9/KILL
daemon.log:Jan 20 12:56:47 r-x-ceva6380 systemd[1]: pcscd.service: Unit 
entered failed state.
daemon.log:Jan 20 12:56:47 r-x-ceva6380 systemd[1]: pcscd.service: 
Failed with result 'signal'.   < killed it by kill -9 to get CPU back
daemon.log:Jan 20 12:56:47 r-x-ceva6380 pcscd[14663]:  
ifdhandler.c:144:CreateChannelByNameOrChannel() failed
daemon.log:Jan 20 12:56:47 r-x-ceva6380 pcscd[14663]: 0022 
readerfactory.c:1097:RFInitializeReader() Open Port 0x20 Failed 
(usb:0a5c/5800:libudev:0:/dev/bus/usb/002/004)
daemon.log:Jan 20 12:56:47 r-x-ceva6380 pcscd[14663]: 0003 
readerfactory.c:372:RFAddReader() Broadcom Corp 5880 [Broadcom USH] 
(0123456789ABCD) init failed.



-- eric
 



_

Ce message et ses pieces jointes peuvent contenir des informations 
confidentielles ou privilegiees et ne doivent donc
pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce 
message par erreur, veuillez le signaler
a l'expediteur et le detruire ainsi que les pieces jointes. Les messages 
electroniques etant susceptibles d'alteration,
Orange decline toute responsabilite si ce message a ete altere, deforme ou 
falsifie. Merci.

This message and its attachments may contain confidential or privileged 
information that may be protected by law;
they should not be distributed, used or copied without authorisation.
If you have received this email in error, please notify the sender and delete 
this message and its attachments.
As emails may be altered, Orange is not liable for messages that have been 
modified, changed or falsified.
Thank you.



Bug#812087: pcscd takes 100 % cpu each time I insert a mass storage USB key

2016-01-20 Thread Eric Valette
Package: pcscd
Version: 1.8.15-1
Severity: critical
Justification: breaks unrelated software

Twice in two days, I noticed my laptop fan was going carsy allthough I
was only doing many mail activity.

Twice I found that pcscd was eating a complete CPU and remembered that
each time I had inserted a regular mass storage USB key (two different keys)
not my crypto key.

 -
top - 12:56:25 up  3:14,  5 users,  load average: 2.03, 1.56, 1.31
Tasks: 242 total,   2 running, 239 sleeping,   0 stopped,   1 zombie
%Cpu(s): 34.1 us, 21.1 sy,  0.0 ni, 44.8 id,  0.0 wa,  0.0 hi,  0.1 si,  0.0 st
KiB Mem :  8219052 total,  3472188 free,  2336828 used,  2410036 buff/cache
KiB Swap: 16383996 total, 16383996 free,0 used.  5812264 avail Mem 

  PID USER  PR  NIVIRTRESSHR S  %CPU %MEM TIME+ COMMAND 
 
 1687 root  20   0  394560   2916   2120 S 100.3  0.0 147:37.75 pcscd   
 
14477 ceva6380  20   0  424288  57364  37792 R  99.7  0.7   2:59.83 konsole 
 
 2921 ceva6380  20   0 1410776 448992  87860 S  15.9  5.5   6:48.46 icedove 
 
 4463 ceva6380  20   0 1435116 363080  97112 S   1.7  4.4   4:12.69 iceweasel 

-- System Information:
Debian Release: stretch/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 4.4.0 (SMP w/4 CPU cores; PREEMPT)
Locale: LANG=en_US.UTF8, LC_CTYPE=en_US.UTF8 (charmap=UTF-8) (ignored: LC_ALL 
set to en_US.UTF8)
Shell: /bin/sh linked to /bin/bash
Init: systemd (via /run/systemd/system)

Versions of packages pcscd depends on:
ii  init-system-helpers 1.25
ii  libc6   2.22-0experimental1
ii  libccid [pcsc-ifd-handler]  1.4.22-1
ii  libpcsclite11.8.15-1
ii  libudev1228-4
ii  lsb-base9.20160110

pcscd recommends no packages.

Versions of packages pcscd suggests:
ii  systemd  228-4

-- no debconf information



Bug#812087: pcscd takes 100 % cpu each time I insert a mass storage USB key

2016-01-20 Thread Ludovic Rousseau

Le 20/01/2016 14:02, eric2.vale...@orange.com a écrit :

Note that in the laptop there is a build in  broadcom credit card format crypto 
key reader (that you see in the log), but I do not use it although for testing 
purpose I have enabled the driver. But the bug is only if I insert a USB key.




daemon.log:Jan 18 15:17:11 r-x-ceva6380 pcscd[11283]:  
ifdhandler.c:144:CreateChannelByNameOrChannel() failed
daemon.log:Jan 18 15:17:11 r-x-ceva6380 pcscd[11283]: 0032 
readerfactory.c:1097:RFInitializeReader() Open Port 0x20 Failed 
(usb:0a5c/5800:libudev:0:/dev/bus/usb/002/004)
daemon.log:Jan 18 15:17:11 r-x-ceva6380 pcscd[11283]: 0004 
readerfactory.c:372:RFAddReader() Broadcom Corp 5880 [Broadcom USH] 
(0123456789ABCD) init failed.
daemon.log:Jan 19 13:52:56 r-x-ceva6380 pcscd[1604]:  
ifdhandler.c:144:CreateChannelByNameOrChannel() failed
daemon.log:Jan 19 13:52:56 r-x-ceva6380 pcscd[1604]: 0027 
readerfactory.c:1097:RFInitializeReader() Open Port 0x20 Failed 
(usb:0a5c/5800:libudev:0:/dev/bus/usb/002/004)
daemon.log:Jan 19 13:52:56 r-x-ceva6380 pcscd[1604]: 0005 
readerfactory.c:372:RFAddReader() Broadcom Corp 5880 [Broadcom USH] 
(0123456789ABCD) init failed.
daemon.log:Jan 20 09:42:05 r-x-ceva6380 pcscd[1687]:  
ifdhandler.c:144:CreateChannelByNameOrChannel() failed
daemon.log:Jan 20 09:42:05 r-x-ceva6380 pcscd[1687]: 0026 
readerfactory.c:1097:RFInitializeReader() Open Port 0x20 Failed 
(usb:0a5c/5800:libudev:0:/dev/bus/usb/002/004)
daemon.log:Jan 20 09:42:05 r-x-ceva6380 pcscd[1687]: 0004 
readerfactory.c:372:RFAddReader() Broadcom Corp 5880 [Broadcom USH] 
(0123456789ABCD) init failed.
daemon.log:Jan 20 12:56:47 r-x-ceva6380 systemd[1]: pcscd.service: Main process 
exited, code=killed, status=9/KILL
daemon.log:Jan 20 12:56:47 r-x-ceva6380 systemd[1]: pcscd.service: Unit entered 
failed state.
daemon.log:Jan 20 12:56:47 r-x-ceva6380 systemd[1]: pcscd.service: Failed with 
result 'signal'.   < killed it by kill -9 to get CPU back
daemon.log:Jan 20 12:56:47 r-x-ceva6380 pcscd[14663]:  
ifdhandler.c:144:CreateChannelByNameOrChannel() failed
daemon.log:Jan 20 12:56:47 r-x-ceva6380 pcscd[14663]: 0022 
readerfactory.c:1097:RFInitializeReader() Open Port 0x20 Failed 
(usb:0a5c/5800:libudev:0:/dev/bus/usb/002/004)
daemon.log:Jan 20 12:56:47 r-x-ceva6380 pcscd[14663]: 0003 
readerfactory.c:372:RFAddReader() Broadcom Corp 5880 [Broadcom USH] 
(0123456789ABCD) init failed.


It does not look like the problem is the Broadcom reader.

Can you generate a log as documented in 
https://pcsclite.alioth.debian.org/pcsclite.html#support ?
Start the log and then connect your problematic mass-storage USB key.

Thanks

--
 Dr. Ludovic Rousseau



Bug#812087: pcscd takes 100 % cpu each time I insert a mass storage USB key

2016-01-20 Thread eric2.valette

On 01/20/2016 03:07 PM, Ludovic Rousseau wrote:

Le 20/01/2016 14:02, eric2.vale...@orange.com a écrit :

It does not look like the problem is the Broadcom reader.

Can you generate a log as documented in 
https://pcsclite.alioth.debian.org/pcsclite.html#support ?
Start the log and then connect your problematic mass-storage USB key. 


Will do when I have time. I suspect the USB key does not matter as 
anyway they are not cryptokey just regular usb storage key...


-- eric

_

Ce message et ses pieces jointes peuvent contenir des informations 
confidentielles ou privilegiees et ne doivent donc
pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce 
message par erreur, veuillez le signaler
a l'expediteur et le detruire ainsi que les pieces jointes. Les messages 
electroniques etant susceptibles d'alteration,
Orange decline toute responsabilite si ce message a ete altere, deforme ou 
falsifie. Merci.

This message and its attachments may contain confidential or privileged 
information that may be protected by law;
they should not be distributed, used or copied without authorisation.
If you have received this email in error, please notify the sender and delete 
this message and its attachments.
As emails may be altered, Orange is not liable for messages that have been 
modified, changed or falsified.
Thank you.