All of lore.kernel.org
 help / color / mirror / Atom feed
* Task exit via rt_task_suspend()?
@ 2023-08-18  9:28 Richard Weinberger
  2023-08-18 17:26 ` Philippe Gerum
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Weinberger @ 2023-08-18  9:28 UTC (permalink / raw)
  To: xenomai

Hi!

I have a not yet understood deadlock in a Xenomai application on my desk.
It looks like the deadlock is caused by the fact that rt_task_suspend()
can cause the calling thread to exit.

So, a thread puts itself into suspend and never returns (and exists).
Debugging indicates that ret = __RT(kill(pid, SIGSUSP)); in threadobj_suspend()
is the place where it enters the kernel and never return and inside the
kernel exits.

Can this be? :-S

Thanks,
//richard

-- 
​​​​​sigma star gmbh | Eduard-Bodem-Gasse 6, 6020 Innsbruck, AUT
UID/VAT Nr: ATU 66964118 | FN: 374287y



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Task exit via rt_task_suspend()?
  2023-08-18  9:28 Task exit via rt_task_suspend()? Richard Weinberger
@ 2023-08-18 17:26 ` Philippe Gerum
  2023-08-21  5:49   ` Richard Weinberger
  0 siblings, 1 reply; 3+ messages in thread
From: Philippe Gerum @ 2023-08-18 17:26 UTC (permalink / raw)
  To: Richard Weinberger; +Cc: xenomai


Richard Weinberger <richard@sigma-star.at> writes:

> Hi!
>
> I have a not yet understood deadlock in a Xenomai application on my desk.
> It looks like the deadlock is caused by the fact that rt_task_suspend()
> can cause the calling thread to exit.
>
> So, a thread puts itself into suspend and never returns (and exists).
> Debugging indicates that ret = __RT(kill(pid, SIGSUSP)); in threadobj_suspend()
> is the place where it enters the kernel and never return and inside the
> kernel exits.
>
> Can this be? :-S
>
> Thanks,
> //richard

Cobalt signal handling may not be the cause of such exit, syscall
handling could be, i.e. any code path crossing xnthread_test_cancel()
starting from cobalt/posix/syscall.c. The best way to find out would be
ftracing.

-- 
Philippe.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Task exit via rt_task_suspend()?
  2023-08-18 17:26 ` Philippe Gerum
@ 2023-08-21  5:49   ` Richard Weinberger
  0 siblings, 0 replies; 3+ messages in thread
From: Richard Weinberger @ 2023-08-21  5:49 UTC (permalink / raw)
  To: Philippe Gerum; +Cc: xenomai

Am Freitag, 18. August 2023, 19:26:15 CEST schrieb Philippe Gerum:
> 
> Richard Weinberger <richard@sigma-star.at> writes:
> 
> > Hi!
> >
> > I have a not yet understood deadlock in a Xenomai application on my desk.
> > It looks like the deadlock is caused by the fact that rt_task_suspend()
> > can cause the calling thread to exit.
> >
> > So, a thread puts itself into suspend and never returns (and exists).
> > Debugging indicates that ret = __RT(kill(pid, SIGSUSP)); in threadobj_suspend()
> > is the place where it enters the kernel and never return and inside the
> > kernel exits.
> >
> > Can this be? :-S
> >
> > Thanks,
> > //richard
> 
> Cobalt signal handling may not be the cause of such exit, syscall
> handling could be, i.e. any code path crossing xnthread_test_cancel()
> starting from cobalt/posix/syscall.c. The best way to find out would be
> ftracing.

Thanks for the info! I'm pretty sure XNCANCELD is not used.
I'll dig deeper.

Thanks,
//richard

-- 
​​​​​sigma star gmbh | Eduard-Bodem-Gasse 6, 6020 Innsbruck, AUT
UID/VAT Nr: ATU 66964118 | FN: 374287y



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-08-21  5:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-18  9:28 Task exit via rt_task_suspend()? Richard Weinberger
2023-08-18 17:26 ` Philippe Gerum
2023-08-21  5:49   ` Richard Weinberger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.