all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Dmitry Antipov <dmantipov@yandex.ru>
Cc: emacs-devel@gnu.org
Subject: Re: RFC on proposal fix [Re: Crash caused by insert-file-contents, both trunk (bzr 111532) and 24.2.92 affected]
Date: Fri, 18 Jan 2013 21:34:26 +0200	[thread overview]
Message-ID: <83pq125lq5.fsf@gnu.org> (raw)
In-Reply-To: <50F83F08.1060709@yandex.ru>

> Date: Thu, 17 Jan 2013 22:12:24 +0400
> From: Dmitry Antipov <dmantipov@yandex.ru>
> Cc: emacs-devel@gnu.org
> 
> On 01/17/2013 09:50 PM, Eli Zaretskii wrote:
> 
> > Can you tell which problems you found in the original code that these
> > changes are supposed to fix?
> 
> 1) Original code do emacs_read to ((char *) BEG_ADDR + PT_BYTE - BEG_BYTE + offset
>     without adjusting gap size, z and zv; this (IIUC) fools make_gap and so
>     enlarge_buffer_text; we end up with the gap which is less than expected,
>     read_non_regular do emacs_read into the buffer beyond allocated buffer text,
>     which finally causes EFAULT from emacs_read or heap corruption.

I'm not sure I see how the gap size fails to be updated.  There's a
call to make_gap just before read_non_regular is called.  Or did you
mean GAP_SIZE?  If the latter, then the comments there explain why
this is not done.

> 2) Original code throws I/O error too early without decoding the data possibly
>     read before. When not-yet-decoded part of buffer text is displayed, redisplay
>     is likely to crash.

But until GAP_SIZE and ZV are updated, the inserted text is not
really part of the buffer, right?  So what is the problem here?



  parent reply	other threads:[~2013-01-18 19:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-15 10:26 Crash caused by insert-file-contents, both trunk (bzr 111532) and 24.2.92 affected Dmitry Antipov
2013-01-15 17:03 ` Eli Zaretskii
2013-01-15 17:37   ` Dmitry Antipov
2013-01-15 18:19     ` Eli Zaretskii
2013-01-17 17:12       ` RFC on proposal fix [Re: Crash caused by insert-file-contents, both trunk (bzr 111532) and 24.2.92 affected] Dmitry Antipov
2013-01-17 17:50         ` Eli Zaretskii
2013-01-17 18:12           ` Dmitry Antipov
2013-01-18  5:11             ` Dmitry Antipov
2013-01-18 19:34             ` Eli Zaretskii [this message]
2013-01-21  8:55               ` 24.2.92 " Dmitry Antipov
2013-01-22  1:54                 ` Glenn Morris
2013-01-22  4:48                   ` Dmitry Antipov
2013-01-22  7:16                     ` Stefan Monnier

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=83pq125lq5.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=dmantipov@yandex.ru \
    --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.