Bug#812087: [pcscd] takes 100 % cpu

2016-04-03 Thread Ludovic Rousseau
On Sat, 2 Apr 2016 10:52:25 +0200 Ludovic Rousseau 
 wrote:

> I will open a bug at libudev.

Bug report created upstream
https://github.com/systemd/systemd/issues/2946

I don't know if I will try to fix the bug myself. I have no experience 
with libudev.


Bye

--
Dr. Ludovic Rousseau



Bug#812087: [pcscd] takes 100 % cpu

2016-04-02 Thread Ludovic Rousseau

On Mon, 28 Mar 2016 17:22:31 +0200 Philippe Teuwen  wrote:
> Some more tests:
>
> log_pcscd_yubikey_then_scl3711_then_100cpu.txt:
> the initial 100% CPU case.
> I've a Yubikey Neo-n plugged-in before launching pcscd.
> When I plug a SCL3711 (or anything else or when unplugging sth on usb),
> then one thread goes to 100% CPU, while pcscd is still operating as 
normal.

>
> log_hotplugtest_yubikey_then_scl3711:
> Same scenario but monitoring libusb/examples/hotplugtest:
> no CPU problem here.

I also tried running libusb/examples/hotplugtest (from current git 
repository) but I always get the CPU at 100%.

Using hotplugtest does not change anything in my case.

> So everything seems to be linked to usage of that yubikey.

I tried with another composite device Feitian R502 [1] (3 CCID 
interfaces on the same device) and I do not have the problem.

I don't know what the problem is with the Yubikey and Broadcom devices.

I will open a bug at libudev.

Bye

[1] http://pcsclite.alioth.debian.org/ccid/shouldwork.html#0x096E0x060D

--
Dr. Ludovic Rousseau



Bug#812087: [pcscd] takes 100 % cpu

2016-04-01 Thread Ludovic Rousseau

Le 28/03/2016 18:11, Ludovic Rousseau a écrit :

On Mon, 28 Mar 2016 17:22:31 +0200 Philippe Teuwen  wrote:

So everything seems to be linked to usage of that yubikey.


I asked my contact at Yubico to get a "Yubico Yubikey NEO U2F+CCID" device so I 
can work on the problem myself.
If I can't get a device I will continue to bother you Philippe :-(


I now have a Yubikey NEO and can reproduce the problem myself.

I also note that pcscd crashes when I remove the Yubikey token.

I hope to be able to identify the problem soon.

Bye

--
Dr. Ludovic Rousseau



Bug#812087: [pcscd] takes 100 % cpu

2016-03-31 Thread Eric Valette

On 03/30/2016 06:45 PM, Ludovic Rousseau wrote:


I can't explain. I just note what is common in the different cases.
I have no idea what is wrong.


Side note as I booted the computer with the key attached this morning, 
pcscd does not eat CPU in this case.


It is really related to USB hotplug...

-- eric



Bug#812087: [pcscd] takes 100 % cpu

2016-03-30 Thread Ludovic Rousseau

Le 30/03/2016 18:39, Eric Valette a écrit :

On 30/03/2016 17:51, Ludovic Rousseau wrote:

Le 29/03/2016 10:38, Eric Valette a écrit :



You are also using the Broadcom Corp 5880 reader.

For now people with the issue are using:
- Broadcom Corp 5880 0a5c/5800 (Eric) & (Johnny Ubuntu bug 1551897)
- Broadcom BCM5880 0a5c/5804 (Gustavo)
- Yubico Yubikey NEO U2F+CCID 1050/0115 (Philippe) & (Casey Ubuntu bug
1551897)

The Broadcom Corp 5880 0a5c/5800 and the Yubico Yubikey NEO U2F+CCID
1050/0115 both have only 1 CCID interface.
So the problem may not be related to a composite device.

What is the problem with the Broadcom and Yubico devices?
I should receive a Yubikey NEO device soon so I should be able to
reproduce the problem and work on it.


I'm affraid I'm lost. There is a BCM 5880 on my PC yes, that I never use. As my 
normal key is on a USB stick.

And the problem occurs when I'm plugin a regular USB mass storage key that is 
not by any mean a crypto keys. So I do not catch why the BCM 5880 could be the 
problem.

Could you explain a bit more.


I can't explain. I just note what is common in the different cases.
I have no idea what is wrong.

Bye

--
Dr. Ludovic Rousseau



Bug#812087: [pcscd] takes 100 % cpu

2016-03-30 Thread Eric Valette

On 30/03/2016 17:51, Ludovic Rousseau wrote:

Le 29/03/2016 10:38, Eric Valette a écrit :

On 03/26/2016 02:01 PM, Ludovic Rousseau wrote:


In pcsc-lite 1.8.16 (that should arrive in Debian testing on Monday 28th
March 2016) I fixed a bug related to SCardCancel() and
SCardGetStatusChange().
Maybe that would fix the problem you have.


No it does not fix it


Please upgrade to pcsc-lite 1.8.16 and tell me if you still have the
problem or not?


Do you know what application is using pcscd?
To list all the applications using libpcsclite you can use:
$ sudo lsof /usr/lib/x86_64-linux-gnu/libpcsclite.so.1


lsof /usr/lib/x86_64-linux-gnu/libpcsclite.so.1
COMMAND PID USER  FD   TYPE DEVICE SIZE/OFFNODE NAME
SACSrv 1359 root memREG8,342848 1046702
/usr/lib/x86_64-linux-gnu/libpcsclite.so.1.0.0
firefox-e 20538 ceva6380 memREG8,342848 1046702
/usr/lib/x86_64-linux-gnu/libpcsclite.so.1.0.0



In addition here is the new log


Thanks

You are also using the Broadcom Corp 5880 reader.

For now people with the issue are using:
- Broadcom Corp 5880 0a5c/5800 (Eric) & (Johnny Ubuntu bug 1551897)
- Broadcom BCM5880 0a5c/5804 (Gustavo)
- Yubico Yubikey NEO U2F+CCID 1050/0115 (Philippe) & (Casey Ubuntu bug
1551897)

The Broadcom Corp 5880 0a5c/5800 and the Yubico Yubikey NEO U2F+CCID
1050/0115 both have only 1 CCID interface.
So the problem may not be related to a composite device.

What is the problem with the Broadcom and Yubico devices?
I should receive a Yubikey NEO device soon so I should be able to
reproduce the problem and work on it.


I'm affraid I'm lost. There is a BCM 5880 on my PC yes, that I never 
use. As my normal key is on a USB stick.


And the problem occurs when I'm plugin a regular USB mass storage key 
that is not by any mean a crypto keys. So I do not catch why the BCM 
5880 could be the problem.


Could you explain a bit more.

-- eric



Bug#812087: [pcscd] takes 100 % cpu

2016-03-30 Thread Ludovic Rousseau

Le 29/03/2016 10:38, Eric Valette a écrit :

On 03/26/2016 02:01 PM, Ludovic Rousseau wrote:


In pcsc-lite 1.8.16 (that should arrive in Debian testing on Monday 28th
March 2016) I fixed a bug related to SCardCancel() and
SCardGetStatusChange().
Maybe that would fix the problem you have.


No it does not fix it


Please upgrade to pcsc-lite 1.8.16 and tell me if you still have the
problem or not?


Do you know what application is using pcscd?
To list all the applications using libpcsclite you can use:
$ sudo lsof /usr/lib/x86_64-linux-gnu/libpcsclite.so.1


lsof /usr/lib/x86_64-linux-gnu/libpcsclite.so.1
COMMAND PID USER  FD   TYPE DEVICE SIZE/OFFNODE NAME
SACSrv 1359 root memREG8,342848 1046702 
/usr/lib/x86_64-linux-gnu/libpcsclite.so.1.0.0
firefox-e 20538 ceva6380 memREG8,342848 1046702 
/usr/lib/x86_64-linux-gnu/libpcsclite.so.1.0.0



In addition here is the new log


Thanks

You are also using the Broadcom Corp 5880 reader.

For now people with the issue are using:
- Broadcom Corp 5880 0a5c/5800 (Eric) & (Johnny Ubuntu bug 1551897)
- Broadcom BCM5880 0a5c/5804 (Gustavo)
- Yubico Yubikey NEO U2F+CCID 1050/0115 (Philippe) & (Casey Ubuntu bug 1551897)

The Broadcom Corp 5880 0a5c/5800 and the Yubico Yubikey NEO U2F+CCID 1050/0115 
both have only 1 CCID interface.
So the problem may not be related to a composite device.

What is the problem with the Broadcom and Yubico devices?
I should receive a Yubikey NEO device soon so I should be able to reproduce the 
problem and work on it.

Bye

--
Dr. Ludovic Rousseau



Bug#812087: [pcscd] takes 100 % cpu

2016-03-30 Thread Ludovic Rousseau

Le 29/03/2016 04:30, gustavo panizzo a écrit :


I've attached the requested info


regarding the question you asked to Eric, wpa is not using the
smartcard.


COMMANDPID USER  FD   TYPE DEVICE SIZE/OFF   NODE NAME
wpa_suppl 1078 root memREG  252,443384 653905
/usr/lib/x86_64-linux-gnu/libpcsclite.so.1.0.0
scdaemon  2718 gust9547 memREG  252,443384 653905
/usr/lib/x86_64-linux-gnu/libpcsclite.so.1.0.0


You are using a Broadcom device with 2 CCID interfaces (contact and 
contactless).
scdaemon is part of OpenPGP and you are using a "GnuPG card V2" card.

Maybe the problem is with composite devices. I will try to explore this idea.

Thanks

--
Dr. Ludovic Rousseau



Bug#812087: [pcscd] takes 100 % cpu

2016-03-28 Thread Philippe Teuwen
BTW after udev_monitor_receive_device() returns null,
strerror(errno) gives "Resource temporarily unavailable"

So on one side poll() says there is data ready to be read on
udev_monitor_fd and on the other side udev_monitor_receive_device() says
"Resource temporarily unavailable"



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

2016-03-28 Thread Philippe Teuwen
> Interesting.
> Do you give arguments to libusb/examples/hotplugtest or just execute the
> command with no argument?

no argument

> The scl3711 is not supported by my CCID driver (at least I can't find
> the device VID: 0x04E6, PID: 0x5591 in my list)
> I guess you use the SCM driver with this device.

it's currently disabled (so I can use it with libnfc).
Therefore the message in my logs:
Could not open bundle file
/usr/lib/pcsc/drivers/SCLGENERIC.bundle/Contents/Info.plist
because I renamed it as Info.plist.disabled

But that doesn't matter really here, any USB device triggers the bug,
being a reader recognized by pcscd or sth else.

> I asked my contact at Yubico to get a "Yubico Yubikey NEO U2F+CCID"
> device so I can work on the problem myself.
> If I can't get a device I will continue to bother you Philippe :-(

No prob, it bothers me that we can't understand this bug ;)

Phil



Bug#812087: [pcscd] takes 100 % cpu

2016-03-28 Thread Ludovic Rousseau

On Mon, 28 Mar 2016 17:22:31 +0200 Philippe Teuwen  wrote:

Some more tests:

To recap previous debug info, I'm using currently:

--- libusb-1.0-1.0.20.orig/libusb/os/linux_udev.c
+++ libusb-1.0-1.0.20/libusb/os/linux_udev.c
@@ -173,6 +173,7 @@ static void *linux_udev_event_thread_mai
usbi_dbg("udev event thread entering.");

while (poll(fds, 2, -1) >= 0) {
+   usbi_warn(NULL, "poll fds[0].revents=0x%X fds[1].revents=0x%X ",
fds[0].revents, fds[1].revents);
if (fds[0].revents & POLLIN) {
/* activity on control pipe, read the byte and exit */
r = usbi_read(udev_control_pipe[0], , 
sizeof(dummy));
@@ -184,8 +185,11 @@ static void *linux_udev_event_thread_mai
if (fds[1].revents & POLLIN) {
usbi_mutex_static_lock(_hotplug_lock);
udev_dev = udev_monitor_receive_device(udev_monitor);
+   usbi_warn(NULL, "udev_dev=0x%X", udev_dev);
if (udev_dev)
udev_hotplug_event(udev_dev);
+   else
+   usbi_err(NULL, "udev_monitor_receive_device 
failed");
usbi_mutex_static_unlock(_hotplug_lock);
}
}




log_pcscd_yubikey_then_scl3711_then_100cpu.txt:
the initial 100% CPU case.
I've a Yubikey Neo-n plugged-in before launching pcscd.
When I plug a SCL3711 (or anything else or when unplugging sth on usb),
then one thread goes to 100% CPU, while pcscd is still operating as normal.

log_hotplugtest_yubikey_then_scl3711:
Same scenario but monitoring libusb/examples/hotplugtest:
no CPU problem here.


Interesting.
Do you give arguments to libusb/examples/hotplugtest or just execute the 
command with no argument?


log_pcscd_nothing_then_scl3711:
If the yubikey is not present, no problem, libusb seems not being used
at all.


The scl3711 is not supported by my CCID driver (at least I can't find the 
device VID: 0x04E6, PID: 0x5591 in my list)
I guess you use the SCM driver with this device.


log_pcscd_ACR38_then_scl3711:
To be closer to yubikey scenario, trying to replace yubikey by another
USB reader: an ACR38.
No CPU problem.

log_pcscd_ACR38withcard_then_scl3711:
To be closer to yubikey scenario, trying to replace yubikey by another
USB reader with a card inserted.
No CPU problem.

log_pcscd_nothing_then_yubikey_then_nothing_then_segfault:
If I (insert, then) remove the yubikey, pcscd segfaults and, before
that, we see the busy loop problem too in the logs.

So everything seems to be linked to usage of that yubikey.


I asked my contact at Yubico to get a "Yubico Yubikey NEO U2F+CCID" device so I 
can work on the problem myself.
If I can't get a device I will continue to bother you Philippe :-(

Thanks for your tests and logs.

Bye

--
Dr. Ludovic Rousseau



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

2016-03-27 Thread Philippe Teuwen
On 03/27/2016 09:06 PM, Ludovic Rousseau wrote:
> +else
> +usbi_err(NULL, "udev_monitor_receive_device failed");

See att.
I've cut it as it's printing in the crazy loop as expected.
So it confirms what we already know:
fds[0].revents = 0
fds[1].revents = 1
udev_monitor_receive_device() = null

Cheers
Phil
 pcscdaemon.c:261:main() pcscd set to foreground with debug send to 
stdout
0027 debuglog.c:310:DebugLogSetCategory() Debug options: APDU
0005 pcscdaemon.c:266:main() Force colored logs
0050 configfile.l:281:DBGetReaderListDir() Parsing conf directory: 
/etc/reader.conf.d
0020 configfile.l:353:DBGetReaderList() Parsing conf file: 
/etc/reader.conf.d/libccidtwin
0056 configfile.l:315:DBGetReaderListDir() Skipping non regular 
file: .
0005 configfile.l:315:DBGetReaderListDir() Skipping non regular 
file: ..
0010 pcscdaemon.c:567:main() pcsc-lite 1.8.16 daemon 
ready.
0140 tokenparser.l:213:bundleParse() Could not open bundle 
file /usr/lib/pcsc/drivers/SCLGENERIC.bundle/Contents/Info.plist: No such file 
or directory
4511 hotplug_libudev.c:294:get_driver() Looking for a driver for 
VID: 0x1D6B, PID: 0x0002, path: /dev/bus/usb/001/001
0062 hotplug_libudev.c:294:get_driver() Looking for a driver for 
VID: 0x1D6B, PID: 0x0002, path: /dev/bus/usb/001/001
0086 hotplug_libudev.c:294:get_driver() Looking for a driver for 
VID: 0x0C45, PID: 0x6713, path: /dev/bus/usb/001/005
0069 hotplug_libudev.c:294:get_driver() Looking for a driver for 
VID: 0x0C45, PID: 0x6713, path: /dev/bus/usb/001/005
0067 hotplug_libudev.c:294:get_driver() Looking for a driver for 
VID: 0x1D6B, PID: 0x0002, path: /dev/bus/usb/001/001
0075 hotplug_libudev.c:294:get_driver() Looking for a driver for 
VID: 0x1050, PID: 0x0115, path: /dev/bus/usb/001/010
0004 hotplug_libudev.c:433:HPAddDevice() Adding USB device: 
Yubico Yubikey NEO U2F+CCID
0023 readerfactory.c:1066:RFInitializeReader() Attempting 
startup of Yubico Yubikey NEO U2F+CCID 00 00 using 
/usr/lib/pcsc/drivers/ifd-ccid.bundle/Contents/Linux/libccid.so
0100 readerfactory.c:951:RFBindFunctions() Loading IFD 
Handler 3.0
0014 ifdhandler.c:1950:init_driver() Driver version: 
1.4.22
0379 ifdhandler.c:1967:init_driver() LogLevel: 0x0003
0004 ifdhandler.c:1978:init_driver() DriverOptions: 0x
0091 ifdhandler.c:110:CreateChannelByNameOrChannel() Lun: 0, 
device: usb:1050/0115:libudev:0:/dev/bus/usb/001/010
0011 ccid_usb.c:284:OpenUSBByName() Using: 
/usr/lib/pcsc/drivers/ifd-ccid.bundle/Contents/Info.plist
0366 ccid_usb.c:302:OpenUSBByName() ifdManufacturerString: 
Ludovic Rousseau (ludovic.rouss...@free.fr)
0004 ccid_usb.c:303:OpenUSBByName() ifdProductString: Generic 
CCID driver
0002 ccid_usb.c:304:OpenUSBByName() Copyright: This driver is 
protected by terms of the GNU Lesser General Public License version 2.1, or (at 
your option) any later version.
libusb: debug [libusb_init] created default context
libusb: debug [libusb_init] libusb v1.0.20.11004
libusb: debug [find_usbfs_path] found usbfs at /dev/bus/usb
libusb: debug [op_init] bulk continuation flag supported
libusb: debug [op_init] zero length packet flag supported
libusb: debug [op_init] sysfs can relate devices
libusb: debug [op_init] sysfs has complete descriptors
libusb: debug [linux_udev_event_thread_main] udev event thread entering.
libusb: debug [linux_get_device_address] getting address for device: usb1 
detached: 0
libusb: debug [linux_get_device_address] scan usb1
libusb: debug [linux_get_device_address] bus=1 dev=1
libusb: debug [linux_enumerate_device] busnum 1 devaddr 1 session_id 257
libusb: debug [linux_enumerate_device] allocating new device for 1/1 (session 
257)
libusb: debug [linux_get_device_address] getting address for device: 1-12 
detached: 0
libusb: debug [linux_get_device_address] scan 1-12
libusb: debug [linux_get_device_address] bus=1 dev=5
libusb: debug [linux_enumerate_device] busnum 1 devaddr 5 session_id 261
libusb: debug [linux_enumerate_device] allocating new device for 1/5 (session 
261)
libusb: debug [linux_get_parent_info] Dev 0x559aba5bff90 (1-12) has parent 
0x559aba5b8b10 (usb1) port 12
libusb: debug [linux_get_device_address] getting address for device: 1-2 
detached: 0
libusb: debug [linux_get_device_address] scan 1-2
libusb: debug [linux_get_device_address] bus=1 dev=10
libusb: debug [linux_enumerate_device] busnum 1 devaddr 10 session_id 266
libusb: debug [linux_enumerate_device] allocating new device for 1/10 (session 
266)
libusb: debug [linux_get_parent_info] Dev 0x559aba57f5f0 (1-2) has parent 

Bug#812087: [pcscd] takes 100 % cpu

2016-03-27 Thread Philippe Teuwen
> Does the problem occurs when you connect the USB device VID: 0x2A70,
> PID: 0x9011?
> This is your phone?

Yes

> The first "USB Device add" is correct. You connect the USB device.
> But why a second "USB Device add" for the same device?
> And a third "USB Device add" 1 second after for again the same device?
> Is libudev confused?
> After 5 seconds you get a first "USB Device removed". OK.
> Then a second one 143 ms later.
> And a third one 133 ms later.

> Is you USB device a composite device with more than 1 interface?

Yes this one shows 3 interfaces.

> Do you have the same problem if you connect a simple CCID device instead?

I used to test with the USB hub, which shows 2 interfaces.

I tested with a SCL3711 and with a ACR38
In both cases the bug occurs

I'll try your last debug suggestion.
Cheers
Phil



Bug#812087: [pcscd] takes 100 % cpu

2016-03-27 Thread Ludovic Rousseau

Le 27/03/2016 16:10, Philippe Teuwen a écrit :

Hi Ludovic,


Hello,


Version 1.8.16-1
Same problem.
See log.txt


Thanks Phil.

Unfortunately I don't see any strange libusb log in your trace :-(

Can you modify libusb again with:
--- /tmp/XWDR6X_linux_udev.c2016-03-27 20:48:26.715640742 +0200
+++ libusb/os/linux_udev.c  2016-03-27 20:47:07.223641500 +0200
@@ -186,6 +186,8 @@ static void *linux_udev_event_thread_mai
udev_dev = udev_monitor_receive_device(udev_monitor);
if (udev_dev)
udev_hotplug_event(udev_dev);
+   else
+   usbi_err(NULL, "udev_monitor_receive_device 
failed");
usbi_mutex_static_unlock(_hotplug_lock);
}
}

So I can see when libusb goes wrong?

Does the problem occurs when you connect the USB device VID: 0x2A70, PID: 
0x9011?
This is your phone?

What is strange from your log are the lines:
03894669 hotplug_libudev.c:648:HPEstablishUSBNotifications() USB Device add
0231 hotplug_libudev.c:294:get_driver() Looking for a driver for VID: 
0x2A70, PID: 0x9011, path: /dev/bus/usb/001/019
0369 hotplug_libudev.c:648:HPEstablishUSBNotifications() USB Device add
0187 hotplug_libudev.c:294:get_driver() Looking for a driver for VID: 
0x2A70, PID: 0x9011, path: /dev/bus/usb/001/019
01010014 hotplug_libudev.c:648:HPEstablishUSBNotifications() USB Device add
0097 hotplug_libudev.c:294:get_driver() Looking for a driver for VID: 
0x2A70, PID: 0x9011, path: /dev/bus/usb/001/019
05139524 hotplug_libudev.c:642:HPEstablishUSBNotifications() USB Device removed
00143995 hotplug_libudev.c:642:HPEstablishUSBNotifications() USB Device removed
00133774 hotplug_libudev.c:642:HPEstablishUSBNotifications() USB Device removed

The first "USB Device add" is correct. You connect the USB device.
But why a second "USB Device add" for the same device?
And a third "USB Device add" 1 second after for again the same device?
Is libudev confused?

After 5 seconds you get a first "USB Device removed". OK.
Then a second one 143 ms later.
And a third one 133 ms later.

Is you USB device a composite device with more than 1 interface?

Do you have the same problem if you connect a simple CCID device instead?

Thanks

--
Dr. Ludovic Rousseau



Bug#812087: [pcscd] takes 100 % cpu

2016-03-27 Thread Philippe Teuwen

Hi Ludovic,

Version 1.8.16-1
Same problem.
See log.txt

Cheers
Phil
 pcscdaemon.c:261:main() pcscd set to foreground with debug send to 
stdout
0023 debuglog.c:310:DebugLogSetCategory() Debug options: APDU
0003 pcscdaemon.c:266:main() Force colored logs
0038 utils.c:82:GetDaemonPid() Can't open 
/var/run/pcscd/pcscd.pid: No such file or directory
0039 configfile.l:281:DBGetReaderListDir() Parsing conf directory: 
/etc/reader.conf.d
0024 configfile.l:353:DBGetReaderList() Parsing conf file: 
/etc/reader.conf.d/libccidtwin
0032 configfile.l:315:DBGetReaderListDir() Skipping non regular 
file: .
0012 configfile.l:315:DBGetReaderListDir() Skipping non regular 
file: ..
0007 pcscdaemon.c:567:main() pcsc-lite 1.8.16 daemon 
ready.
0134 tokenparser.l:213:bundleParse() Could not open bundle 
file /usr/lib/pcsc/drivers/SCLGENERIC.bundle/Contents/Info.plist: No such file 
or directory
3756 hotplug_libudev.c:294:get_driver() Looking for a driver for 
VID: 0x1D6B, PID: 0x0002, path: /dev/bus/usb/001/001
0127 hotplug_libudev.c:294:get_driver() Looking for a driver for 
VID: 0x1D6B, PID: 0x0002, path: /dev/bus/usb/001/001
0118 hotplug_libudev.c:294:get_driver() Looking for a driver for 
VID: 0x0C45, PID: 0x6713, path: /dev/bus/usb/001/005
0080 hotplug_libudev.c:294:get_driver() Looking for a driver for 
VID: 0x0C45, PID: 0x6713, path: /dev/bus/usb/001/005
0097 hotplug_libudev.c:294:get_driver() Looking for a driver for 
VID: 0x1D6B, PID: 0x0002, path: /dev/bus/usb/001/001
0088 hotplug_libudev.c:294:get_driver() Looking for a driver for 
VID: 0x1050, PID: 0x0115, path: /dev/bus/usb/001/010
0007 hotplug_libudev.c:433:HPAddDevice() Adding USB device: 
Yubico Yubikey NEO U2F+CCID
0032 readerfactory.c:1066:RFInitializeReader() Attempting 
startup of Yubico Yubikey NEO U2F+CCID 00 00 using 
/usr/lib/pcsc/drivers/ifd-ccid.bundle/Contents/Linux/libccid.so
0172 readerfactory.c:951:RFBindFunctions() Loading IFD 
Handler 3.0
0022 ifdhandler.c:1950:init_driver() Driver version: 
1.4.22
0420 ifdhandler.c:1967:init_driver() LogLevel: 0x0003
0004 ifdhandler.c:1978:init_driver() DriverOptions: 0x
0086 ifdhandler.c:110:CreateChannelByNameOrChannel() Lun: 0, 
device: usb:1050/0115:libudev:0:/dev/bus/usb/001/010
0014 ccid_usb.c:284:OpenUSBByName() Using: 
/usr/lib/pcsc/drivers/ifd-ccid.bundle/Contents/Info.plist
0363 ccid_usb.c:302:OpenUSBByName() ifdManufacturerString: 
Ludovic Rousseau (ludovic.rouss...@free.fr)
0003 ccid_usb.c:303:OpenUSBByName() ifdProductString: Generic 
CCID driver
0002 ccid_usb.c:304:OpenUSBByName() Copyright: This driver is 
protected by terms of the GNU Lesser General Public License version 2.1, or (at 
your option) any later version.
libusb: debug [libusb_init] created default context
libusb: debug [libusb_init] libusb v1.0.20.11004
libusb: debug [find_usbfs_path] found usbfs at /dev/bus/usb
libusb: debug [op_init] bulk continuation flag supported
libusb: debug [op_init] zero length packet flag supported
libusb: debug [op_init] sysfs can relate devices
libusb: debug [op_init] sysfs has complete descriptors
libusb: debug [linux_udev_event_thread_main] udev event thread entering.
libusb: debug [linux_get_device_address] getting address for device: usb1 
detached: 0
libusb: debug [linux_get_device_address] scan usb1
libusb: debug [linux_get_device_address] bus=1 dev=1
libusb: debug [linux_enumerate_device] busnum 1 devaddr 1 session_id 257
libusb: debug [linux_enumerate_device] allocating new device for 1/1 (session 
257)
libusb: debug [linux_get_device_address] getting address for device: 1-12 
detached: 0
libusb: debug [linux_get_device_address] scan 1-12
libusb: debug [linux_get_device_address] bus=1 dev=5
libusb: debug [linux_enumerate_device] busnum 1 devaddr 5 session_id 261
libusb: debug [linux_enumerate_device] allocating new device for 1/5 (session 
261)
libusb: debug [linux_get_parent_info] Dev 0x5610c9fa4f90 (1-12) has parent 
0x5610c9f9db10 (usb1) port 12
libusb: debug [linux_get_device_address] getting address for device: 1-2 
detached: 0
libusb: debug [linux_get_device_address] scan 1-2
libusb: debug [linux_get_device_address] bus=1 dev=10
libusb: debug [linux_enumerate_device] busnum 1 devaddr 10 session_id 266
libusb: debug [linux_enumerate_device] allocating new device for 1/10 (session 
266)
libusb: debug [linux_get_parent_info] Dev 0x5610c9f645f0 (1-2) has parent 
0x5610c9f9db10 (usb1) port 2
libusb: debug [linux_get_device_address] getting address for device: 1-4 
detached: 0
libusb: debug [linux_get_device_address] 

Bug#812087: [pcscd] takes 100 % cpu

2016-03-27 Thread Eric Valette

On 26/03/2016 14:01, Ludovic Rousseau wrote:



Le 25/03/2016 12:52, Eric Valette a écrit :

On 03/24/2016 06:56 PM, Ludovic Rousseau wrote:

LIBUSB_DEBUG=99 pcscd -dfaT | tee log.txt


Here it is.

NB: the process was actually at 106% after inerting the key before I
stooped.


Eric,
 From the pcscd trace you sent I see that an application (or maybe 2
because I see 2 clients) is continuously calling SCardGetStatusChange()
with a 200 ms timeout.


Ye I noticed it too while taling the traces. However it started before 
the key was inserted and did not lead to noticeable CPU consumption.


In pcsc-lite 1.8.16 (that should arrive in Debian testing on Monday 28th
March 2016) I fixed a bug related to SCardCancel() and
SCardGetStatusChange().
Maybe that would fix the problem you have.


Given what I said earlier, I'm not sure but I will test and report.



Do you know what application is using pcscd?
To list all the applications using libpcsclite you can use:
$ sudo lsof /usr/lib/x86_64-linux-gnu/libpcsclite.so.1

Have you configured wpa_supplicant (Wifi password) to use the smart card?


No. Unless a kde stuff is doing that I normally use smart card only for 
VPN access "manually".


-- eric



Bug#812087: [pcscd] takes 100 % cpu

2016-03-26 Thread Ludovic Rousseau



Le 25/03/2016 12:52, Eric Valette a écrit :

On 03/24/2016 06:56 PM, Ludovic Rousseau wrote:

LIBUSB_DEBUG=99 pcscd -dfaT | tee log.txt


Here it is.

NB: the process was actually at 106% after inerting the key before I 
stooped.


Eric,
From the pcscd trace you sent I see that an application (or maybe 2 
because I see 2 clients) is continuously calling SCardGetStatusChange() 
with a 200 ms timeout.


In pcsc-lite 1.8.16 (that should arrive in Debian testing on Monday 28th 
March 2016) I fixed a bug related to SCardCancel() and 
SCardGetStatusChange().

Maybe that would fix the problem you have.

Please upgrade to pcsc-lite 1.8.16 and tell me if you still have the 
problem or not?



Do you know what application is using pcscd?
To list all the applications using libpcsclite you can use:
$ sudo lsof /usr/lib/x86_64-linux-gnu/libpcsclite.so.1

Have you configured wpa_supplicant (Wifi password) to use the smart card?

Thanks

--
Dr. Ludovic Rousseau



Bug#812087: [pcscd] takes 100 % cpu

2016-03-25 Thread Ludovic Rousseau

Le 24/03/2016 18:56, Ludovic Rousseau a écrit :

Le 15/03/2016 19:14, Ludovic Rousseau a écrit :

Maybe enabling libusb debug would help. I will try to document how to do that 
easily.


Philippe, Gustavo, Eric, can you do:
$ sudo LIBUSB_DEBUG=99 pcscd -dfaT | tee log.txt

generate the problem and send me the created log.txt file?


Sorry, the correct command is:

$ sudo LIBUSB_DEBUG=99 pcscd -dfaT 2>&1 | tee log.txt

libusb sends the debug messages to stderr and this was not redirected in 
log.txt :-(

Eric, can you do it again ?

Thanks

--
Dr. Ludovic Rousseau



Bug#812087: [pcscd] takes 100 % cpu

2016-03-24 Thread Ludovic Rousseau

Le 15/03/2016 19:14, Ludovic Rousseau a écrit :
Maybe enabling libusb debug would help. I will try to document how to 
do that easily.


Philippe, Gustavo, Eric, can you do:
$ sudo LIBUSB_DEBUG=99 pcscd -dfaT | tee log.txt

generate the problem and send me the created log.txt file?

Thanks

--
Dr. Ludovic Rousseau



Bug#812087: [pcscd] takes 100 % cpu

2016-03-24 Thread Ludovic Rousseau

Hello,

For an unknown reason this email is not visible on 
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=812087


Sending it again.

Le 15/03/2016 19:14, Ludovic Rousseau a écrit :
On Mon, 7 Mar 2016 21:14:48 +0100 Philippe Teuwen  
wrote:

>
>
> On 03/07/2016 07:34 PM, Ludovic Rousseau wrote:
> > printf("fds: %d %d\n", fds[0].revents, fds[1].revents);
>
> fds: 0 1
> always
>
> I also printed udev_dev from udev_monitor_receive_device()
> it's always null
>
> So we get fds[1].revents but don't get anything from
> udev_monitor_receive_device() so it's looping forever.
>
>
> You may try to trigger the bug from your side:
> It probably requires the same versions as me.
> kernel 4.3.0-1-amd64
> libusb-1.0-0 2:1.0.20-1
> libudev1 229-2
> I've a Yubikey neo-n plugged in.
> I start pcscd.
> I plug a usb hub (or anything else)
> => CPU at 100%

I am using:
$ uname -a
Linux debian 4.3.0-1-amd64 #1 SMP Debian 4.3.5-1 (2016-02-06) x86_64 
GNU/Linux


$ apt-cache policy libusb-1.0-0
libusb-1.0-0:
  Installé : 2:1.0.20-1
  Candidat : 2:1.0.20-1
 Table de version :
 *** 2:1.0.20-1 500
500 http://httpredir.debian.org/debian stretch/main amd64 
Packages

100 /var/lib/dpkg/status

$ apt-cache policy libudev1
libudev1:
  Installé : 229-2
  Candidat : 229-2
 Table de version :
 *** 229-2 500
500 http://httpredir.debian.org/debian stretch/main amd64 
Packages

100 /var/lib/dpkg/status

$ apt-cache policy pcscd
pcscd:
  Installé : 1.8.15-1
  Candidat : 1.8.15-1
 Table de version :
 *** 1.8.15-1 500
500 http://httpredir.debian.org/debian stretch/main amd64 
Packages

100 /var/lib/dpkg/status

$ apt-cache policy libccid
libccid:
  Installé : 1.4.22-1
  Candidat : 1.4.22-1
 Table de version :
 *** 1.4.22-1 500
500 http://httpredir.debian.org/debian stretch/main amd64 
Packages

100 /var/lib/dpkg/status

And I can't reproduce the problem :-(

I tried connecting a USB memory, my Android phone, a USB hub but it 
all worked as expected.


That bug is even more strange now.

Maybe enabling libusb debug would help. I will try to document how to 
do that easily.


Bye



--
Dr. Ludovic Rousseau



Bug#812087: [pcscd] takes 100 % cpu

2016-03-15 Thread Ludovic Rousseau

On Mon, 7 Mar 2016 21:14:48 +0100 Philippe Teuwen  wrote:
>
>
> On 03/07/2016 07:34 PM, Ludovic Rousseau wrote:
> > printf("fds: %d %d\n", fds[0].revents, fds[1].revents);
>
> fds: 0 1
> always
>
> I also printed udev_dev from udev_monitor_receive_device()
> it's always null
>
> So we get fds[1].revents but don't get anything from
> udev_monitor_receive_device() so it's looping forever.
>
>
> You may try to trigger the bug from your side:
> It probably requires the same versions as me.
> kernel 4.3.0-1-amd64
> libusb-1.0-0 2:1.0.20-1
> libudev1 229-2
> I've a Yubikey neo-n plugged in.
> I start pcscd.
> I plug a usb hub (or anything else)
> => CPU at 100%

I am using:
$ uname -a
Linux debian 4.3.0-1-amd64 #1 SMP Debian 4.3.5-1 (2016-02-06) x86_64 
GNU/Linux


$ apt-cache policy libusb-1.0-0
libusb-1.0-0:
  Installé : 2:1.0.20-1
  Candidat : 2:1.0.20-1
 Table de version :
 *** 2:1.0.20-1 500
500 http://httpredir.debian.org/debian stretch/main amd64 Packages
100 /var/lib/dpkg/status

$ apt-cache policy libudev1
libudev1:
  Installé : 229-2
  Candidat : 229-2
 Table de version :
 *** 229-2 500
500 http://httpredir.debian.org/debian stretch/main amd64 Packages
100 /var/lib/dpkg/status

$ apt-cache policy pcscd
pcscd:
  Installé : 1.8.15-1
  Candidat : 1.8.15-1
 Table de version :
 *** 1.8.15-1 500
500 http://httpredir.debian.org/debian stretch/main amd64 Packages
100 /var/lib/dpkg/status

$ apt-cache policy libccid
libccid:
  Installé : 1.4.22-1
  Candidat : 1.4.22-1
 Table de version :
 *** 1.4.22-1 500
500 http://httpredir.debian.org/debian stretch/main amd64 Packages
100 /var/lib/dpkg/status

And I can't reproduce the problem :-(

I tried connecting a USB memory, my Android phone, a USB hub but it all 
worked as expected.


That bug is even more strange now.

Maybe enabling libusb debug would help. I will try to document how to do 
that easily.


Bye

--
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.