[Vm-dev] Unix heartbeat thread vs itimer

Eliot Miranda eliot.miranda at gmail.com
Wed Mar 29 02:54:38 UTC 2017


Hi Holger,

> On Mar 28, 2017, at 9:46 AM, Holger Freyther <holger at freyther.de> wrote:
> 
> 
> 
>> On 28 Mar 2017, at 17:05, Ben Coman <btc at openinworld.com> wrote:
>> 
>> 
>> 
>> Just curious, what is the root cause of this itimer conflict?
>> Is it that a SIGALARM in particular is issued, or just that the
>> current execution is pre-empted to handle the signal - and is that a
>> timing issue, or a concurrency problem where some state is
>> invalidated?
>> 
>> Would it help if to handle the signal in another thread?
>> 
> 
> AFAICT the main issue is that it can not be shared/multiplexed. E.g. if both ALSA and the VM install an event handler for the signal it is not clear who will win. And they will probably cancel each others work.

Not quite.  The problem with ALSA is that it does not follow the convention for installing signal handlers so that they can be chained, nor uninstalling signal handlers so that the previous chain is restored on uninstall.

The main problem is that the SIGALRM will interrupt system calls and it is common to find libraries either poorly written or poorly tested (perfectly understandably) so that the interruptions mean they effectively crash.

ALSA is also in this category.


More information about the Vm-dev mailing list