[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 64bit startup

From: Sergey Bugaev
Subject: Re: 64bit startup
Date: Fri, 26 May 2023 22:10:18 +0300

On Fri, May 26, 2023 at 7:22 PM Samuel Thibault <samuel.thibault@gnu.org> wrote:
> I.e. gnumach without optimizations gets things wrong. We do want to fix
> that :)

Dumping what I've been able to debug (so far):

The crash indeed happens when loading the executable image, inside
copyout (). The addresses/sizes are all fine, that's a false lead.

What's apparently important here is that it's copying to the memory
just vm_allocated inside the task's own map, and as always the page
gets mapped lazily, on first access.

The -O2 version attempts to access the page and lands in t_page_fault,
which calls through kernel_trap to the VM subsystem, finds a free
physical page, maps it in, irets back, and everything works out fine.
The -O0 version for some reason lands in a_dbl_fault, and then
proceeds to crash.

This is probably the first time a page fault happens / is supposed to
happen during execution. So it's probably unrelated to ELF loading and
related to the VM subsystem and/or interrupt handling.

The relevant parts of the code (copyout, interrupt/exception/trap
handlers) are all written in assembly and so cannot be impacted by C
optimization level.

I don't know/understand enough about how interrupts work and x86
hardware details to make anything out of this.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]