RE: Oops with tip/x86/fpu

Yu, Fenghua
2015-03-26T22:37:09Z

> From: Oleg Nesterov [mailto:oleg@redhat.com]
> Sent: Thursday, March 05, 2015 10:22 AM
>
> On 03/05, Oleg Nesterov wrote:
> >
>
> Does it trigger something else on your machine?
>
> Oleg.
>
> #include <stdio.h>
> #include <signal.h>
> #include <unistd.h>
> #include <ucontext.h>
>
> void sighup(int sig, siginfo_t *info, void *ctxt) {
> struct ucontext *uctxt = ctxt;
> struct sigcontext *sctxt = (void*)&uctxt->uc_mcontext;
>
> printf("SIGHUP! %p\n", sctxt->fpstate);
> sctxt->fpstate = (void *)1;

sctxt->fpstate=(void *)1 changes the fpstate pointer in the sigcontext. It will generate segfault and bad frame info in kernel.

This is expected behavior, right? Is this still a valid test?

Thanks.

-Fenghua