diff options
| author | Paul Eggert | 2013-07-03 17:53:13 -0700 |
|---|---|---|
| committer | Paul Eggert | 2013-07-03 17:53:13 -0700 |
| commit | 1ce5cd04df32ebdd269709de23feb5493458173c (patch) | |
| tree | 117e485e8235500d1571d64822f87e851c926eb7 | |
| parent | 96673afeb28274a4495c35e49435ad25e3005a48 (diff) | |
| download | emacs-1ce5cd04df32ebdd269709de23feb5493458173c.tar.gz emacs-1ce5cd04df32ebdd269709de23feb5493458173c.zip | |
Try to fix FreeBSD bug re multithreaded memory allocation.
* src/emacs.c (main) [HAVE_PTHREAD && !SYSTEM_MALLOC && !DOUG_LEA_MALLOC]:
Clear _malloc_thread_enabled_p at startup. Reported by Ashish SHUKLA in
<http://lists.gnu.org/archive/html/emacs-devel/2013-07/msg00088.html>.
Fixes: debbugs:14569
| -rw-r--r-- | src/ChangeLog | 7 | ||||
| -rw-r--r-- | src/emacs.c | 7 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 322b8271f14..5391cefe876 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2013-07-04 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | Try to fix FreeBSD bug re multithreaded memory allocation (Bug#14569). | ||
| 4 | * emacs.c (main) [HAVE_PTHREAD && !SYSTEM_MALLOC && !DOUG_LEA_MALLOC]: | ||
| 5 | Clear _malloc_thread_enabled_p at startup. Reported by Ashish SHUKLA in | ||
| 6 | <http://lists.gnu.org/archive/html/emacs-devel/2013-07/msg00088.html>. | ||
| 7 | |||
| 1 | 2013-07-02 Paul Eggert <eggert@cs.ucla.edu> | 8 | 2013-07-02 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 9 | ||
| 3 | * sysdep.c (sys_siglist) [HAVE_DECL___SYS_SIGLIST]: | 10 | * sysdep.c (sys_siglist) [HAVE_DECL___SYS_SIGLIST]: |
diff --git a/src/emacs.c b/src/emacs.c index 08be786de95..bebc5e420ad 100644 --- a/src/emacs.c +++ b/src/emacs.c | |||
| @@ -128,6 +128,7 @@ extern int malloc_set_state (void*); | |||
| 128 | dumping. Used to work around a bug in glibc's malloc. */ | 128 | dumping. Used to work around a bug in glibc's malloc. */ |
| 129 | static bool malloc_using_checking; | 129 | static bool malloc_using_checking; |
| 130 | #elif defined HAVE_PTHREAD && !defined SYSTEM_MALLOC | 130 | #elif defined HAVE_PTHREAD && !defined SYSTEM_MALLOC |
| 131 | extern int _malloc_thread_enabled_p; | ||
| 131 | extern void malloc_enable_thread (void); | 132 | extern void malloc_enable_thread (void); |
| 132 | #endif | 133 | #endif |
| 133 | 134 | ||
| @@ -681,6 +682,12 @@ main (int argc, char **argv) | |||
| 681 | stack_base = &dummy; | 682 | stack_base = &dummy; |
| 682 | #endif | 683 | #endif |
| 683 | 684 | ||
| 685 | #if defined HAVE_PTHREAD && !defined SYSTEM_MALLOC && !defined DOUG_LEA_MALLOC | ||
| 686 | /* Disable mutexes in gmalloc.c. Otherwise, FreeBSD Emacs recursively | ||
| 687 | loops with pthread_mutex_lock calling calloc and vice versa. */ | ||
| 688 | _malloc_thread_enabled_p = 0; | ||
| 689 | #endif | ||
| 690 | |||
| 684 | #ifdef G_SLICE_ALWAYS_MALLOC | 691 | #ifdef G_SLICE_ALWAYS_MALLOC |
| 685 | /* This is used by the Cygwin build. */ | 692 | /* This is used by the Cygwin build. */ |
| 686 | xputenv ("G_SLICE=always-malloc"); | 693 | xputenv ("G_SLICE=always-malloc"); |