all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: storm@cua.dk (Kim F. Storm)
Cc: emacs-devel@gnu.org
Subject: Re: xdisp.c 1.794 breaks Mac OS X (Carbon)
Date: 16 Dec 2002 01:45:55 +0100	[thread overview]
Message-ID: <5xznr694fw.fsf@kfs2.cua.dk> (raw)
In-Reply-To: <7206041.1039633587298.JavaMail.steventamm@mac.com>

Steven Tamm <steventamm@mac.com> writes:

> Just updated to latest source and a change in to xdisp.c:row_containing_pos causes the osx build to break reliably after scrolling through a long document.  Reverting to 1.793 fixes everything
> 
> The problem is that row is NULL for set_cursor_from_row in try_window_id.  Should there be a check for row=NULL in try_window_id?  Here is the stack trace.
> 
> Exception:  EXC_BAD_ACCESS (0x0001)
> Codes:      KERN_PROTECTION_FAILURE (0x0002) at 0x0000006c
> Thread 0 Crashed:
>  #0   0x00020488 in set_cursor_from_row (xdisp.c:9447)
>  #1   0x00025d5c in try_window_id (xdisp.c:11774)
>  #2   0x000230e4 in redisplay_window (xdisp.c:10478)
>  #3   0x000203f8 in redisplay_window_0 (xdisp.c:9417)
>  #4   0x000c9518 in internal_condition_case_1 (eval.c:1393)
> 
> Let me know if more details are needed...
> 
> -Steven
> 

Hi Steven,

I "fixed" this problem by testing that the "row" was non-NULL before
calling set_cursor_from_row.  However, RMS has asked me to try finding
the actual cause the this error:

> + 2002-12-11  Kim F. Storm  <storm@cua.dk>
> + 
> + 	* xdisp.c (try_window_id): Don't call set_cursor_from_row if
> + 	row_containing_pos returned NULL.
> + 
> 
> This is an obvious way to avoid the crash, but is it a correct fix?  I
> don't know.  If it is not correct, the result is likely to be
> another occasional bug that puts the cursor in the wrong place.
> That would be hard to debug.
> 
> Could you please check if it is correct?  One way to check
> is to add
> 
>         else
> 	  abort ();
> 
> after each of those if statements, and run under GDB.  When it stops
> at `abort', type `return' so it won't die, then either (1) step
> through and see if the subsequent actions look reasonable or (2)
> just continue and see if the cursor comes out in the right place. 
> 

If you can still reproduce the crash (after adding the else abort();),
could you try to follow RMS' instructions above.

Now, if the cursor does indeed not appear in the right position,
could you try the following patch that RMS suggested to fix this:

The change below may fix the problem, but I am not certain it is
correct.  Anyway, can you please run under GDB all the time, with a
breakpoint set in set_cursor_from_row like this?

  b set_cursor_from_row if row==0

If it stops there, please try calling row_containing_pos the same way
it was called by try_window_id, but step through it and see precisely
why it returns zero.  In particular, what line does it return at?
(Show us the code on and around that line, not just the line number!)
What is the value of MATRIX_ROW_BOTTOM_Y (row) for the last row that
it thinks about?  And what is last_y?  Should it have found PT in the
previous row?


*** xdisp.c.~1.794.~	Sun Dec  8 16:06:46 2002
--- xdisp.c	Tue Dec 10 22:22:07 2002
***************
*** 11514,11520 ****
        /* Give up if we have gone too far.  */
        if (end && row >= end)
  	return NULL;
!       if (MATRIX_ROW_BOTTOM_Y (row) >= last_y)
  	return NULL;
  
        /* If it is in this row, return this row.  */
--- 11516,11522 ----
        /* Give up if we have gone too far.  */
        if (end && row >= end)
  	return NULL;
!       if (MATRIX_ROW_BOTTOM_Y (row) > last_y)
  	return NULL;
  
        /* If it is in this row, return this row.  */


-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

      parent reply	other threads:[~2002-12-16  0:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-11 19:06 xdisp.c 1.794 breaks Mac OS X (Carbon) Steven Tamm
2002-12-11 22:22 ` Kim F. Storm
2002-12-16  0:45 ` Kim F. Storm [this message]

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=5xznr694fw.fsf@kfs2.cua.dk \
    --to=storm@cua.dk \
    --cc=emacs-devel@gnu.org \
    /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.