From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#50453: 27.2; Portable dumper broken on MSW Date: Sat, 11 Sep 2021 09:47:15 +0300 Message-ID: <83tuirhamk.fsf@gnu.org> References: <871r60v9i0.fsf.ref@yahoo.com> <871r60v9i0.fsf@yahoo.com> <83eea0pkdz.fsf@gnu.org> <87y287nsz5.fsf@yahoo.com> <83pmtjmc6e.fsf@gnu.org> <87bl52npea.fsf@yahoo.com> <87sfyem17q.fsf@yahoo.com> <8335qekllx.fsf@gnu.org> <87bl51ncq6.fsf@yahoo.com> <874katnc2h.fsf@yahoo.com> <83v939k91y.fsf@gnu.org> <87bl51tfv4.fsf@yahoo.com> <83k0joipyg.fsf@gnu.org> <87mtojlszb.fsf@yahoo.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13145"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 50453@debbugs.gnu.org To: Po Lu , Daniel Colascione Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Sep 11 08:48:10 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mOwo6-0003FK-3j for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 11 Sep 2021 08:48:10 +0200 Original-Received: from localhost ([::1]:51168 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mOwo4-00046g-GO for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 11 Sep 2021 02:48:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35384) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mOwny-00046S-KV for bug-gnu-emacs@gnu.org; Sat, 11 Sep 2021 02:48:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56150) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mOwny-0003Pl-Cv for bug-gnu-emacs@gnu.org; Sat, 11 Sep 2021 02:48:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mOwny-000668-6k for bug-gnu-emacs@gnu.org; Sat, 11 Sep 2021 02:48:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 11 Sep 2021 06:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50453 X-GNU-PR-Package: emacs Original-Received: via spool by 50453-submit@debbugs.gnu.org id=B50453.163134285423405 (code B ref 50453); Sat, 11 Sep 2021 06:48:02 +0000 Original-Received: (at 50453) by debbugs.gnu.org; 11 Sep 2021 06:47:34 +0000 Original-Received: from localhost ([127.0.0.1]:39463 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mOwnW-00065R-88 for submit@debbugs.gnu.org; Sat, 11 Sep 2021 02:47:34 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:46506) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mOwnV-00065D-8W for 50453@debbugs.gnu.org; Sat, 11 Sep 2021 02:47:33 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:56132) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mOwnP-0002sg-5h; Sat, 11 Sep 2021 02:47:27 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1292 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mOwnO-0006HJ-Pk; Sat, 11 Sep 2021 02:47:27 -0400 In-Reply-To: <87mtojlszb.fsf@yahoo.com> (message from Po Lu on Sat, 11 Sep 2021 10:57:12 +0800) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:214045 Archived-At: > From: Po Lu > Cc: 50453@debbugs.gnu.org > Date: Sat, 11 Sep 2021 10:57:12 +0800 > > Eli Zaretskii 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);