Martin Buchholz <martin(a)xemacs.org> writes:
 >>>>> "Gunnar" == Gunnar Evermann
<ge204(a)eng.cam.ac.uk> writes:
 
 Gunnar> I can only make the obvious wild guess here: it's a GC problem! :-)
 
 One trick to try to get reproducible GC crashes: run xemacs under the
 debugger, wait till it comes up, then do
 
 set always_gc = 1
 
 then continue and execute your suspect code.  XEmacs will run VERY 
                
                                               ^^^^^
 slowly, and it will crash as early as possible. 
  ^^^^^^^
no kidding!
this didn't help as apparently only sometimes Lisp stuff is
called. But I can trigger the crash if I call garbage_collec_1 from
the debugger right before the call to tagged_vector_to_alist in
glyphs.c:432. 
The problem is that normalize_image_instantiator potentially calls
simple_image_type_normalize, which has the comment (/* This function
can call lisp */).
the fix is appended below. One could make the gcprotection local to
the 'STRINGP' case, but I was to lazy, should I change that?
1998-12-15  Gunnar Evermann  <ge204(a)eng.cam.ac.uk>
	* glyphs.c (normalize_image_instantiator): GCPRO instantiator
Index: src/glyphs.c
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/glyphs.c,v
retrieving revision 1.23.2.2
diff -u -r1.23.2.2 glyphs.c
--- glyphs.c	1998/12/05 16:55:54	1.23.2.2
+++ glyphs.c	1998/12/15 22:59:26
@@ -466,8 +466,12 @@
 			      Lisp_Object contype,
 			      Lisp_Object dest_mask)
 {
+  struct gcpro gcpro1;
+  
+  GCPRO1(instantiator);
+
   if (IMAGE_INSTANCEP (instantiator))
-    return instantiator;
+    RETURN_UNGCPRO (instantiator);
 
   if (STRINGP (instantiator))
     instantiator = process_image_string_instantiator (instantiator, contype,
@@ -484,9 +488,9 @@
     struct image_instantiator_methods * meths =
       decode_image_instantiator_format (XVECTOR_DATA (instantiator)[0],
 					ERROR_ME);
-    return IIFORMAT_METH_OR_GIVEN (meths, normalize,
+    RETURN_UNGCPRO (IIFORMAT_METH_OR_GIVEN (meths, normalize,
 				   (instantiator, contype),
-				   instantiator);
+				   instantiator));
   }
 }
 
 
-- 
    Gunnar Evermann
Speech, Vision & Robotics Group
Engineering Department
Cambridge University