unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Rich Felker <dalias@libc.org>
Cc: emacs-devel@gnu.org
Subject: Re: Dumper issue, revisited; invalid realloc/free
Date: Wed, 04 Feb 2015 21:08:00 +0200	[thread overview]
Message-ID: <83pp9pfqb3.fsf@gnu.org> (raw)
In-Reply-To: <20150204175709.GX23507@brightrain.aerifal.cx>

> Date: Wed, 4 Feb 2015 12:57:09 -0500
> From: Rich Felker <dalias@libc.org>
> 
> The simplest solution I can find is to make the affected free
> functions (xrealloc, xfree, lisp_free, and lisp_align_free) check
> whether their argument is in the range of data_start...initial_brk and
> act as a nop (or in the case of xrealloc, allocate a new object
> without freeing the old one) when this is the case. The check is
> easily accomplished by saving initial_brk=sbrk(0) at startup (to be
> lazy I did this with attribute((constructor)) but other approaches
> might be preferred for an upstream fix. For xrealloc, since the old
> size is not known, I simply estimate it as initial_brk-block. Copying
> up to the min or this value and the new size should be safe, anyway.
> 
> Does this sound acceptable for upstream?

Yes.  Several platforms (Cygwin and MinGW on MS-Windows) already do
exactly that.



  reply	other threads:[~2015-02-04 19:08 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-04 17:57 Dumper issue, revisited; invalid realloc/free Rich Felker
2015-02-04 19:08 ` Eli Zaretskii [this message]
2015-02-04 19:13   ` Rich Felker
2015-02-04 19:22     ` Eli Zaretskii
2015-02-04 19:26     ` Eli Zaretskii
2015-02-04 20:34       ` Ken Brown
2015-02-05  1:31         ` Rich Felker
2015-02-05  3:25           ` Rich Felker
2015-02-05  3:48             ` Eli Zaretskii
2015-02-05  4:33               ` Rich Felker
2015-02-05 16:14                 ` Wolfgang Jenkner
2015-02-05 18:43                   ` Rich Felker
2015-02-04 19:21 ` Eli Zaretskii
2015-02-04 19:37   ` Rich Felker
2015-02-04 19:44     ` Eli Zaretskii
2015-02-04 19:49       ` Rich Felker
2015-02-04 19:54         ` Eli Zaretskii
2015-02-04 20:02           ` Rich Felker
2015-02-04 20:36             ` Eli Zaretskii
2015-02-04 20:08       ` Rich Felker
2015-02-04 20:40         ` Eli Zaretskii
2015-02-04 22:17           ` Rich Felker
2015-02-05  3:42             ` Eli Zaretskii

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=83pp9pfqb3.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=dalias@libc.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).