From xemacs-m  Thu Jan 30 13:29:56 1997
Received: from UCSD.EDU (mailbox2.ucsd.edu [132.239.1.54])
          by xemacs.org (8.8.4/8.8.4) with ESMTP
	  id NAA15611 for <xemacs-beta@xemacs.org>; Thu, 30 Jan 1997 13:29:55 -0600 (CST)
Received: from sdnp5.ucsd.edu (sdnp5.ucsd.edu [132.239.79.10]) by UCSD.EDU (8.8.5/8.6.9) with SMTP id LAA00641 for <xemacs-beta@xemacs.org>; Thu, 30 Jan 1997 11:29:57 -0800 (PST)
Received: by sdnp5.ucsd.edu (SMI-8.6/SMI-SVR4)
	id LAA24447; Thu, 30 Jan 1997 11:32:51 -0800
Sender: dmoore@sdnp5.ucsd.edu
To: xemacs-beta@xemacs.org
Subject: Re: failure xemacs 20.0b93 linux 2.0.28
References: <hhsp3jwyxf.fsf@dres.elam.org> <rvraj3r7k9.fsf@sdnp5.ucsd.edu> <m220b39h0e.fsf@altair.xemacs.org>
X-Face: "oX;zS#-JU$-,WKSzG.1gGE]x^cIg!hW.dq>.f6pzS^A+(k!T|M:}5{_%>Io<>L&{hO7W4cicOQ|>/lZ1G(m%7iaCf,6Qgk0%%Bz7b2-W3jd0m_UG\Y;?]}4s0O-U)uox>P3JN)9cm]O\@,vy2e{`3pb!"pqmRy3peB90*2L
Mail-Copies-To: never
From: David Moore <dmoore@UCSD.EDU>
Date: 30 Jan 1997 11:32:49 -0800
In-Reply-To: Steven L Baur's message of 30 Jan 1997 10:04:17 -0800
Message-ID: <rv680frmam.fsf@sdnp5.ucsd.edu>
Lines: 60
X-Mailer: Gnus v5.4.8/XEmacs 19.15

Steven L Baur <steve@miranova.com> writes:

> David Moore writes:
> 
> > I suggest that someone with linux & autoconf figure out a test on
> > when to default to using the system malloc rather than the gmalloc
> > currently provided.
> 
> The change occurred between libc-5.4.18 and libc-5.4.19, but I have no
> idea what the implications might be against pre-dlmalloc Linux libcs
> like 5.2 or 4.7.

	The problem is with the libc providing an incompatible
__malloc_hook, __free_hook or __realloc_hook.  Here's a patch on emacs.c
for 19.15b90, which disables all system provided malloc hooks when we
aren't using the system malloc.  This is part of my plan for the new
gmalloc synch, and I suspect will help with this problem, but at the
moment I don't have access to a linux box with newer/older libc's, so I
don't really know what all the libraries are doing.

	Can someone please test these, before they get put into the next
patchlevel and don't work. :)  Also, does someone have a machine with
the problematic libraries that I can do an occasional build on?

--- emacs.c.orig	Thu Jan 30 11:31:19 1997
+++ emacs.c	Thu Jan 30 11:31:41 1997
@@ -64,6 +64,12 @@
 
 extern void memory_warnings (void *, void (*warnfun) (CONST char *));
 
+#ifndef SYSTEM_MALLOC
+extern void *(*__malloc_hook)(size_t);
+extern void *(*__realloc_hook)(void *, size_t);
+extern void (*__free_hook)(void *);
+#endif  /* not SYSTEM_MALLOC */
+
 
 /* Command line args from shell, as list of strings */
 Lisp_Object Vcommand_line_args;
@@ -359,6 +365,14 @@
   int skip_args = 0;
   Lisp_Object load_me;
   int inhibit_window_system;
+
+#ifndef SYSTEM_MALLOC
+  /* Make sure that any libraries we link against haven't installed a 
+     hook for a gmalloc of a potentially incompatible version. */
+  __malloc_hook = 0;
+  __realloc_hook = 0;
+  __free_hook = 0;
+#endif /* not SYSTEM_MALLOC */
 
 #ifdef NeXT
   extern int malloc_cookie;

-- 
David Moore <dmoore@ucsd.edu>       | Computer Systems Lab      __o
UCSD Dept. Computer Science - 0114  | Work: (619) 534-8604    _ \<,_
La Jolla, CA 92093-0114             | Fax:  (619) 534-1445   (_)/ (_)
<URL:http://oj.egbt.org/dmoore/>    | In a cloud bones of steel.

