From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kenichi Handa Newsgroups: gmane.emacs.devel Subject: Display bug [Re: My Emacs unicode 2 crash again ...] Date: Wed, 07 Mar 2007 14:37:39 +0900 Message-ID: References: <20070306063056.GA21948@debian-testing-hy.localdomain> <86zm6q5upr.fsf@lola.quinscape.zz> <17902.9556.720278.162036@kahikatea.snap.net.nz> <20070307035646.GA14561@debian-testing-hy.localdomain> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Content-Type: text/plain; charset=US-ASCII X-Trace: sea.gmane.org 1173245894 30966 80.91.229.12 (7 Mar 2007 05:38:14 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 7 Mar 2007 05:38:14 +0000 (UTC) Cc: nickrob@snap.net.nz, hongyi.zhao@gmail.com, emacs-devel@gnu.org To: Kenichi Handa Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Mar 07 06:38:07 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HOoqk-0000HM-9x for ged-emacs-devel@m.gmane.org; Wed, 07 Mar 2007 06:38:06 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HOoqm-0003Qv-UO for ged-emacs-devel@m.gmane.org; Wed, 07 Mar 2007 00:38:08 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HOoqc-0003QZ-7M for emacs-devel@gnu.org; Wed, 07 Mar 2007 00:37:58 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HOoqa-0003P7-Oc for emacs-devel@gnu.org; Wed, 07 Mar 2007 00:37:57 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HOoqa-0003P4-Hf for emacs-devel@gnu.org; Wed, 07 Mar 2007 00:37:56 -0500 Original-Received: from mx1.aist.go.jp ([150.29.246.133]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HOoqV-0005SN-Iy for emacs-devel@gnu.org; Wed, 07 Mar 2007 00:37:52 -0500 Original-Received: from rqsmtp2.aist.go.jp (rqsmtp2.aist.go.jp [150.29.254.123]) by mx1.aist.go.jp with ESMTP id l275bfhS008767; Wed, 7 Mar 2007 14:37:41 +0900 (JST) env-from (handa@m17n.org) Original-Received: from smtp4.aist.go.jp by rqsmtp2.aist.go.jp with ESMTP id l275beuE008462; Wed, 7 Mar 2007 14:37:40 +0900 (JST) env-from (handa@m17n.org) Original-Received: by smtp4.aist.go.jp with ESMTP id l275bdV2008534; Wed, 7 Mar 2007 14:37:39 +0900 (JST) env-from (handa@m17n.org) Original-Received: from handa by etlken.m17n.org with local (Exim 4.63) (envelope-from ) id 1HOoqJ-0003Il-Ey; Wed, 07 Mar 2007 14:37:39 +0900 In-reply-to: (message from Kenichi Handa on Wed, 07 Mar 2007 13:58:37 +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) X-detected-kernel: Solaris 8 (1) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:67483 Archived-At: In article , Kenichi Handa 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 # (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