Endless loop after ecb-activate on 21.5

Mats Lidell matsl at xemacs.org
Tue Jul 3 16:52:48 EDT 2007


Hi,

Moving this discussion to xemacs-beta where I hope it can get some
more attention when it comes to core dumps.

>>>>> Aidan Kehoe <kehoea at parhasard.net> writes:

Aidan> Confirmed. The issue is that
Aidan> ecb-get-current-visible-ecb-buffers is part of
Aidan> current-window-configuration’s advice, but it can also
Aidan> indirectly call current-window-configuration itself, by the
Aidan> chain ecb-canonical-ecb-windows-list ->
Aidan> ecb-canonical-windows-list -> ecb-window-list ->
Aidan> save-window-excursion (previously a subr) ->
Aidan> current-window-configuration.

This has been discussed in the emacs-code-browser list recently. Henry
S. Thompson suggest the patch below to get around the infinit loop.

However when I try it I get a core dump, also inlcuded below. (I do
get core dumps with XEmacs 21.5 at times so this might be unrelated to
the ecb problem!?)

See patch and backtrace below. (Just as I write this I realize that
the xemacs used here is my
slightly-patched-to-compile-with-c++-version which might rule out
everything but Henry gets a core dump as well using 21.5-b28 on cygwin
I think. If the core dump look strange I can come back with another
try with a gcc-compiled version.)

* Patch from Henry S. Thompson
----------------------------------------------------------------------
*** ecb.el      10 Apr 2006 07:53:33 -0000      1.432
--- ecb.el      2 Jul 2007 20:08:12 -0000
***************
*** 1532,1537 ****
--- 1538,1600 ----
    "See `ecb-activate'.  This is the implementation of ECB activation."
    (when (or (null ecb-frame) (not (frame-live-p ecb-frame)))
      (setq ecb-frame (selected-frame)))
+   ;; protect against loops because of xemacs-21.5 (since which release???)
+   ;; changing to a macro which uses current/set-window-configuration
+   ;; ht at inf.ed.ac.uk Sat Jun 30 11:37:38 2007
+   (when (and ecb-running-xemacs
+          (or (> emacs-major-version 21)
+              (and (= emacs-major-version 21)
+                   (>= emacs-minor-version 5))))
+       (fset 'save-window-excursion
+           '(macro lambda (&rest body) ;(cons 'macro (byte-compile-sexp (
+   "Execute body, preserving window sizes and contents.
+ Restores which buffer appears in which window, where display starts,
+ as well as the current buffer.
+ Does not restore the value of point in current buffer."
+   (let ((window-config (gensym 'window-config)))
+     `(let ((,window-config (ad-Orig-current-window-configuration)))
+       (unwind-protect
+         (progn , at body)
+       (ad-Orig-set-window-configuration ,window-config))))))
+       (fset 'set-window-configuration ; byte-compile-sexp
+           '(lambda (configuration)
+              "Set the configuration of windows and buffers as specified by CONFIGURATION.
+ CONFIGURATION must be a value previously returned
+ by `current-window-configuration'."
+              (let ((frame (window-configuration-frame configuration)))
+                (if (and (frame-live-p frame)
+                         (not (window-configuration-equal configuration
+                                                          (ad-Orig-current-window-configuration))))
+                    (really-set-window-configuration frame configuration)))))
+       (fset 'restore-saved-window
+           '(lambda (configuration window saved-window direction)
+   "Within CONFIGURATION, restore WINDOW to the state of SAVED-WINDOW."
+   (and (saved-window-next-child saved-window)
+        (not (saved-window-minibufferp (saved-window-next-child saved-window)))
+        (progn
+        (cond ((eq direction 'vertical)
+               (ad-Orig-split-window window nil nil))
+              ((eq direction 'horizontal)
+               (ad-Orig-split-window window nil t)))
+        (restore-saved-window configuration
+                              (window-next-child window)
+                              (saved-window-next-child saved-window)
+                              direction)))
+ 
+   (if (saved-window-first-hchild saved-window)
+       (restore-saved-window configuration
+                           window
+                           (saved-window-first-hchild saved-window)
+                           'horizontal))
+   (if (saved-window-first-vchild saved-window)
+       (restore-saved-window configuration
+                           window
+                           (saved-window-first-vchild saved-window)
+                           'vertical))
+ 
+   (if (not (saved-window-minibufferp saved-window))
+       (restore-saved-window-parameters configuration window saved-window)))
+       ))
  
    (if ecb-minor-mode
        (when (and (not (equal (selected-frame) ecb-frame))
----------------------------------------------------------------------

* Core dump after doing ecb-activate in an xemacs -vanilla,
  emacs-version "21.5  (beta28) \"fuki\" (+CVS-20070629) XEmacs Lucid"
----------------------------------------------------------------------
Core was generated by `/src/beta/xemacs/bin/xemacs -vanilla'.
Program terminated with signal 6, Aborted.
#0  0xffffe410 in __kernel_vsyscall ()
(gdb) bt
#0  0xffffe410 in __kernel_vsyscall ()
#1  0xb79169b6 in kill () from /lib/libc.so.6
#2  0x08100ea8 in fatal_error_signal (sig=6) at emacs.c:3793
#3  <signal handler called>
#4  0xffffe410 in __kernel_vsyscall ()
#5  0xb79166b9 in raise () from /lib/libc.so.6
#6  0xb7917bd1 in abort () from /lib/libc.so.6
#7  0x080fdca9 in really_abort () at emacs.c:4693
#8  0x081008f9 in assert_failed (file=0x83a1a81 "redisplay.c", line=5201, 
    expr=0x83a1e5e "INTP (obj)") at emacs.c:3986
#9  0x0826eb01 in XINT_1 (obj=147795592, file=0x83a1a81 "redisplay.c", 
    line=5201) at lisp.h:2755
#10 0x0827c382 in create_string_text_block (w=0x8f95660, 
    disp_string=173042736, dl=0xa352c60, start_pos=0, prop=0xbfb59e70, 
    default_face=10) at redisplay.c:5201
#11 0x0827c523 in generate_string_display_line (w=0x8f95660, 
    disp_string=173042736, dl=0xa352c60, start_pos=0, prop=0xbfb59e70, 
    default_face=10) at redisplay.c:5277
#12 0x0827c82f in generate_displayable_area (w=0x8f95660, 
    disp_string=173042736, xpos=4, ypos=41, width=573, height=21, 
    dla=0x852e428, start_pos=0, default_face=10) at redisplay.c:5369
#13 0x081f04d0 in output_gutter (f=0x8f0994c, pos=TOP_GUTTER, force=0)
    at gutter.c:413
#14 0x081f0c1f in update_frame_gutters (f=0x8f0994c) at gutter.c:644
#15 0x082886f3 in redisplay_frame (f=0x8f0994c, preemption_check=1)
    at redisplay.c:6938
#16 0x08288bd5 in redisplay_device (d=0x8dccc18, automatic=1)
    at redisplay.c:7028
#17 0x08289425 in redisplay_without_hooks () at redisplay.c:7103
#18 0x082896dc in redisplay_no_pre_idle_hook () at redisplay.c:7174
#19 0x082896ee in redisplay () at redisplay.c:7156
#20 0x0812e821 in Fnext_event (event=145829620, prompt=147795592)
    at event-stream.c:2288
#21 0x080c1724 in Fcommand_loop_1 () at cmdloop.c:599
#22 0x080c17e3 in command_loop_1 (unused_dummy=147795592) at cmdloop.c:505
#23 0x0810d696 in condition_case_1 (handlers=147793408, 
    bfun=0x80c17ba <command_loop_1>, barg=147795592, 
    hfun=0x80c1ad4 <cmd_error>, harg=147795592) at eval.c:1946
#24 0x080c1959 in command_loop_3 () at cmdloop.c:262
#25 0x080c197b in command_loop_2 (unused_dummy=147795592) at cmdloop.c:275
#26 0x0810bd2a in internal_catch (tag=147540848, 
    func=0x80c1970 <command_loop_2>, arg=147795592, threw=0x0, thrown_tag=0x0, 
    backtrace_before_throw=0x0) at eval.c:1552
#27 0x080c1c87 in initial_command_loop (load_me=147795592) at cmdloop.c:313
#28 0x08103211 in xemacs_21_5_b28_i686_pc_linux (argc=2, argv=0xbfb5a564, 
    unused_envp=0x0, restart=0) at emacs.c:2667
#29 0x081032b9 in main (argc=Cannot access memory at address 0x2291
) at emacs.c:3111
(gdb) 
----------------------------------------------------------------------

Yours
-- 
%% Mats



More information about the XEmacs-Beta mailing list