RE: High CPU Usage... in combination with usb smart card reader

Hi All,

So I’m seeing gpg-agent.exe consume 25% of my CPU (1 core). It can be killed, and it restarts. But after a while (10 minutes to 1 hour) it consumes 25% of the CPU again.

Any suggestions on how to fix it or troubleshoot further?

Many Thanks

Nick,

Hi Nick,

Can you tell us more about your system specs (wich version of Windows, 32/64Bit, what CPU?, etc.?) and the version of gpg4win you are currently using?

Kind regards
Jochen

Hi Jochen,

GPG4win version 2.3.0 running on a Windows 7 pro machine 64bit with SP1.

The machine is a HP EliteBook 8470p - Intel I7-3520M CPU and the system has 7GB of memory.

Cheers

Nick,

Hi Nick,

Is the CPU usage after the 10-60min always on ~25% or does it drop back to “normal” after some time?

Kind regards,
Jochen

It has been left for 10 minutes once it has been noticed (usually by the higher fan noise!)

It is actually occurring now so I can leave it running for a good couple of hours to see if it does respite or not.

Many Thanks

Nick,

So it has averaged for 25% over the last couple of hours…

I’v also noticed it is constantly sending and receiving data via the network?

Main issue here is cpu usage…

gpg.jpg

Hey Nick,

unfortunately I couldn’t reproduce the probelem. Could you please enable the logging of the gpg-agent (https://www.gpg4win.org/doc/en/gpg4win-compendium_29.html - 23.4). Restart the agent, wait until the CPU consumption rises again and paste a link to your logfile here, so we can analyze it?

Kind regards,
Jochen

Hi Jochen,

So it didnt take long for the log file to fill…

It seems to be the same error over and over again which I copy below:

2016-03-17 11:33:20 gpg-agent[24496] handler 0x67d8 for fd 264 started
gpg-agent[24496]: chan_0x00000108 → OK Pleased to meet you
gpg-agent[24496]: chan_0x00000108 ← OPTION ttyname=/dev/tty
gpg-agent[24496]: chan_0x00000108 → OK
gpg-agent[24496]: chan_0x00000108 ← OPTION allow-pinentry-notify
gpg-agent[24496]: chan_0x00000108 → OK
gpg-agent[24496]: chan_0x00000108 ← SCD SERIALNO
2016-03-17 11:33:20 gpg-agent[24496] new connection to SCdaemon established (reusing)
gpg-agent[24496]: chan_0x00000114 → SERIALNO
gpg-agent[24496]: chan_0x00000114 ← ERR 100663404 Card error
gpg-agent[24496]: chan_0x00000108 → ERR 100663404 Card error
gpg-agent[24496]: chan_0x00000108 ← BYE
gpg-agent[24496]: chan_0x00000108 → OK closing connection
gpg-agent[24496]: chan_0x00000114 → RESTART
gpg-agent[24496]: chan_0x00000114 ← OK
2016-03-17 11:33:20 gpg-agent[24496] handler 0x67d8 for fd 264 terminated

Many Thanks

Nick,

Apologies please find the whole log file attached.

gpg-agent.log (283 KB)

Nicholas,
this seems to be a loop with scdeamon.
Are you using any smardcards? Do you have a smartcard reader device
in your setup?

When did the problem occurr the first time? At what occasion, did you change something?

Best,
Bernhard

Hi Bernhard,

No smartcards used and no smart card reader in the machine.

Software was installed the other day and then within hours noticed it consuming high amounts of CPU.

Many Thanks

Nick,

Let me back peddle a little

The end user has now found what appears to be a smar card slot, apon plugging in a card it installed drivers for an Alcor Micro USB smart card reader…

Nick,

Let us assume for a moment that the combintation of scdaemon
and the Alcor Micro USB smart card reader triggers the problem.

How can we falsify or support this hypothesis?
Please try to disable use of scdaemon and restart the machine.

For this you would need to add the option “disable-scdaemon”
to the gpg-agent.conf in the gnupg home directory. Check in the log
if no scdaemon is started anymore.

Best,
Bernhard

Hi Bernhard,

Those changes have been carried out and made no effect at fixing the issue.

Please advise on how to progress.

Many Thanks

Nick,

Hi Nick,
does your log look the same, still with the scdaemon lines in there?
Bernhard

Hello,

I have had confirmation from the end user that this is still happening and the log is still showing the gpg-agent trying to talk to the scdaemon.

The user has the option in the config file to disable it but doesn’t appear to be taking effect.

In case it helps the log keeps repeating the following:

2016-03-30 11:03:41 gpg-agent[17280] handler 0x33b0 for fd 252 started
gpg-agent[17280]: chan_0x000000fc → OK Pleased to meet you
gpg-agent[17280]: chan_0x000000fc ← OPTION ttyname=/dev/tty
gpg-agent[17280]: chan_0x000000fc → OK
gpg-agent[17280]: chan_0x000000fc ← OPTION allow-pinentry-notify
gpg-agent[17280]: chan_0x000000fc → OK
gpg-agent[17280]: chan_0x000000fc ← SCD SERIALNO
gpg-agent[17280]: chan_0x000000fc → ERR 67108924 Not supported
gpg-agent[17280]: chan_0x000000fc ← BYE
gpg-agent[17280]: chan_0x000000fc → OK closing connection
2016-03-30 11:03:41 gpg-agent[17280] handler 0x33b0 for fd 252 terminated

Many Thanks

Nick,

Any idea?

Try to make sure that the options in the file are active.
(e.g. by adding a bad one or running the command line and see if the behaviour changes.)

Hi, Do you have an example I can pass onto the end user please?