]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix bug re noninteractive multithreaded memory allocation.
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 1 Jul 2013 21:06:12 +0000 (14:06 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 1 Jul 2013 21:06:12 +0000 (14:06 -0700)
* emacs.c (malloc_enable_thread): Hoist extern decl to top level.
(main) [HAVE_PTHREAD && !SYSTEM_MALLOC && !DOUG_LEA_MALLOC]:
Invoke malloc_enable_thread even when not interactive.
Problem reported by Ken Brown in <http://bugs.gnu.org/14569#275>.
* process.c (init_process_emacs) [CYGWIN]: Tickle glib even
in this case, since the underlying bug has now been fixed.

src/ChangeLog
src/emacs.c
src/process.c

index 23e9502e3b5c87ef81893934012ba7c05043617d..061083af6cde62ccb7c22f25b51107029cba34c0 100644 (file)
@@ -1,3 +1,13 @@
+2013-07-01  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Fix bug re noninteractive multithreaded memory allocation (Bug#14569).
+       * emacs.c (malloc_enable_thread): Hoist extern decl to top level.
+       (main) [HAVE_PTHREAD && !SYSTEM_MALLOC && !DOUG_LEA_MALLOC]:
+       Invoke malloc_enable_thread even when not interactive.
+       Problem reported by Ken Brown in <http://bugs.gnu.org/14569#275>.
+       * process.c (init_process_emacs) [CYGWIN]: Tickle glib even
+       in this case, since the underlying bug has now been fixed.
+
 2013-07-01  Juanma Barranquero  <lekktu@gmail.com>
 
        * emacs.c (Fkill_emacs): Expand Vauto_save_list_file_name before
index 77ae977b37ce643768afc963de8920d23e52dd7d..08be786de95d6f77f979498146579ef33a81f64c 100644 (file)
@@ -127,6 +127,8 @@ extern int malloc_set_state (void*);
 /* True if the MALLOC_CHECK_ environment variable was set while
    dumping.  Used to work around a bug in glibc's malloc.  */
 static bool malloc_using_checking;
+#elif defined HAVE_PTHREAD && !defined SYSTEM_MALLOC
+extern void malloc_enable_thread (void);
 #endif
 
 Lisp_Object Qfile_name_handler_alist;
@@ -1074,13 +1076,8 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem
 #endif /* DOS_NT */
     }
 
-#if defined (HAVE_PTHREAD) && !defined (SYSTEM_MALLOC) && !defined (DOUG_LEA_MALLOC)
-  if (! noninteractive)
-    {
-      extern void malloc_enable_thread (void);
-
-      malloc_enable_thread ();
-    }
+#if defined HAVE_PTHREAD && !defined SYSTEM_MALLOC && !defined DOUG_LEA_MALLOC
+  malloc_enable_thread ();
 #endif
 
   init_signals (dumping);
index b63a985fcec8111062826722c57806525eeb3dec..5fe07a9c4fa9aef734f14162bfb92c79c7842ad4 100644 (file)
@@ -7095,15 +7095,11 @@ init_process_emacs (void)
   if (! noninteractive || initialized)
 #endif
     {
-#if defined HAVE_GLIB && !defined WINDOWSNT && !defined CYGWIN
+#if defined HAVE_GLIB && !defined WINDOWSNT
       /* Tickle glib's child-handling code.  Ask glib to wait for Emacs itself;
         this should always fail, but is enough to initialize glib's
-        private SIGCHLD handler, allowing the code below to copy it into
-        LIB_CHILD_HANDLER.
-
-        For some reason tickling causes Cygwin bootstrap to fail, so it's
-        skipped under Cygwin.  FIXME: Skipping the tickling likely causes
-        bugs in subprocess handling under Cygwin (Bug#14569).  */
+        private SIGCHLD handler, allowing catch_child_signal to copy
+        it into lib_child_handler.  */
       g_source_unref (g_child_watch_source_new (getpid ()));
 #endif
       catch_child_signal ();