[Xenomai] Deadlock in CANCEL_RESTORE with CONFIG_XENO_ASYNC_CANCEL during thread suspension

Philippe Gerum rpm at xenomai.org
Mon Apr 7 11:59:26 CEST 2014


On 04/06/2014 01:50 PM, Matthias Schneider wrote:
> Hi all,
>
> using xenomai-forge with mercury, when
> CONFIG_XENO_ASYNC_CANCEL is defined, CANCEL_RESTORE
> will include a call to backtrace_check(), which in turn
> will call backtrace_dump, which will take the
> mutex "__printlock".
>
> In case a thread gets suspended while holding that lock,
> the next call to CANCEL_RESTORE from whatever thread will
> cause a deadlock.

That's the price for using thread suspend/resume unsafe constructs, we 
never know at which location we will be preempting threads.

>
> Is there any way of getting around that?
>

We could block the notification signal when holding this internal lock. 
I'll have a look.

-- 
Philippe.




More information about the Xenomai mailing list