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

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

Re: Crashes in init_from_display_pos


From: Kim F. Storm
Subject: Re: Crashes in init_from_display_pos
Date: Thu, 24 Feb 2005 22:55:01 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Juri Linkov <address@hidden> writes:

> I have reproducible crashes while scrolling the Gnus *Article*
> buffer with partially visible inline images.
>
> Below is a brief debug session.  Since these crashes are easily
> reproducible, I can provide more debug info on a request.


Does this patch give good results ?


*** xdisp.c     22 Feb 2005 12:00:11 +0100      1.984
--- xdisp.c     24 Feb 2005 22:35:09 +0100      
***************
*** 2538,2544 ****
       after-string.  */
    init_iterator (it, w, charpos, bytepos, NULL, DEFAULT_FACE_ID);
  
!   for (i = 0; i < it->n_overlay_strings; ++i)
      {
        const char *s = SDATA (it->overlay_strings[i]);
        const char *e = s + SBYTES (it->overlay_strings[i]);
--- 2540,2546 ----
       after-string.  */
    init_iterator (it, w, charpos, bytepos, NULL, DEFAULT_FACE_ID);
  
!   for (i = 0; i < it->n_overlay_strings && i < OVERLAY_STRING_CHUNK_SIZE; ++i)
      {
        const char *s = SDATA (it->overlay_strings[i]);
        const char *e = s + SBYTES (it->overlay_strings[i]);



Still, it is suspicious that this loop will only check a maximum of
OVERLAY_STRING_CHUNK_SIZE overlays.

Currently OVERLAY_STRING_CHUNK_SIZE is 3, but since this trap hasn't
been reported before (IIRC), it seems that using more than 3 overlay
strings is very rare.

Increasing OVERLAY_STRING_CHUNK_SIZE can be done a practically no
cost, so I suggest that we increase it to 16, which will be enough
to cover all practical cases, and thus also make it handle the
present case.

So I suggest the following additional patch:

*** dispextern.h        21 Feb 2005 23:11:23 +0100      1.196
--- dispextern.h        24 Feb 2005 22:41:11 +0100      
***************
*** 1887,1893 ****
  
    /* Vector of overlays to process.  Overlay strings are processed
       OVERLAY_STRING_CHUNK_SIZE at a time.  */
! #define OVERLAY_STRING_CHUNK_SIZE 3
    Lisp_Object overlay_strings[OVERLAY_STRING_CHUNK_SIZE];
  
    /* Total number of overlay strings to process.  This can be >
--- 1887,1893 ----
  
    /* Vector of overlays to process.  Overlay strings are processed
       OVERLAY_STRING_CHUNK_SIZE at a time.  */
! #define OVERLAY_STRING_CHUNK_SIZE 16
    Lisp_Object overlay_strings[OVERLAY_STRING_CHUNK_SIZE];
  
    /* Total number of overlay strings to process.  This can be >




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





reply via email to

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