>>>> "MW" == Marco Walther
<marcow(a)jena.eng.sun.com> writes:
MW> In XEmacs 21.4 (patch 0) "Solid Vapor" [Lucid] (sparc-sun-solaris2.8) of
Mon Apr 16 2001 on jena
MW> configured using `configure --prefix=/export/home/marcow/usr/local
--site-includes=/export/home/marcow/usr/local/include
--site-libraries=/export/home/marcow/usr/local/lib --with-gtk=no --error-checking=none
--debug=no'
MW> I did see the following a couple of times now with the 21.2.beta's and
MW> 21.4.0. I don't know what causes it but but it looks like XEmacs has
MW> sometimes problems with the fork(). It's not that often, it starts
MW> maybe after around 1000 forks (wild guess, vm starts an external
MW> program every 2 minutes) and than persists.
MW> Has somebody an idea where to start looking??
Ok, the error message is a little bit misleading:-( I was running out
of (virtual) memory:-( A nice Java app had eaten all my memory:-(
The following patch will at least give the correct error message for
the failing fork(). It looks a little bit complicated. Maybe
somebody with a little bit deeper understanding of this proc code
could move the error check (pid < 0) right next to the fork??
Thanks,
-- Marco
---------------------------------------------------------------------------
diff -u xemacs-21.4.0/src/callproc.c~ xemacs-21.4.0/src/callproc.c
--- xemacs-21.4.0/src/callproc.c~ Thu Apr 12 11:23:27 2001
+++ xemacs-21.4.0/src/callproc.c Wed Apr 18 13:26:42 2001
@@ -189,6 +189,9 @@
int bufsize = 16384;
int speccount = specpdl_depth ();
struct gcpro gcpro1, gcpro2, gcpro3;
+#ifndef ORIGINAL /* MARCO */
+ int save_errno_fork;
+#endif /* MARCO */
char **new_argv = alloca_array (char *, max (2, nargs - 2));
/* File to use for stderr in the child.
@@ -391,6 +394,13 @@
#else /* not WIN32_NATIVE */
pid = fork ();
+#ifndef ORIGINAL /* MARCO */
+ if (pid < 0)
+ {
+ save_errno_fork = errno;
+ }
+#endif /* MARCO */
+
if (pid == 0)
{
if (fd[0] >= 0)
@@ -429,7 +439,11 @@
int save_errno = errno;
if (fd[0] >= 0)
close (fd[0]);
+#ifdef ORIGINAL /* MARCO */
errno = save_errno;
+#else
+ errno = save_errno_fork;
+#endif /* MARCO */
report_file_error ("Doing fork", Qnil);
}
#endif
--