unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Po Lu <luangruo@yahoo.com>, Daniel Colascione <dancol@dancol.org>
Cc: 50453@debbugs.gnu.org
Subject: bug#50453: 27.2; Portable dumper broken on MSW
Date: Sat, 11 Sep 2021 09:47:15 +0300	[thread overview]
Message-ID: <83tuirhamk.fsf@gnu.org> (raw)
In-Reply-To: <87mtojlszb.fsf@yahoo.com> (message from Po Lu on Sat, 11 Sep 2021 10:57:12 +0800)

> From: Po Lu <luangruo@yahoo.com>
> Cc: 50453@debbugs.gnu.org
> Date: Sat, 11 Sep 2021 10:57:12 +0800
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > Please try the patch below.
> 
> Thanks.  Emacs correctly loads the dump file with that patch in place.

Great, thanks for testing.

Daniel, any comments to that patch (copied below for your
convenience)?

And while at that, can you tell why we request
DUMP_MEMORY_ACCESS_READWRITE and not DUMP_MEMORY_ACCESS_READ when
loading from the pdumper file?  Do we expect the need to change values
loaded from the file?

Here's the patch I was talking about, it is needed for supporting
FILE_MAP_COPY flag in the MapViewOfFileEx call on Windows 9X:

diff --git a/src/pdumper.c b/src/pdumper.c
index 7730ea3..2291fce 100644
--- a/src/pdumper.c
+++ b/src/pdumper.c
@@ -4537,15 +4537,28 @@ dump_map_file_w32 (void *base, int fd, off_t offset, size_t size,
   uint32_t offset_low = (uint32_t) (full_offset & 0xffffffff);
 
   int error;
+  DWORD protect;
   DWORD map_access;
 
   file = (HANDLE) _get_osfhandle (fd);
   if (file == INVALID_HANDLE_VALUE)
     goto out;
 
+  switch (protection)
+    {
+    case DUMP_MEMORY_ACCESS_READWRITE:
+      protect = PAGE_WRITECOPY;	/* for Windows 9X */
+      break;
+    default:
+    case DUMP_MEMORY_ACCESS_NONE:
+    case DUMP_MEMORY_ACCESS_READ:
+      protect = PAGE_READONLY;
+      break;
+    }
+
   section = CreateFileMapping (file,
 			       /*lpAttributes=*/NULL,
-			       PAGE_READONLY,
+			       protect,
 			       /*dwMaximumSizeHigh=*/0,
 			       /*dwMaximumSizeLow=*/0,
 			       /*lpName=*/NULL);





  reply	other threads:[~2021-09-11  6:47 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <871r60v9i0.fsf.ref@yahoo.com>
2021-09-07 12:46 ` bug#50453: 27.2; Portable dumper broken on MSW Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-07 13:47   ` Eli Zaretskii
2021-09-08 12:37     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-08 13:25       ` Eli Zaretskii
2021-09-09  8:07         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-09 11:34           ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-09 11:57             ` Eli Zaretskii
2021-09-09 12:40               ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-09 12:55                 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-09 16:28                   ` Eli Zaretskii
2021-09-10  0:48                     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-10 12:18                       ` Eli Zaretskii
2021-09-11  2:57                         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-11  6:47                           ` Eli Zaretskii [this message]
2022-08-25 14:24                             ` Lars Ingebrigtsen
2022-08-25 14:47                               ` Gerd Möllmann
2022-08-26  2:37                                 ` Daniel Colascione
2022-08-26 10:43                                   ` Lars Ingebrigtsen
2022-08-26  1:05                               ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-26  6:00                                 ` Eli Zaretskii
2022-08-26  7:40                                   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-26 10:39                                     ` Eli Zaretskii
2021-09-09 16:24                 ` Eli Zaretskii
2021-09-10  0:51                   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-09 11:58           ` 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=83tuirhamk.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=50453@debbugs.gnu.org \
    --cc=dancol@dancol.org \
    --cc=luangruo@yahoo.com \
    /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).