[pkg-gnupg-maint] Bug#868550: Bug#868550: reprepro seems to provide a repro

NIIBE Yutaka gniibe at fsij.org
Wed Sep 6 08:03:26 UTC 2017


Ian Jackson <ijackson at chiark.greenend.org.uk> wrote:
> I tried this.  I applied this change and I can confirm that I have
> seen this message in all the failing tests I looked at.

OK.

> With that patch, I can still reproduce the failure.  The passing tests
> succeed and exit, leaving a failing test (so far, only one out of a
> test run) sitting about.  The machine load is low.  There is no
> gpg-agent running.  So the problem I am seeing is not simply that the
> agent process is starved (although I don't doubt that the race you
> describe exists).

I see.

> Each individual test runs with its own GNUPGHOME and is largely
> singlethreaded so I think there are probably not multpile competing
> agents starting up.  Is it possible that the agent started up and then
> exited for some reason ?

Possibly.

I examined the code again.  I found a redundant part in
exechelp-posix.c.  I think that gnupg_spawn_process_detached can be
simplified.  That's because: When gpg-agent (and dirmngr) is invoked
with --daemon option, it does fork, setsid and chdir by itself.

Could you please try with following patch?  This patch also makes
tracking the possible cause easier/simpler.

With the patch, when gpg-agent fails, gpg frontend will emit the error of: 

    gpg: waitpid failed in gnupg_spawn_process_detached...

===============
diff --git a/common/exechelp-posix.c b/common/exechelp-posix.c
index 7237993a2..33004250b 100644
--- a/common/exechelp-posix.c
+++ b/common/exechelp-posix.c
@@ -850,17 +850,7 @@ gnupg_spawn_process_detached (const char *pgmname, const char *argv[],
     }
   if (!pid)
     {
-      pid_t pid2;
-
       gcry_control (GCRYCTL_TERM_SECMEM);
-      if (setsid() == -1 || chdir ("/"))
-        _exit (1);
-
-      pid2 = fork (); /* Double fork to let init take over the new child. */
-      if (pid2 == (pid_t)(-1))
-        _exit (1);
-      if (pid2)
-        _exit (0);  /* Let the parent exit immediately. */
 
       if (envp)
         for (i=0; envp[i]; i++)
===============
-- 



More information about the pkg-gnupg-maint mailing list