GNU bug report logs - #50453
27.2; Portable dumper broken on MSW

Previous Next

Package: emacs;

Reported by: Po Lu <luangruo <at> yahoo.com>

Date: Tue, 7 Sep 2021 12:47:02 UTC

Severity: normal

Tags: moreinfo

Found in version 27.2

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Po Lu <luangruo <at> yahoo.com>, Daniel Colascione <dancol <at> dancol.org>
Cc: 50453 <at> debbugs.gnu.org
Subject: bug#50453: 27.2; Portable dumper broken on MSW
Date: Sat, 11 Sep 2021 09:47:15 +0300
> From: Po Lu <luangruo <at> yahoo.com>
> Cc: 50453 <at> debbugs.gnu.org
> Date: Sat, 11 Sep 2021 10:57:12 +0800
> 
> Eli Zaretskii <eliz <at> 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);




This bug report was last modified 2 years and 331 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.