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.devel Subject: Re: MPS codegen Date: Sat, 15 Jun 2024 09:26:15 +0300 Message-ID: <86o782wwl4.fsf@gnu.org> References: <87le3b43qi.fsf@gmail.com> <86r0d21tqj.fsf@gnu.org> <877cetgqiz.fsf_-_@gmail.com> <87wmmsg2e4.fsf@gmail.com> <878qz8ezn4.fsf@gmail.com> <8734pfgb51.fsf@gmail.com> <86ikybyd2h.fsf@gnu.org> <87v82bebc6.fsf@gmail.com> <86wmmrwf86.fsf@gnu.org> <86r0czwdmc.fsf@gnu.org> <87jzire36a.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12275"; mail-complaints-to="usenet@ciao.gmane.io" Cc: eller.helmut@gmail.com, acorallo@gnu.org, emacs-devel@gnu.org To: Gerd =?iso-8859-1?Q?M=F6llmann?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Jun 15 08:27:08 2024 Return-path: Envelope-to: ged-emacs-devel@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 1sIMsW-0002wl-6x for ged-emacs-devel@m.gmane-mx.org; Sat, 15 Jun 2024 08:27:08 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sIMrp-0005qJ-57; Sat, 15 Jun 2024 02:26:25 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sIMrn-0005oa-RU for emacs-devel@gnu.org; Sat, 15 Jun 2024 02:26:23 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sIMrn-00008C-Fy; Sat, 15 Jun 2024 02:26:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=nvRKF2evzmdzStFRyu+MFddwCGq+vAYMG/DBZCOJ5fU=; b=mXmjKLPJRqK1ylOtMCE3 ogpriS1sBZx9jcvgNRXQv1dIYigFPtQZ8xYHAuK8UZTxuxxbt3gpJXANLVKUcK7yRKLX0d/4bAmye /FIg+b7ysgKCRNnRO2he+CzbAVZvpBG5JeD5Iz/qGlMJxqWKawcpHrjBPNJ0sL3uaD1bJK9dt6EvV kUI4b7fhrg6zZhKecTWTi+OpCjI5EnJSkdFLTXWfG7BqGTQaOWtCjhFxwGWGT3WVyszzE7AdGw1wU w2+IGA7fuu+R4fy7LLWy67gohtnM1kuE2Fj0Uj2vVYsg1++RR0Jl5OGA1sdE4CF7a434D8eqAHbIR V1IN+4Pjm3+AVQ==; In-Reply-To: (message from Gerd =?iso-8859-1?Q?M=F6llmann?= on Fri, 14 Jun 2024 21:50:26 +0200) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:320099 Archived-At: > From: Gerd Möllmann > Cc: Eli Zaretskii , acorallo@gnu.org, emacs-devel@gnu.org > Date: Fri, 14 Jun 2024 21:50:26 +0200 > > Helmut Eller writes: > > > My hypothesis is that discard_dump is the problem. The hot section > > probably contains something that isn't properly copied and > > dump_discard_mem seems to be a bit different on Windows. Why it even > > works on Linux is a mystery to me :-). > > Pdumper can use, among other methods, mmap'd files. In that case > munmap'ing could write changes back to disk. So pdumper rather marks the > region as not needed. At least that's how I understand it. But it doesn't protect the region from being accessed, AFAIU. By contrast, on MS-Windows we do this: (void) VirtualProtect (mem, size, PAGE_NOACCESS, &old_prot); which will then cause an access violation if any address within the region is accessed in any way (read or write). If you do the same with mmap and PROT_NONE, does the build still work and does the built Emacs succeed to start? Note that originally pdumper.c called dump_discard_mem only for sections considered discardable: sections[DS_DISCARDABLE].spec = (struct dump_memory_map_spec) { .fd = dump_fd, .size = header->cold_start - adj_discardable_start, .offset = adj_discardable_start, .protection = DUMP_MEMORY_ACCESS_READWRITE, }; [...] dump_mmap_discard_contents (§ions[DS_DISCARDABLE]); Whereas the code in igc.c seems to discard all of the memory loaded from the pdumper file, or am I missing something?