[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: MPS codegen
From: |
Gerd Möllmann |
Subject: |
Re: MPS codegen |
Date: |
Sat, 15 Jun 2024 09:10:42 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Eli Zaretskii <eliz@gnu.org> writes:
>> From: Gerd Möllmann <gerd.moellmann@gmail.com>
>> Cc: Eli Zaretskii <eliz@gnu.org>, acorallo@gnu.org, emacs-devel@gnu.org
>> Date: Fri, 14 Jun 2024 21:50:26 +0200
>>
>> Helmut Eller <eller.helmut@gmail.com> 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?
I'd rather if you comment out the discard_dump in igc.c, in mirror_dump
and see if that's the problem. The GDB output you showed give me no hint
to it. The fwd causing the problem should point to Emacs' data segment,
not the dump. The variable is a DEFVAR_BOOL.
> 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?
It's the hot section that igc discards. The pdumper can only discard the
relocs which are not longer needed once they have been processed. The
theory is that it's no longer needed since we have made a copy.
- Re: MPS codegen, (continued)
- Re: MPS codegen, Helmut Eller, 2024/06/14
- Re: MPS codegen, Eli Zaretskii, 2024/06/14
- Re: MPS codegen, Eli Zaretskii, 2024/06/14
- Re: MPS codegen, Helmut Eller, 2024/06/14
- Re: MPS codegen, Gerd Möllmann, 2024/06/14
- Re: MPS codegen, Eli Zaretskii, 2024/06/15
- Re: MPS codegen,
Gerd Möllmann <=
- Re: MPS codegen, Eli Zaretskii, 2024/06/15
- Re: MPS codegen, Gerd Möllmann, 2024/06/15
- Re: MPS codegen, Eli Zaretskii, 2024/06/15
- Re: MPS codegen, Gerd Möllmann, 2024/06/15
- Re: MPS codegen, Eli Zaretskii, 2024/06/15
- Re: MPS codegen, Gerd Möllmann, 2024/06/15
- Re: MPS codegen, Gerd Möllmann, 2024/06/15
- Re: MPS codegen, Helmut Eller, 2024/06/15
- Re: MPS codegen, Gerd Möllmann, 2024/06/15
- Re: MPS codegen, Helmut Eller, 2024/06/15