Why Core/NG

On ia64 there are registers called dirty stacked register. Dirty stacked registers are general registers that are marked dirty. Stacked registers are a subset of the general registers and are allocated on the register stack. A function call typically causes the register stack to grow upward, while a call return causes the stack to thrink. The processor updates the register stack asynchronously and lazily so as to avoid unnecessary memory accesses. This means that at any one time the processor may hold stacked registers that it still needs to write out to the register stack. These stacked registers are marked dirty because they cannot be reused without flushing them to memory first.

When a process enters the kernel, its memory and register stacks are switched to their corresponding kernel stacks. Any dirty stacked registers at the time of the kernel entry and belonging to the process are kept in the processor, but can eventually be flushed by the processor. These registers, when flushed, will end up on the kernel stack and not the process stack. When the kernel is exiting, stacked registers belonging to the process and flushed onto the kernel stack are loaded into the processor and the stacks will switch back to the process stacks.

When a core dump is to be created for a misbehaving or signalled process, the kernel will fetch the dirty stacked registers belonging to the process and flushed onto the kernel stack and write them to the process' register stack so that they end up in the core file. The core file then holds the state of the process at the time of the fault or signal, with the exception that the register stacks always appears flushed.

Now, what if there's a register stack overflow? How is the kernel to write the dirty stacked registers to the process' memory if that memory is exhausted? What if the backstore pointer is corrupted (the backingstore pointer is the register that tells where the next stacked register gets flushed to)?

Writing the dirty stacked registers onto the process' register stack is not always possible and it modifies the state of the process, which may make it impossible to discover the reason of the core dump. A better way is to store the dirty stacked registers somewhere else so that the memory dump remains pure.

So, where are the dirty stacked registers to be stored in a core file?

This is exactly what Core/NG is all about.

WhyCoreTheNextGen (last edited 2008-06-17 21:38:12 by localhost)