Re: crash in entry.S restore_all, 2.6.12-rc2, x86, PAGEALLOC

Ingo Molnar
2005-04-05T20:58:53Z

* Linus Torvalds <torvalds@osdl.org> wrote:

> > > So I'd actually prefer to get that mystery explained..
> > IIRC if the interrupt doesn't do the CPL
> > switch, the interrupt gate doesn't save
> > the stack, and so there may not be the
> > full "struct pt_regs" when the kernel
> > thread is interrupted.
>
> Yes. But how do you have _such_ an empty stack when the interrupt
> comes in? See what I mean? IOW, that requires that the kernel stack
> would have only two words on it when the interrupt happens. How?
>
> It may be a 4kB stack issue or something. Does this happen only with
> CONFIG_4KSTACKS, and just after a stack switch to an irq stack, for
> example?

i didnt have 4K stacks set. In all crashes, esp had the same pattern:

esi: 009b63f9 edi: 00000001 ebp: f543a000 esp: f543bfc8

i.e. esp & 0xfff was 0xfc8 - while i think it should normally be 0xfc4
(page boundary minus size of pt_regs == 0 - 0x3c == 0xfc4). So somewhere
we lost 4 bytes of esp? An extra popl, or an addl $4, %esp? But why dont
we crash in that case - it ought to shift all the pt_regs structure by a
word, making it a completely senseless return frame. Any task in such a
situation ought to at least segfault. So if this is during thread
startup, i dont know how it survives the first execution.

Ingo