emacs-pretest-bug
[Top][All Lists]
Advanced

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

Re: Hang while scrolling buffer with PNG images


From: Ralf Angeli
Subject: Re: Hang while scrolling buffer with PNG images
Date: Wed, 10 Sep 2003 23:11:27 +0200
User-agent: Mutt/1.5.4i

I tested the following with revision 1.848 of xdisp.c.  A gdb session
showing one full loop can be found below.

* Richard Stallman (2003-09-10,11:55) writes:

> At what line number does the loop begin, and at what line number does
> it end?

The last line of the frame before the hang ist 10938.  In line 10959
there is a `goto too_near_end' which jumps back to line 10811.

>  Where are the end tests in the loop?  Why don't they exit?

If I interpret this correctly, it fails to jump into the if-clause in
line 10824.

As the cursor actually at the bottom of the window this should
(according to the condition `point is on or below scroll margin
position') be the code fragment to be executed.  But it isn't.

In the gdb session I printed the value of `scroll_margin_pos' at
different points of execution.  Unfortunately I could not do this
with `PT' so I could not see the difference between both values which
are to be compared.

> What variable is supposed to advance in the loop.  Does it in fact
> change from one iteration to the next?  If not, why not?

Again, if I interpret it correctly, this should be `startp'.  The
variable will be altered in one of code blocks inside the if-clauses
on lines 10824 and 10890.  In line 10934 the
`run_window_scroll_functions' will be executed and the if-clause on
line 10955 should not be executed anymore as the cursor should be
fully visible then.

I hope that this analysis was to some extent correct.

Unfortunately I don't really know why it does not jump into the
if-clause on line 10824.  If I had to speculate I would say that the
code has problems with the fact that the LaTeX equation rendered as a
PNG image is higher than a normal line and that something like
`move_it_vertically' fails.  But I really don't know it.

Maybe someone with a deeper knowledge of the code in question can
help out?

Cheers,
Ralf


And here is the gdb session:

(gdb) 
Run till exit from #0  0x080725b8 in try_window (window=1213115328, pos=
      {charpos = -1073750336, bytepos = 1055}) at xdisp.c:12035
0x0806eebf in try_scrolling (window=1213115328, just_this_one_p=1, 
    scroll_conservatively=0, scroll_step=1, temp_scroll_step=0, 
    last_line_misfit=1055) at xdisp.c:10938
10938     if (!try_window (window, startp))
Value returned is $2 = 1
(gdb) next
10940     else if (w->cursor.vpos < 0)
(gdb) 
10948         if (!just_this_one_p
(gdb) 
10955         if (! make_cursor_line_fully_visible (w))
(gdb) 
10957             clear_glyph_matrix (w->desired_matrix);
(gdb) 
10958             last_line_misfit = 1;
(gdb) 
10957             clear_glyph_matrix (w->desired_matrix);
(gdb) 
10959             goto too_near_end;
(gdb) print scroll_margin_pos
$3 = {
  charpos = 1055, 
  bytepos = 1055
}
(gdb) next
10813     CHARPOS (scroll_margin_pos) = XINT (window_end);
(gdb) 
10814     BYTEPOS (scroll_margin_pos) = CHAR_TO_BYTE (CHARPOS 
(scroll_margin_pos));
(gdb) print scroll_margin_pos
$4 = {
  charpos = 2932, 
  bytepos = 1055
}
(gdb) next
10816     end_scroll_margin = this_scroll_margin + !!last_line_misfit;
(gdb) print scroll_margin_pos
$5 = {
  charpos = 2932, 
  bytepos = 2949
}
(gdb) next
10817     if (end_scroll_margin)
(gdb) 
10819         start_display (&it, w, scroll_margin_pos);
(gdb) 
10820         move_it_vertically (&it, - end_scroll_margin);
(gdb) 
10819         start_display (&it, w, scroll_margin_pos);
(gdb) 
10820         move_it_vertically (&it, - end_scroll_margin);
(gdb) 
10821         scroll_margin_pos = it.current.pos;
(gdb) print scroll_margin_pos
$6 = {
  charpos = 2932, 
  bytepos = 2949
}
(gdb) print it.current.pos   
$7 = {
  charpos = 2917, 
  bytepos = 2934
}
(gdb) next
10824     if (PT >= CHARPOS (scroll_margin_pos))
(gdb) print scroll_margin_pos
$8 = {
  charpos = 2917, 
  bytepos = 2934
}
(gdb) next
10883         if (this_scroll_margin)
(gdb) 
10882         scroll_margin_pos = startp;
(gdb) 
10883         if (this_scroll_margin)
(gdb) print scroll_margin_pos
$9 = {
  charpos = 2917, 
  bytepos = 2934
}
(gdb) next
10882         scroll_margin_pos = startp;
(gdb) 
10883         if (this_scroll_margin)
(gdb) 
10890         if (PT < CHARPOS (scroll_margin_pos))
(gdb) print scroll_margin_pos
$10 = {
  charpos = 1055, 
  bytepos = 1055
}
(gdb) next
10631     SET_MARKER_FROM_TEXT_POS (w->start, startp);
(gdb) 
10629   {
(gdb) 
10631     SET_MARKER_FROM_TEXT_POS (w->start, startp);
(gdb) 
10630     struct window *w = XWINDOW (window);
(gdb) 
10631     SET_MARKER_FROM_TEXT_POS (w->start, startp);
(gdb) 
10630     struct window *w = XWINDOW (window);
(gdb) 
10631     SET_MARKER_FROM_TEXT_POS (w->start, startp);
(gdb) 
10633     if (current_buffer != XBUFFER (w->buffer))
(gdb) 
10636     if (!NILP (Vwindow_scroll_functions))
(gdb) 
10629   {
(gdb) 
10938     if (!try_window (window, startp))
(gdb) 
10629   {
(gdb) 
10938     if (!try_window (window, startp))
(gdb) 
10940     else if (w->cursor.vpos < 0)




reply via email to

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