unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Richard Stallman <rms@gnu.org>
To: emacs-devel@gnu.org
Cc: Jason Rumney <jasonr@gnu.org>
Subject: Re: [lekktu@gmail.com: Re: Crash when having malformed PBM image on screen and viewing *Messages* buffer (on Windows)]
Date: Wed, 25 Jul 2007 16:12:03 -0400	[thread overview]
Message-ID: <E1IDnDH-0003kg-UB@fencepost.gnu.org> (raw)
In-Reply-To: <46A72CB4.40701@gnu.org> (message from Jason Rumney on Wed, 25 Jul 2007 11:57:56 +0100)

Thanks for repeating the added info.  Would someone please debug this
on GNU/Linux, then DTRT and ack?

X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=failed 
	version=3.1.0
Date: Wed, 25 Jul 2007 11:57:56 +0100
From: Jason Rumney <jasonr@gnu.org>
MIME-Version: 1.0
To: rms@gnu.org
Cc: emacs-devel@gnu.org
Subject: Re: [lekktu@gmail.com: Re: Crash when having malformed PBM image
 on screen and viewing *Messages* buffer (on Windows)]
In-Reply-To: <E1ID2Iv-00087H-OW@fencepost.gnu.org>
Content-Type: text/plain; charset=ISO-8859-15

Richard Stallman wrote:
> [I sent this message month ago but did not get a response.]
>
> Would someone please investigate this, then ack?
>   

As I said in the original thread about this bug, the problem can be
reproduced on GNU/Linux.  The recipe to reproduce it is:

	- start emacs -Q
	- run this in *scratch* buffer

	(progn
	  (put-image '(image :type pbm :data "") 0)
	  (pop-to-buffer "*Messages*")
	  (goto-char (point-max)))

	Now press <down> <right> <down> <right>.


The problem seems to be some mixup between the *scratch* buffer and the
*Messages* buffer during redisplay.  The crash occurs during redisplay
of the window containing the *scratch* buffer, near the end of
redisplay_window.

  /* Restore current_buffer and value of point in it.  */
  TEMP_SET_PT_BOTH (CHARPOS (opoint), BYTEPOS (opoint));
  set_buffer_internal_1 (old);
  TEMP_SET_PT_BOTH (CHARPOS (lpoint), BYTEPOS (lpoint));

opoint is 193, which is the value of zv in the *scratch* buffer. But
lpoint is 386, which I think may be the length of the *Messages* buffer
at some point in the redisplay cycle (multiple messages are output
during redisplay).  Setting breakpoints in message_dolog seems to
prevent the bug from appearing, so it is difficult to tell for sure. 
The only code that changes lpoint is on line 13062 of xdisp.c, and
should only be run if the window being redisplayed is the selected
window, and the current_buffer has not changed.  But AFAICT, the
selected_window should be the *Messages* buffer's window at this point,
while we are redisplaying the *scratch* buffer, so the bug is probably
to do with something changing selected_window somewhere before this point.


The sequence of events I have figured out so far is:

1. Pressing right arrow when at the end of the *Messages* buffer causes
a message "call interactively: End of buffer" to be displayed.

2. This triggers redisplay, during which Emacs attempts to display the
broken image again.

3. Attempting to display the broken image results in a message: "Not a
PBM image: `(image :type pbm :data )'".

4. When Emacs does not crash, the above message is (sometimes?) printed
twice, the first such message appears on the same line as the "End of
buffer" message.

5. Point in the *Messages* buffer ends up after the "End of buffer"
message, but before the "Not a PBM image" messages. There is code in
message_dolog to keep point at the end of the buffer if it was there
before. The fact that this goes wrong may be related to the bug we are
investigating.

  reply	other threads:[~2007-07-25 20:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-23 18:06 [lekktu@gmail.com: Re: Crash when having malformed PBM image on screen and viewing *Messages* buffer (on Windows)] Richard Stallman
2007-07-25 10:57 ` Jason Rumney
2007-07-25 20:12   ` Richard Stallman [this message]
2007-08-06 17:23     ` Chong Yidong
  -- strict thread matches above, loose matches on Subject: below --
2007-06-17 21:49 Richard Stallman

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=E1IDnDH-0003kg-UB@fencepost.gnu.org \
    --to=rms@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=jasonr@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).