Page MenuHome GnuPG

Dirmngr ldap CRL checks leave zombie dirmngr_ldap processes (2.1.x)
Closed, ResolvedPublic

Description

To reproduce verify the attached message (It should include all required
certificates):

GNUPGHOME=$(mktemp -d) gpgsm --verify signed-smime-test.asc
ps ux | grep dirmngr

I've checked this against master and gnupg-2.1.1 both leave two dirmngr_ldap
zombie processes.

Details

Due Date
Jun 20 2015, 2:00 AM
Version
master

Event Timeline

aheinecke added projects: dirmngr, Bug Report.
aheinecke added subscribers: werner, aheinecke.

This problem is due to ldap_wrapper creating processes with gnupg_spawn_process
but while gnupg_spawn_process states that you have to call gnupg_wait_process
and gnupg_release_process afterwards this is not done in the ldap_wrapper.

Sometimes release is called but never wait to get the exit status of the spawned
process and remove the zombie.

If release is not called this will also leak a handle on Windows.

Attached Patch moves the process cleanup in it's own function and calls that
function from where the process should be terminated and cleaned up.

My test for this:
export GNUPGHOME=$(mktemp -d)
echo "11:B9:1B:31:EE:09:E0:84:4D:25:4E:58:7A:65:CE:51:84:F3:6B:70 S" >
$GNUPGHOME/trustlist.txt
gpgsm --verify signed-smime-test.asc

Changing component to gnupg with topic dirmngr in the hope to get more
visibility and because dirmngr is part of the gnupg repo in 2.1

Just to point this problem out again (still exists with current master of
course). The CRL checks during a normal start of kleopatra on my keyring leave
55 dirmngr zombies.

This problem is not really bad for me as I am using the attached Patch. Still
after 3 months I'd appreciate a reaction / review.

werner set Due Date to Jun 20 2015, 2:00 AM.Jun 12 2015, 1:49 PM

Weel, your patch defeated the code to properly log all output from the ldap
helper and only then cleanup the wrappers. For the actual fix please see T1978.

Fixed with commit 685b782.