GNU bug report logs - #13166
‘system*’ may leave dangling processes

Previous Next

Package: guile;

Reported by: ludo <at> gnu.org (Ludovic Courtès)

Date: Wed, 12 Dec 2012 23:17:02 UTC

Severity: normal

Done: ludo <at> gnu.org (Ludovic Courtès)

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: bug-guile <at> gnu.org
Subject: ‘system*’ may leave dangling processes
Date: Thu, 13 Dec 2012 00:14:32 +0100
[Message part 1 (text/plain, inline)]
When running this:

  (false-if-exception (system* "does-not-exist"))

a process is left behind.

One possible solution is to make sure the child exits:

[Message part 2 (text/x-patch, inline)]
diff --git a/libguile/simpos.c b/libguile/simpos.c
index 5c8fe96..2e340e2 100644
--- a/libguile/simpos.c
+++ b/libguile/simpos.c
@@ -138,9 +138,7 @@ SCM_DEFINE (scm_system_star, "system*", 0, 0, 1,
         {
           /* child */
           execvp (execargv[0], execargv);
-          SCM_SYSERROR;
-          /* not reached.  */
-          return SCM_BOOL_F;
+	  _exit (127);
         }
       else
         {
[Message part 3 (text/plain, inline)]
We’d still need to print ‘strerror (errno)’ in the child, though.

Thoughts?

Ludo’.

This bug report was last modified 12 years and 156 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.