emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Display bug [Re: My Emacs unicode 2 crash again ...]


From: Kenichi Handa
Subject: Display bug [Re: My Emacs unicode 2 crash again ...]
Date: Wed, 07 Mar 2007 14:37:39 +0900
User-agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/22.0.95 (i686-pc-linux-gnu) MULE/5.0 (SAKAKI)

In article <address@hidden>, Kenichi Handa <address@hidden> writes:
> It now shows the correct place of calling abort() as below,
> and I can reproduce the bug by compiling Emacs with
> --enable-asserts.

> Breakpoint 1, abort () at emacs.c:431
> (gdb) bt full
> #0  abort () at emacs.c:431
> No locals.
> #1  0x0808a8ec in try_window_id (w=0x8867cc8) at xdisp.c:15132
[...]
>       xassert (w->window_end_bytepos >= 0);   <-- line 15132
>       IF_DEBUG (debug_method_add (w, "A"));
>     }

> I'm now trying to find what is wrong.

I found that the same bug can be reproduced even with Emacs
22 (latest CVS HEAD) when it is configured with
--enable-asserts.  Please try to build Emacs that way, and
run this code:

(defun temp ()
  (with-temp-buffer
    (switch-to-buffer (current-buffer))
    (insert "a-\n-\nd\n")
    (let ((nbsp (string (decode-char 'ucs #xa0))))
      (while t
        (goto-char 1)
        (replace-string "-" nbsp)
        (sit-for 0.1)
        (goto-char 1)
        (replace-string nbsp "-")
        (sit-for 0.1)))))

It just swaps "-" and NBSP repeatedly.  As the logic of the
function try_window_id is quite complicated, I still don't
understand what is wrong.  Could someone help?  FYI,

(gdb) run
[...]
Breakpoint 1, abort () at emacs.c:431
(gdb) up
#1  0x08086b40 in try_window_id (w=0x85df240) at xdisp.c:14983
(gdb) pp w->buffer
#<buffer  *temp*>
(gdb) pp current_buffer->name
" *temp*"
(gdb) p *current_buffer->text
$7 = {
  beg = 0x85bf3e0 "a-\n-", 
  gpt = 5, 
  z = 8, 
  gpt_byte = 5, 
  z_byte = 8, 
  gap_size = 13, 
  modiff = 6, 
  chars_modiff = 6, 
  save_modiff = 1, 
  overlay_modiff = 1, 
  beg_unchanged = 1, 
  end_unchanged = 3, 
  unchanged_modified = 4, 
  overlay_unchanged_modified = 1, 
  intervals = 0x0, 
  markers = 0x854d948
}
(gdb) p row->end.pos
$8 = {
  charpos = 8, 
  bytepos = 10
}
(gdb) p w->window_end_bytepos
$9 = -2
(gdb) 

It seems that the buffer now contains only ASCII
(i.e. "a-\n-\nd\n"), but row points to a data containing
multibyte characters (NBSP in this case).

---
Kenichi Handa
address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]