unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: dhruva <dhruvakm@gmail.com>
To: "Eli Zaretskii" <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: Emacs (HEAD) crash on M$ (XP) built with MinGW
Date: Tue, 21 Oct 2008 11:28:02 +0530	[thread overview]
Message-ID: <e3f230850810202258q50f8fe4anab35c27d03546183@mail.gmail.com> (raw)
In-Reply-To: <e3f230850810202240t4ed574c1y76d942411bf02e3c@mail.gmail.com>

Hi,
This seems better, the compiler does not warn. Should we add some
logging to help debugging here. Since I have absolutely no idea about
display engine, I am not sure what information could help developers
debug this issue. My changes silently swallow the problem through
defensive programming without finding the root cause. This patch
positively fixes the crash though!

diff --git a/src/xdisp.c b/src/xdisp.c
index 47ba85f..2b1b306 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -6240,6 +6240,12 @@ next_element_from_string (it)
 {
   struct text_pos position;

+  /* if string is 0/NULL, nothing much we can do */
+  if (!(it->string))
+    {
+      return 0;
+    }
+
   xassert (STRINGP (it->string));
   xassert (IT_STRING_CHARPOS (*it) >= 0);
   position = it->current.string_pos;

-dhruva

On Tue, Oct 21, 2008 at 11:10 AM, dhruva <dhruvakm@gmail.com> wrote:
> Hi,
>  I am now able to reproduce (on M$).
> 1. run emacs with default frame
> 2. Open a file with font-lock (some mid sized 'C' file)
> 3. Maximize the frame
> 4. scroll down using arrow with the cursor in the 1st column
> 5. On reaching the last line in the visible frame (not file), the crash happens
>
> The following patch fixes this crash (but I do not know why it is NULL):
>
> diff --git a/src/xdisp.c b/src/xdisp.c
> index 47ba85f..f9d34c8 100644
> --- a/src/xdisp.c
> +++ b/src/xdisp.c
> @@ -6240,6 +6240,12 @@ next_element_from_string (it)
>  {
>   struct text_pos position;
>
> +  /* if string is NULL, nothing much we can do */
> +  if (NULL == it->string)
> +    {
> +      return 0;
> +    }
> +
>   xassert (STRINGP (it->string));
>   xassert (IT_STRING_CHARPOS (*it) >= 0);
>   position = it->current.string_pos;
>
> -dhruva
>
> On Tue, Oct 21, 2008 at 9:12 AM, dhruva <dhruvakm@gmail.com> wrote:
>> Hello,
>>
>> On Mon, Oct 20, 2008 at 8:11 PM, Eli Zaretskii <eliz@gnu.org> wrote:
>>>> Date: Mon, 20 Oct 2008 18:08:15 +0530
>>>> From: dhruva <dhruvakm@gmail.com>
>>>>
>>>>  I am still seeing the elusive and infrequent crash. I open a 'C'
>>>> file, maximize the frame and use the page down to scroll down or down
>>>> arrow. I keep hitting this crash off and now. The tried getting 'xbt'
>>>> and could not.


-- 
Contents reflect my personal views only!




  reply	other threads:[~2008-10-21  5:58 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-20 12:38 Emacs (HEAD) crash on M$ (XP) built with MinGW dhruva
2008-10-20 14:41 ` Eli Zaretskii
2008-10-21  3:42   ` dhruva
2008-10-21  5:40     ` dhruva
2008-10-21  5:58       ` dhruva [this message]
2008-10-21  6:38       ` Eli Zaretskii
2008-10-21  6:41       ` Eli Zaretskii
2008-10-21  7:11         ` dhruva
2008-10-21  7:41           ` Juanma Barranquero
2008-10-21  7:55             ` dhruva
2008-10-21  8:03               ` Juanma Barranquero
2008-10-21  8:30               ` Eli Zaretskii
2008-10-25 16:51                 ` dhruva
2008-10-25 16:56                   ` dhruva
2008-10-27  4:30                     ` dhruva
2008-10-27 20:09                       ` Eli Zaretskii
2008-10-28  4:00                         ` dhruva
2008-10-28  8:20                       ` Juanma Barranquero
2008-10-28 18:42                         ` Eli Zaretskii
2008-10-29  2:28                           ` Stephen J. Turnbull
2008-10-29  6:39                             ` Werner LEMBERG

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e3f230850810202258q50f8fe4anab35c27d03546183@mail.gmail.com \
    --to=dhruvakm@gmail.com \
    --cc=eliz@gnu.org \
    --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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).