Re: [PATCH] Sometimes, there is OOPS happened when we use oprofile.

From: Robert Richter
Date: Wed Oct 31 2012 - 18:45:19 EST


On 31.10.12 14:33:17, H. Peter Anvin wrote:
> I'm vaguely concerned about the following:
>
> + * To always return a non-null
> + * stack pointer we fall back to regs as stack if no previous stack
> + * exists.
>
> The logic being that if there is no stack pointer and the stack is
> too empty, to simply assume regs point to the top of the stack? Is
> this possible to ever be actually seen?

I discussed this with Steven too (https://lkml.org/lkml/2012/9/6/322)
and we both had a bad feeling with returning a null pointer by
kernel_stack_pointer() (implemented in version 1 of this patch). It
could be null if tinfo->previous_esp is null (last stack). Not sure
when this may happen.

So using regs as fallback seemed to be ok as this was in for years:

7b6c6c7 x86, 32-bit: fix kernel_trap_sp()

-Robert
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/