|
About ::
TODO ::
Blog ::
RSS ::
Old blog ::
Projects ::
GIT ::
Gallery ::
Notes
Tue, 23 Jan 2007
How do signals work in Linux? asm volatile ( "mov %0,%%eax \n" /* Start address */ "mov %1,%%ebx \n" /* Arguments */ "mov %%esp,%%edx \n" /* save old sp to edx */ "mov %2,%%esp \n" /* change stack */ "push %%edx \n" "push %%ebx \n" /* copy arguments to new stack */ "call *%%eax \n" /* call (*func)(arg); */ "mov 4(%%esp),%%edx \n" "mov %%edx,%%esp\n" /* restore old stack */ : : "g"(func), "g"(data), "g"(stack+stack_size) : "eax", "ebx", "edx", "esp" );It was lurked in PTL threading library, which is the only one which does support preemptive userspace scheduling. Provided function is indeed called on its own stack. But when signal is delivered, its $ebp does not contain that stack, but instead it contains address
somewhere in the middle of the new stack, which rised a suspicion, that glibc
installs own signal handler, and then calls my, but experiments with x86_64 test machine
showed, that kernel indeed jumps directly into my own signal handler. Unfortunately
I do not have fast x86 test machine, and do not want to spread power to two arches currently,
so I will setup my VIA C3 test machine and will run some signal tests on its modified
kernel to detect, where exactly stack pointer for interrupted context is stored.
When this issue will be resolved, correct preemptible scheduler for M-on-N threading
model implementation will be just a matter of hours.
/devel/threading :: Link / Comments () |