Re: Kernel 2.1.117 OOPS bug report

Linus Torvalds (torvalds@transmeta.com)
Thu, 20 Aug 1998 17:15:58 -0700 (PDT)


On Thu, 20 Aug 1998, rbarnett wrote:
>
> For kernel 2.1.117 at bootup time:
>
> Unable to handle kernel NULL pointer dereference at virtual address 00000f04

Hmm.. What compiler are you using? It doesn't seem to be the same as I
have, and this function _is_ kind of special in that __switch_to() uses
the special FASTCALL() semantics..

Judging by the offsets in your __switch_to(), it might be that the thing
that happens is that gcc doesn't do the proper fast-call thing for you.

> Code: c01088da <__switch_to+a/d0> 8b 43 04 movl 0x4(%ebx),%eax
> Code: c01088dd <__switch_to+d/d0> a9 00 00 10 00 testl $0x100000,%eax
> Code: c01088e2 <__switch_to+12/d0> 74 18 je c01088fc <__switch_to+2c/d0>
> Code: c01088e4 <__switch_to+14/d0> 25 ff ff ef ff andl $0xffefffff,%eax
> Code: c01088e9 <__switch_to+19/d0> 89 43 04 movl %eax,0x4(%ebx)
> Code: c01088ec <__switch_to+1c/d0> dd b3 00 90 90 fnsave 0x90909000(%ebx)

__switch_to _should_ disassemble to:

<__switch_to>: pushl %esi
<__switch_to+1>: pushl %ebx
<__switch_to+2>: movl %eax,%ebx
<__switch_to+4>: movl %edx,%ecx
<__switch_to+6>: movl 0x4(%ebx),%eax
<__switch_to+9>: testl $0x100000,%eax
<__switch_to+14>: je 0xc0108908 <__switch_to+40>
....

and your disassembly seems to indicate that yu have the offending "movl"
at offset 10 instead of offset 6. That would be explained by the compiler
for some reason compiling the function with the "normal" slow calling
convention.

So do a

gdb vmlinux
x/10i __switch_to

to see what your version of __switch_to() has been compiled as. If it
doesn't get the arguments from %eax and %edx, then you have a compiler
problem.

Linus

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html