Re: [Fwd: Re: [Evolution-hackers] Question about defunc processes produced by libsoup on Solaris]



It's not an elegant way.

For Solaris, should call
sigaction() with flag SA_NOCLDWAIT to indicate not to wait for a zombie child.


Hi! Soup developers,
Here is a patch seemed can fix this bug. Please review it. BTW, Sean means soup-0.7.11, not libsoup HEAD. The patch is also for soup-0.7.11 which is used by evolution 1.2.3. But this problem might also exists for libsoup HEAD. I don't have a environment to test it now.
   Thanks!
      Harry
Sean Gao wrote:

Hi Hackers,
   We met a problem when using libsoup.
In the funciton soup-ssl.c : soup_get_ssl_iochannel_real, it uses fork() and exec() to create a child progress to complete the secure connection establishment by execute soup_ssl_proxy. This works well on Linux, however, on Solaris we find that it will produce a lot of defunct processes there before the parent process ends. And we have noticed that there is a waitpid () call if G_IO_HUP|G_IO_ERR|G_IO_NVAL matches. However, if there is no such error signal returns, why the parent do not call waitpid () to waiting the child process? AFAIK, it would make child pocesses become zombie if the parent neither end before the child
nor wait for it.
    Any idea?
Thanks,

-Sean


_______________________________________________
evolution-hackers maillist  -  evolution-hackers lists ximian com
http://lists.ximian.com/mailman/listinfo/evolution-hackers

------------------------------------------------------------------------

Index: src/libsoup/soup-ssl.c
===================================================================
RCS file: /cvs/gnome/soup/src/libsoup/soup-ssl.c,v
retrieving revision 1.16.2.1.2.2
diff -u -r1.16.2.1.2.2 soup-ssl.c
--- src/libsoup/soup-ssl.c	16 Oct 2002 19:44:37 -0000	1.16.2.1.2.2
+++ src/libsoup/soup-ssl.c	31 Mar 2003 08:00:16 -0000
@@ -58,7 +58,16 @@
static gboolean
soup_ssl_hup_waitpid (GIOChannel *source, GIOCondition condition, gpointer ppid)
{
+	pid_t pidDead;
+	int status;
+
	waitpid (GPOINTER_TO_INT (ppid), NULL, 0);
+
+	/* Remove all defunct processes that parent owns */
+	do {
+		pidDead = waitpid(-1, &status, WNOHANG);
+	}
+	while ((pidDead != -1) && (pidDead != 0));

	return FALSE;
}





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]