I set the SA_SIGINFO
flags to handle the signal.When I use gdb to check the argument.I found info
point to 0x7fffffffd2b0
and context
point to 0x7fffffffd180
. I kown the true type of argument context
is ucontext_t
.Strangely, the space 0x7fffffffd2b0 - 0x7fffffffd180 == 0x130
is much less then sizeof(ucontext_t) == 0x3c8
.So the memory which argument context
points to can not be a complete ucontext_t
structure. Why this happened? Am I miss something?
void recvSignal(int sig, siginfo_t* info, void* context)
{
int a = 0x12345678;
printf("received signal %d %d!\n", sig, a);
}