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

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





  reply	other threads:[~2014-05-29 12:38 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 [this message]
2014-05-29 12:55       ` Fabrice Popineau
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=53872A40.3020000@cornell.edu \
    --to=kbrown@cornell.edu \
    --cc=17622@debbugs.gnu.org \
    --cc=fabrice.popineau@gmail.com \
    --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.