From xemacs-m  Fri Jul 25 04:31:07 1997
Received: from gol1.gol.com (gol1.gol.com [202.243.48.4])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id EAA10502
	for <xemacs-beta@xemacs.org>; Fri, 25 Jul 1997 04:31:06 -0500 (CDT)
Received: from camelot-soft.camelot-soft.com (tc-2-171.tokyo.gol.com [202.243.49.171])
	by gol1.gol.com (8.8.6/8.8.6) with ESMTP id SAA01200
	for <xemacs-beta@xemacs.org>; Fri, 25 Jul 1997 18:31:02 +0900 (JST)
Received: (from jhod@localhost)
	by camelot-soft.camelot-soft.com (8.8.6/8.8.6) id SAA00891;
	Fri, 25 Jul 1997 18:25:27 +0900
To: xemacs-beta@xemacs.org
Subject: [PATCH] Re: Edit/Copy crash with Vienna (Serious MULE problem alert!)
References: <199707201240.HAA15271@mharnois.workgroup.net> <199707201513.LAA13151@news.smart.net> <87pvscajqo.fsf@bittersweet.inetarena.com> <87n2ngmjqb.fsf@mharnois.workgroup.net> <u4vi23uq7e.fsf_-_@pentagana.sonic.jp>
From: jareth@camelot-soft.com (P. E. Jareth Hein)
In-Reply-To: jareth@camelot-soft.com's message of "22 Jul 1997 23:16:53 +0900"
Mime-Version: 1.0 (generated by tm-edit 7.108)
Content-Type: multipart/mixed;
 boundary="Multipart_Fri_Jul_25_18:25:26_1997-1"
Content-Transfer-Encoding: 7bit
Date: 25 Jul 1997 18:25:26 +0900
Message-ID: <ohd8o7a3g9.fsf_-_@pentagana.camelot.jp>
Lines: 73
X-Mailer: Gnus v5.4.63/XEmacs 20.3(beta14) - "Vienna"

--Multipart_Fri_Jul_25_18:25:26_1997-1
Content-Type: text/plain; charset=US-ASCII

jareth@camelot-soft.com (P. E. Jareth Hein) writes:

> recipient address xemacs-beta@xemacs.org didn't match any local name
> 
> Michael Harnois <mharnois@sbt.net> writes:
> 
> > karlheg+xemacs@inetarena.com (Karl M. Hegbloom) writes:
> > 
> > > Mine too, with glibc-2.0.4
> > 
> > Then it must be another of my libraries that's bad. Steve, what's in
> > play there?
> 
> AAUGH!!  This is not a glibc/lib problem.  There is fundamental memory
> corruption happening in insdel.c somewhere when working with mule
> characters.  I've had this happen to me now with Michael's copy, with
> cc-mode's insert functions and with other basic buffer manipulation
> functions.  Strangely enough, the others only have happened to me when 
> I have had lots of non-ASCII text in my buffers.  But Michael's
> happens no matter what.  Searching for the solution...

Well this turned out not to be exactly a MULE problem, so there is
another memory related bug lurking somewhere...

-- 
Jareth


--Multipart_Fri_Jul_25_18:25:26_1997-1
Content-Type: application/octet-stream
Content-Disposition: attachment; filename="xsel.dif"
Content-Transfer-Encoding: 7bit

Index: XEmacs/src/ChangeLog
diff -u XEmacs/src/ChangeLog:1.1.1.1 XEmacs/src/ChangeLog:1.2
--- XEmacs/src/ChangeLog:1.1.1.1	Tue Jul 22 23:53:14 1997
+++ XEmacs/src/ChangeLog	Fri Jul 25 18:09:31 1997
@@ -1,3 +1,8 @@
+1997-07-25  P E Jareth Hein  <jareth@camelot-soft.com>
+
+	* xselect.c (x_atom_to_symbol): Fixed a memory corruption bug
+ 	where a possibly MULEified string was getting freed before use.
+
 1997-07-10  Hrvoje Niksic  <hniksic@srce.hr>
 
 	* fileio.c (Finsert_file_contents_internal): Handle non-regular
Index: XEmacs/src/xselect.c
diff -u XEmacs/src/xselect.c:1.1.1.1 XEmacs/src/xselect.c:1.2
--- XEmacs/src/xselect.c:1.1.1.1	Tue Jul 22 23:53:26 1997
+++ XEmacs/src/xselect.c	Fri Jul 25 18:09:32 1997
@@ -247,14 +247,16 @@
 #endif
 
   {
+    Lisp_Object newsym;
     CONST char *intstr;
     char *str = XGetAtomName (display, atom);
 
     if (! str) return Qnil;
 
     GET_C_CHARPTR_INT_CTEXT_DATA_ALLOCA (str, intstr);
+    newsym = intern (intstr);
     XFree (str);
-    return intern (intstr);
+    return newsym;
   }
 }
 

--Multipart_Fri_Jul_25_18:25:26_1997-1--

