On 2012-05-09 07:11, Kevin Wolf wrote:
> Am 08.05.2012 21:35, schrieb Jan Kiszka:
>> Hi,
>>
>> I hunted down a fairly subtle corruption of the VCPU thread signal mask
>> in KVM mode when using the ucontext version of coroutines:
>>
>> coroutine_new calls getcontext, makecontext, swapcontext. Those
>> functions get/set also the signal mask of the caller. Unfortunately,
>> they only use the sigprocmask syscall on i386, not the rt_sigprocmask
>> version. So they do not properly save/restore the blocked RT signals,
>> namely our SIG_IPI - it becomes unblocke this way.
> 
> If other coroutine backends work (sigaltstack?),

Had a brief look at signalstack. Is kill(getpid(), SIGUSR2) in
coroutine_new correct? This should broadcast to the whole process, but
we only block SIGUSR2 in the caller's context. Why not pthread_kill?

I will give it a try nevertheless.

> we could try to detect
> the situation in configure and set the right default. Not sure what the
> condition is, glibc + i386?

So far it looks like a glibc/i386 thing, but maybe it is driven by the
ABI that defines the size of jmpbuf and, thus, the ability to store RT
signals as well. Then it is a generic i386 limitation.

Jan

-- 
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux

Reply via email to