From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Tracking down assertion failure Date: Wed, 12 Mar 2008 15:18:29 -0400 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1205349542 15183 80.91.229.12 (12 Mar 2008 19:19:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 12 Mar 2008 19:19:02 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Mar 12 20:19:29 2008 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 1JZWTq-00005L-0M for ged-emacs-devel@m.gmane.org; Wed, 12 Mar 2008 20:19:14 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JZWTH-0003sw-Bf for ged-emacs-devel@m.gmane.org; Wed, 12 Mar 2008 15:18:39 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JZWTD-0003sr-HR for emacs-devel@gnu.org; Wed, 12 Mar 2008 15:18:35 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JZWT8-0003sc-Vf for emacs-devel@gnu.org; Wed, 12 Mar 2008 15:18:34 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JZWT8-0003sZ-Pi for emacs-devel@gnu.org; Wed, 12 Mar 2008 15:18:30 -0400 Original-Received: from ironport2-out.pppoe.ca ([206.248.154.182]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JZWT8-0007C8-SA for emacs-devel@gnu.org; Wed, 12 Mar 2008 15:18:31 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ar8FAOzI10fO+JwVUGdsb2JhbACQaAEBJxKXIIEG X-IronPort-AV: E=Sophos;i="4.25,490,1199682000"; d="scan'208";a="15945716" Original-Received: from smtp.pppoe.ca ([65.39.196.238]) by ironport2-out.pppoe.ca with ESMTP; 12 Mar 2008 15:18:29 -0400 Original-Received: from pastel.home ([206.248.156.21]) by smtp.pppoe.ca (Internet Mail Server v1.0) with ESMTP id SWE46929; Wed, 12 Mar 2008 15:18:29 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 394D77FD8; Wed, 12 Mar 2008 15:18:29 -0400 (EDT) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. 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:92310 Archived-At: I regularly get assertion failures in the redisplay that have to do with an apparent discrepency between charpos and bytepos. More specifically, the assertion failure is at xdisp.c:6062: xassert (IT_BYTEPOS (*it) == CHAR_TO_BYTE (IT_CHARPOS (*it))); I've propagated this assertion a bit everywhere and I se it even triggers around line 11500: /* Skip from tlbufpos to PT and see where it is. Note that PT may be in invisible text. If so, we will end at the next visible position. */ init_iterator (&it, w, CHARPOS (tlbufpos), BYTEPOS (tlbufpos), NULL, DEFAULT_FACE_ID); xassert (IT_BYTEPOS (it) == CHAR_TO_BYTE (IT_CHARPOS (it))); the problem is that as I keep adding such assertions earlier and earlier in the code I seem to start hitting another problem: I'm not sure at which point this condition should be true and and at which point it's OK for it not to be true (because the charpos and bytepos recorded refer to out-of-data data which will/should simply not be used). Can someone help me out? Stefan