all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kenichi Handa <handa@m17n.org>
To: Kenichi Handa <handa@m17n.org>
Cc: nickrob@snap.net.nz, hongyi.zhao@gmail.com, emacs-devel@gnu.org
Subject: Display bug [Re: My Emacs unicode 2 crash again ...]
Date: Wed, 07 Mar 2007 14:37:39 +0900	[thread overview]
Message-ID: <E1HOoqJ-0003Il-Ey@etlken.m17n.org> (raw)
In-Reply-To: <E1HOoEX-0002hK-18@etlken.m17n.org> (message from Kenichi Handa on Wed, 07 Mar 2007 13:58:37 +0900)

In article <E1HOoEX-0002hK-18@etlken.m17n.org>, Kenichi Handa <handa@m17n.org> 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
handa@m17n.org

  reply	other threads:[~2007-03-07  5:37 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-06  6:30 My Emacs unicode 2 crash again when I do some *Replace String (M-%)*, I give the debug informations under gdb in the attachments Hongyi Zhao
2007-03-06  7:02 ` Kenichi Handa
2007-03-06  8:57   ` Hongyi Zhao
2007-03-06  8:06 ` Kenichi Handa
2007-03-06  8:41   ` Hongyi Zhao
2007-03-06 12:38     ` Kenichi Handa
2007-03-06 15:23       ` Hongyi Zhao
2007-03-06 14:10   ` David Kastrup
2007-03-07  1:01     ` Kenichi Handa
2007-03-07  2:37       ` Nick Roberts
2007-03-07  3:56         ` Hongyi Zhao
2007-03-07  4:01           ` Nick Roberts
2007-03-07  4:58             ` Hongyi Zhao
2007-03-07  5:10               ` Nick Roberts
2007-03-07  4:58           ` Kenichi Handa
2007-03-07  5:37             ` Kenichi Handa [this message]
2007-03-07  6:26               ` Display bug [Re: My Emacs unicode 2 crash again ...] Hongyi Zhao
2007-03-07  6:40                 ` Kenichi Handa
2007-03-07  7:38                   ` Hongyi Zhao
2007-03-07 17:26                 ` Richard Stallman
2007-03-08  3:50                   ` Hongyi Zhao
2007-03-08 21:47                     ` Richard Stallman
2007-03-07 17:25         ` My Emacs unicode 2 crash again when I do some *Replace String (M-%)*, I give the debug informations under gdb in the attachments Richard Stallman
2007-03-08  4:24           ` Eli Zaretskii
2007-03-08  4:50             ` Miles Bader
2007-03-09 15:08               ` Eli Zaretskii
2007-03-09 15:26                 ` Andreas Schwab
2007-03-09 15:51                   ` Eli Zaretskii
2007-03-09 15:56                   ` Eli Zaretskii
2007-03-09 21:26                 ` Richard Stallman
2007-03-10 19:18                   ` Eli Zaretskii
2007-03-09 22:59                 ` Stefan Monnier
2007-03-11 21:10                   ` Eli Zaretskii
2007-03-11 21:32                     ` David Kastrup
2007-03-11 21:56                       ` Eli Zaretskii
2007-03-11 21:59                         ` David Kastrup
2007-03-12  4:14                           ` Eli Zaretskii
2007-03-11 22:29                       ` Andreas Schwab
2007-03-12  6:11                         ` Stephen J. Turnbull
2007-03-12 22:08                           ` Eli Zaretskii
2007-03-13  3:36                             ` Stephen J. Turnbull
2007-03-13  7:54                               ` David Kastrup
2007-03-13 21:24                                 ` Eli Zaretskii
2007-03-12  7:04                         ` David Kastrup
2007-03-12 14:23                     ` Stefan Monnier
2007-03-12 21:50                       ` Eli Zaretskii
2007-03-13  1:33                         ` Stefan Monnier
2007-03-08  7:19             ` Stefan Monnier
2007-03-09 15:20               ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1HOoqJ-0003Il-Ey@etlken.m17n.org \
    --to=handa@m17n.org \
    --cc=emacs-devel@gnu.org \
    --cc=hongyi.zhao@gmail.com \
    --cc=nickrob@snap.net.nz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.