all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Fabrice Popineau <fabrice.popineau@gmail.com>
To: Ken Brown <kbrown@cornell.edu>
Cc: 17622@debbugs.gnu.org, Katsumi Yamaoka <yamaoka@jpl.org>
Subject: bug#17622: 24.4.50; bootstrap failure
Date: Thu, 29 May 2014 14:55:38 +0200	[thread overview]
Message-ID: <CAFgFV9NSWDMhUnkq0Tn+S0euqr1W9r5hod-rTcz6T2n0wkQm-A@mail.gmail.com> (raw)
In-Reply-To: <53872A40.3020000@cornell.edu>

[-- Attachment #1: Type: text/plain, Size: 2632 bytes --]

Probably ok because I ran like this for a while,
but I wonder if it couldn't be handled at the beginning of
bufffer.c:init_buffer() instead.
What I suggest is do what mmap_set_vars(0) does
inside init_buffer() rather than reinstate mmap_set_vars().
Not a great advantage, except to clarify that these pointers should be
initialized
when starting the dumped emacs instead of relying on what is dumped.

Fabrice






2014-05-29 14:38 GMT+02:00 Ken Brown <kbrown@cornell.edu>:

> On 5/29/2014 12:56 AM, Katsumi Yamaoka wrote:
>
>> I verified simply reverting r117168 builds Emacs successfully on
>> Cygwin.
>>
>
> The removal of mmap_set_vars is what caused the problem.  The following
> patch fixes restores mmap_set_vars and fixes the problem.  Eli and Fabrice,
> is the w32 build still OK with this patch?
>
> === modified file 'src/buffer.c'
> --- src/buffer.c        2014-05-27 17:31:17 +0000
> +++ src/buffer.c        2014-05-29 12:23:53 +0000
> @@ -4855,6 +4855,38 @@
>  }
>
>
> +/* Set or reset variables holding references to mapped regions.
> +   If not RESTORE_P, set all variables to null.  If RESTORE_P, set all
> +   variables to the start of the user-areas of mapped regions.
> +
> +   This function is called from Fdump_emacs to ensure that the dumped
> +   Emacs doesn't contain references to memory that won't be mapped
> +   when Emacs starts.  */
> +
> +void
> +mmap_set_vars (bool restore_p)
> +{
> +  struct mmap_region *r;
> +
> +  if (restore_p)
> +    {
> +      mmap_regions = mmap_regions_1;
> +      mmap_fd = mmap_fd_1;
> +      for (r = mmap_regions; r; r = r->next)
> +       *r->var = MMAP_USER_AREA (r);
> +    }
> +  else
> +    {
> +      for (r = mmap_regions; r; r = r->next)
> +       *r->var = NULL;
> +      mmap_regions_1 = mmap_regions;
> +      mmap_regions = NULL;
> +      mmap_fd_1 = mmap_fd;
> +      mmap_fd = -1;
> +    }
> +}
> +
> +
>  /* Allocate a block of storage large enough to hold NBYTES bytes of
>     data.  A pointer to the data is returned in *VAR.  VAR is thus the
>     address of some variable which will use the data area.
>
> === modified file 'src/emacs.c'
> --- src/emacs.c 2014-05-27 17:31:17 +0000
> +++ src/emacs.c 2014-05-29 12:28:19 +0000
> @@ -2155,8 +2155,13 @@
>    malloc_state_ptr = malloc_get_state ();
>  #endif
>
> +#if defined USE_MMAP_FOR_BUFFERS && !defined WINDOWSNT
> +  mmap_set_vars (0);
> +#endif
>    unexec (SSDATA (filename), !NILP (symfile) ? SSDATA (symfile) : 0);
> -
> +#if defined USE_MMAP_FOR_BUFFERS && !defined WINDOWSNT
> +  mmap_set_vars (1);
> +#endif
>  #ifdef DOUG_LEA_MALLOC
>    free (malloc_state_ptr);
>  #endif
>
>
> Ken
>

[-- Attachment #2: Type: text/html, Size: 3581 bytes --]

  reply	other threads:[~2014-05-29 12:55 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-28 23:45 bug#17622: 24.4.50; bootstrap failure Katsumi Yamaoka
2014-05-29  2:02 ` Katsumi Yamaoka
2014-05-29  4:56   ` Katsumi Yamaoka
2014-05-29 12:38     ` Ken Brown
2014-05-29 12:55       ` Fabrice Popineau [this message]
2014-05-29 13:29         ` Ken Brown
2014-05-29 13:54         ` Fabrice Popineau
2014-05-29 14:17           ` Ken Brown
2014-05-29 14:24             ` Fabrice Popineau
2014-05-29 15:12               ` Eli Zaretskii
2014-05-29 16:44                 ` Fabrice Popineau
2014-05-29 22:52                   ` Katsumi Yamaoka
2014-05-29 15:09         ` Eli Zaretskii
2014-05-29 15:08       ` Eli Zaretskii
2014-05-29 14:59     ` 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

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

  git send-email \
    --in-reply-to=CAFgFV9NSWDMhUnkq0Tn+S0euqr1W9r5hod-rTcz6T2n0wkQm-A@mail.gmail.com \
    --to=fabrice.popineau@gmail.com \
    --cc=17622@debbugs.gnu.org \
    --cc=kbrown@cornell.edu \
    --cc=yamaoka@jpl.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.