[Users] gpg2 locks CPU core to 100%

John Crisp jcrisp at safeandsoundit.co.uk
Mon Nov 25 18:34:05 CET 2019


On Fri, 16 Aug 2019 14:48:45 +0200
John Crisp <jcrisp at safeandsoundit.co.uk> wrote:
> I have discovered this was caused by a private key that had gotten
> itself in a know, so when Claws then tried to read the keys gpg2
> freaked out.
> 
> Removed the damaged key and we all seem good now.
> 

Just to follow up on this, it was actually it was a bit more
complicated, but still down to damaged keys.

The answers lie buried here:

https://dev.gnupg.org/T3972
https://dev.gnupg.org/T4591
https://dev.gnupg.org/T4592

You can run this to see if you have any huge keys - it may take a long
time:

gpg --export | gpg --list-packets | awk -F= -v oldoff=-1 -v keyid=unset
' /^# off=/{ off = $2 + 0 }
/^:public key/{ if (oldoff>-1) { print (off - oldoff) " " keyid };
oldoff = off; keyid = "unset"; } /keyid:/ {if (keyid == "unset") {
keyid = $1; } } END { print (off - oldoff) " " keyid ; };' | sort -n

It should produce something like this:

614318 	keyid: 789D6F057FD863FE
696582 	keyid: CCD2ED94D21739E9
708855 	keyid: 33961588E1C21845
3564879 	keyid: 9FF2194CC09A61E8
46227507 	keyid: 1DCBDC01B44427C7

The last two keys are the issues.

A faster test is this:

< ${GNUPGHOME:-~/.gnupg}/pubring.gpg gpg --list-packets | awk -F= -v
oldoff=-1 -v keyid=unset ' /^# off=/{ off = $2 + 0 }
/^:public key/{
   if (oldoff>-1) { print (off - oldoff) " " keyid };
   oldoff = off; keyid = "unset";
}
/keyid:/ {if (keyid == "unset") { keyid = $1; } }
END { print (off - oldoff) " " keyid ; };' | sort -n


Either way, delete the relevant keys and everything will speed up.

Of course, you need to figure out whose key it was, if you need it, what
the problem was etc, but that is why Claws was hanging.

Now back to being a workable program !

B. Rgds
John
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.claws-mail.org/pipermail/users/attachments/20191125/f5bc339e/attachment.sig>


More information about the Users mailing list