Hello xemacsers,
I got 21.2-b1 a few days ago off the
ftp.xemacs.org ftp site, built
it, ran it and crashed it. [Running it with -q and hitting C-g makes
it crash instantly.]
Looking at the stack dump I saw the problem was in
Fredisplay_echo_area. The effect is that whenever the echo area is
redisplayed, xemacs crashes. I made the debugger go step by step
through the code and realized that the value of "window" changes after
redisplay_window is called. I hypothesized that the problem was
garbage collection so I decided to protect "window". I rebuilt and
ran xemacs again: the error was gone.
Now I'm no xemacs expert and I have a very foggy idea of how garbage
collection in xemacs works. So I don't know if my fix is well
implemented or even if it is the right fix.
Given that I'm able to reproduce that bug very easily, I'm surprised
to find no mention of it in the archives of the mailing lists. I
might somehow be the only person that has encountered that bug so far.
I've worked with OSes, compilers and garbage collectors and seen my
share of bugs that appear only under certain conditions but then are
easily reproductible. Maybe this bug is one of those.
In any case, my tentative patch and other complementary information
follows.
Regards,
ldd
Here is the patch:
==========
--- redisplay.c 1998/09/04 13:39:04 1.1
+++ redisplay.c 1998/09/04 13:39:44
@@ -7862,6 +7862,8 @@
if (FRAME_REPAINT_P (f) && FRAME_HAS_MINIBUF_P (f))
{
Lisp_Object window = FRAME_MINIBUF_WINDOW (f);
+ struct gcpro gcpro1;
+ GCPRO1(window);
/*
* If the frame size has changed, there may be random
* chud on the screen left from previous messages
@@ -7875,6 +7877,7 @@
}
redisplay_window (window, 0);
call_redisplay_end_triggers (XWINDOW (window), 0);
+ UNGCPRO;
}
}
==========
xemacs-21.2-b1/ChangeLog:
==========
1998-09-08 Louis-Dominique Dubeau <ldd(a)step.polymtl.ca>
* src/redisplay.c: protected the "window" variable in
Fredisplay_echo_area.
==========
Lisp backtrace follows:
redisplay-echo-area()
# bind (inhibit-read-only zmacs-region-stays stdout-p frame message)
raw-append-message("Quit" #<x-frame "emacs" 0x8ef> nil)
# bind (stdout-p frame message label)
append-message(error "Quit" #<x-frame "emacs" 0x8ef> nil)
# bind (print-message-label)
display-error((quit) t)
# bind (inhibit-quit debug-on-error etype error-object)
command-error((quit))
# (catch top-level ...)
Stack dump follows:
#0 0x402349e9 in __kill ()
#1 0x80a9f2f in fatal_error_signal (sig=6) at emacs.c:262
#2 0xbfffead8 in ?? ()
#3 0x40270775 in gsignal ()
#4 0x8167256 in Fredisplay_echo_area () at window.h:245
#5 0x80b1492 in funcall_recording_as (recorded_as=-1473111988, nargs=0,
args=0xbfffed18) at eval.c:3197
#6 0x80b1705 in Ffuncall (nargs=1, args=0xbfffed18) at eval.c:3238
#7 0x808924e in Fbyte_code (bytestr=1747378028, vector=-2010718300,
maxdepth=5) at bytecode.c:416
#8 0x80b261f in funcall_lambda (fun=673636368, nargs=3, arg_vector=0xbfffeee0)
at eval.c:3597
#9 0x80b1619 in funcall_recording_as (recorded_as=-1472556644, nargs=3,
args=0xbfffeedc) at eval.c:3214
#10 0x80b1705 in Ffuncall (nargs=4, args=0xbfffeedc) at eval.c:3238
#11 0x808924e in Fbyte_code (bytestr=1747377880, vector=-2010718452,
maxdepth=4) at bytecode.c:416
#12 0x80b261f in funcall_lambda (fun=673636144, nargs=4, arg_vector=0xbffff000)
at eval.c:3597
#13 0x80b1619 in funcall_recording_as (recorded_as=-1473114692, nargs=4,
args=0xbfffeffc) at eval.c:3214
#14 0x80b2cd5 in call4 (fn=-1473114692, arg0=-1473220508, arg1=1747102828,
arg2=674664960, arg3=-1473220604) at eval.c:3973
#15 0x81446e8 in echo_area_append (f=0x8369200, nonreloc=0x0,
reloc=1747102828, offset=0, length=4, label=-1473220508) at minibuf.c:739
#16 0x814b0ca in output_string (function=674664960, nonreloc=0x0,
reloc=1747102828, offset=0, len=4) at print.c:237
#17 0x814c7bd in print_string (obj=1747102828, printcharfun=674664960,
escapeflag=0) at print.c:961
#18 0x814cdc4 in print_internal (obj=1747102828, printcharfun=674664960,
escapeflag=0) at print.c:1139
#19 0x814bd03 in print_error_message (error_object=1212708044,
stream=674664960) at print.c:646
#20 0x814c01f in Fdisplay_error (error_object=1212708044, stream=-1473220580)
at print.c:704
#21 0x80b14b4 in funcall_recording_as (recorded_as=-1473113988, nargs=2,
args=0xbffff514) at eval.c:3197
#22 0x80b1705 in Ffuncall (nargs=3, args=0xbffff514) at eval.c:3238
#23 0x808924e in Fbyte_code (bytestr=1747254716, vector=-2010841532,
maxdepth=5) at bytecode.c:416
#24 0x80b261f in funcall_lambda (fun=673513208, nargs=1, arg_vector=0xbffff630)
at eval.c:3597
#25 0x80b1619 in funcall_recording_as (recorded_as=-1473142980, nargs=1,
args=0xbffff62c) at eval.c:3214
#26 0x80b2bb4 in call1 (fn=-1473142980, arg0=1212708044) at eval.c:3921
#27 0x809038a in cmd_error (data=1212708044, dummy=-1473220604)
at cmdloop.c:195
#28 0x80ae5fe in condition_case_1 (handlers=-1473220508,
bfun=0x8090ef4 <command_loop_1>, barg=-1473220604,
hfun=0x809034c <cmd_error>, harg=-1473220604) at eval.c:1636
#29 0x809142c in command_loop_2 (dummy=-1473220604) at cmdloop.c:256
#30 0x80ae470 in internal_catch (tag=-1473142932,
func=0x80913f8 <command_loop_2>, arg=-1473220604, threw=0x0) at eval.c:1328
#31 0x80907f2 in initial_command_loop (load_me=-1473220604) at cmdloop.c:305
#32 0x80ab00e in xemacs_21_2_b1_i586_pc_linux (argc=2, argv=0xbffff7e4,
envp=0xbffff7f0, restart=0) at emacs.c:1702
#33 0x80ab6b0 in main (argc=2, argv=0xbffff7e4, envp=0xbffff7f0)
at emacs.c:2119
#34 0x8074c9b in _start ()
Output from describe-installation:
uname -a: Linux zen 2.0.30 #1 Tue Apr 22 10:49:45 EDT 1997 i586 unknown
./configure
XEmacs 21.2-b1 "Aeolus" configured for `i586-pc-linux'.
Where should the build process find the source code? /home/ldd/devel/xemacs-21.2-b1
What installation prefix should install use? /usr/local
What operating system and machine description files should XEmacs use?
`s/linux.h' and `m/intel386.h'
What compiler should XEmacs be built with? gcc -g -O3 -Wall -Wno-switch
Should XEmacs use the GNU version of malloc? yes
Should XEmacs use the relocating allocator for buffers? yes
What window system should XEmacs use? x11
Where do we find X Windows header files? /usr/X11/include
Where do we find X Windows libraries? /usr/X11/lib
Compiling in support for XAUTH.
Compiling in support for XPM images.
Compiling in support for X-Face message headers.
Compiling in support for JPEG image conversion.
Compiling in support for TIFF image conversion.
Compiling in native sound support.
Compiling in support for Berkeley DB.
Compiling in support for GNU DBM.
Compiling in support for ncurses.
Compiling in support for GPM (General Purpose Mouse).
Compiling in support for proper session-management.
Using Lucid menubars.
Using Lucid scrollbars.
Using Athena dialog boxes.
Compiling in DLL support.
movemail will use "dot-locking" for locking mail spool files.
Compiling in extra code for debugging.
Compiling in code for checking XEmacs memory usage.
WARNING: ---------------------------------------------------------
WARNING: Compiling in support for runtime error checking.
WARNING: XEmacs will run noticeably more slowly as a result.
WARNING: Error checking is on by default for XEmacs beta releases.
WARNING: ---------------------------------------------------------