This is one of the oldest crashes on my to do list.
loading the following in a vanilla Mule XEmacs will trigger a crash.
(defun delete-and-split ()
(interactive)
(delete-other-windows)
(split-window))
(split-window-vertically)
(insert "$B$,(B")
(backward-char)
(redraw-frame)
(delete-and-split)
Fatal error: assertion failed, file /deb-huge/home/gunnar/src/XEmacs/xemacs/src/objects.h, line 143, RECORD_TYPEP (obj, &lrecord_font_instance)
#3 0x808eb81 in assert_failed (file=0x8218c60 "/deb-huge/home/gunnar/src/XEmacs/xemacs/src/objects.h", line=143,
expr=0x8218d40 "RECORD_TYPEP (obj, &lrecord_font_instance)")
at /deb-huge/home/gunnar/src/XEmacs/xemacs/src/emacs.c:2825
#4 0x80c9db4 in error_check_font_instance (obj=136776524)
at /deb-huge/home/gunnar/src/XEmacs/xemacs/src/objects.h:143
#5 0x81c730f in x_output_string (w=0x85a8c10, dl=0x8609808, buf=0x85e7640, xpos=4, xoffset=0, clip_start=4,
width=16, findex=0, cursor=1, cursor_start=4, cursor_width=16, cursor_height=13)
at /deb-huge/home/gunnar/src/XEmacs/xemacs/src/redisplay-x.c:883
#6 0x81c60d5 in x_output_display_block (w=0x85a8c10, dl=0x8609808, block=0, start=0, end=1, start_pixpos=4,
cursor_start=4, cursor_width=16, cursor_height=13)
at /deb-huge/home/gunnar/src/XEmacs/xemacs/src/redisplay-x.c:390
#7 0x81799c2 in redisplay_output_display_block (w=0x85a8c10, dl=0x8609808, block=0, start=0, end=1,
start_pixpos=4, cursor_start=4, cursor_width=16, cursor_height=13)
at /deb-huge/home/gunnar/src/XEmacs/xemacs/src/redisplay-output.c:1088
#8 0x8178a28 in output_display_line (w=0x85a8c10, cdla=0x0, ddla=0x85e2668, line=1, force_start=4, force_end=20)
at /deb-huge/home/gunnar/src/XEmacs/xemacs/src/redisplay-output.c:751
#9 0x8179839 in redraw_cursor_in_window (w=0x85a8c10, run_end_begin_meths=1)
at /deb-huge/home/gunnar/src/XEmacs/xemacs/src/redisplay-output.c:1029
#10 0x81798be in redisplay_redraw_cursor (f=0x8577f00, run_end_begin_meths=1)
at /deb-huge/home/gunnar/src/XEmacs/xemacs/src/redisplay-output.c:1054
#11 0x81760e9 in Fforce_cursor_redisplay (frame=139951872)
at /deb-huge/home/gunnar/src/XEmacs/xemacs/src/redisplay.c:8938
#12 0x8176761 in text_cursor_visible_p_changed (specifier=137474936, w=0x85e8148, oldval=136988916)
at /deb-huge/home/gunnar/src/XEmacs/xemacs/src/redisplay.c:9005
#13 0x81999b1 in recompute_one_cached_specifier_in_window (specifier=137474936, w=0x85e8148)
at /deb-huge/home/gunnar/src/XEmacs/xemacs/src/specifier.c:2812
#14 0x8199b67 in recompute_all_cached_specifiers_in_window (w=0x85e8148)
at /deb-huge/home/gunnar/src/XEmacs/xemacs/src/specifier.c:2854
#15 0x81d5e1e in Fset_window_buffer (window=140411208, buffer=137541312)
at /deb-huge/home/gunnar/src/XEmacs/xemacs/src/window.c:3198
#16 0x81d6b4e in Fsplit_window (window=140151824, chsize=136988916, horflag=136988916)
at /deb-huge/home/gunnar/src/XEmacs/xemacs/src/window.c:3503
#17 0x8094ed9 in Feval (form=140010872) at /deb-huge/home/gunnar/src/XEmacs/xemacs/src/eval.c:2975
#18 0x8090870 in Fprogn (args=140010812) at /deb-huge/home/gunnar/src/XEmacs/xemacs/src/eval.c:767
#19 0x8096629 in funcall_lambda (fun=140010896, nargs=0, args=0xbffff048)
at /deb-huge/home/gunnar/src/XEmacs/xemacs/src/eval.c:3497
#20 0x8095522 in Feval (form=140007804) at /deb-huge/home/gunnar/src/XEmacs/xemacs/src/eval.c:3081
#21 0x8146b51 in readevalloop (readcharfun=140386240, sourcename=139813548, evalfun=0x80947b0 <Feval>, printflag=0)
at /deb-huge/home/gunnar/src/XEmacs/xemacs/src/lread.c:1448
[...]
#43 0x808d520 in xemacs_21_2_b23_i586_pc_linux (argc=4, argv=0xbffffc34, envp=0xbffffc48, restart=0)
at /deb-huge/home/gunnar/src/XEmacs/xemacs/src/emacs.c:1898
#44 0x808e0ab in main (argc=4, argv=0xbffffc34, envp=0xbffffc48)
at /deb-huge/home/gunnar/src/XEmacs/xemacs/src/emacs.c:2323
The problem is that the face cache doesn't contain the font instance
for the relevant charset or to be precise that the cache has been
cleared but we do not regenerate the necessary entries.
A quick fix for the crash would be adding a call to
ensure_face_cachel_contains_charset() at the relevant place in
x_output_string like this:
Index: redisplay-x.c
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/redisplay-x.c,v
retrieving revision 1.23.2.17
diff -u -r1.23.2.17 redisplay-x.c
--- redisplay-x.c 1999/10/15 10:11:51 1.23.2.17
+++ redisplay-x.c 1999/12/13 22:58:35
@@ -879,10 +879,14 @@
for (i = 0; i < nruns; i++)
{
- Lisp_Object font = FACE_CACHEL_FONT (cachel, runs[i].charset);
- struct Lisp_Font_Instance *fi = XFONT_INSTANCE (font);
+ Lisp_Object font;
+ struct Lisp_Font_Instance *fi;
int this_width;
int need_clipping;
+
+ ensure_face_cachel_contains_charset(cachel, window, runs[i].charset);
+ font = FACE_CACHEL_FONT (cachel, runs[i].charset);
+ fi = XFONT_INSTANCE (font);
if (EQ (font, Vthe_null_font_instance))
continue;
This works but is kindof expensive to do, as x_output_string is called
very very often :-)
Maybe our Mule and redisplay experts can try to come up with something
more clever...
Gunnar