From: Eli Zaretskii <eliz@gnu.org>
To: Po Lu <luangruo@yahoo.com>
Cc: 50453@debbugs.gnu.org
Subject: bug#50453: 27.2; Portable dumper broken on MSW
Date: Fri, 10 Sep 2021 15:18:31 +0300 [thread overview]
Message-ID: <83k0joipyg.fsf@gnu.org> (raw)
In-Reply-To: <87bl51tfv4.fsf@yahoo.com> (message from Po Lu on Fri, 10 Sep 2021 08:48:47 +0800)
> From: Po Lu <luangruo@yahoo.com>
> Cc: 50453@debbugs.gnu.org
> Date: Fri, 10 Sep 2021 08:48:47 +0800
>
> Eli Zaretskii <eliz@gnu.org> writes:
>
> > How did you try that? Did you rebuild Emacs? If so, I would like you
> > to try a different change first, before we decide to give up on the
> > memory-mapped file approach.
>
> Yes, I rebuilt Emacs. I would be glad to test another change, thanks!
Please try the patch below.
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);
next prev parent reply other threads:[~2021-09-10 12:18 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 [this message]
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
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=83k0joipyg.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=50453@debbugs.gnu.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).