All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-core] [BUG] rt_task_delete kills caller
@ 2006-07-21  9:17 Jan Kiszka
  2006-07-21  9:38 ` Jan Kiszka
  0 siblings, 1 reply; 8+ messages in thread
From: Jan Kiszka @ 2006-07-21  9:17 UTC (permalink / raw)
  To: xenomai-core

[-- Attachment #1: Type: text/plain, Size: 1201 bytes --]

Hi,

I stumbled over a strange behaviour of rt_task_delete for a created, set
periodic, but non-started task. The process gets killed on invocation,
but only if rt_task_set_periodic was called with a non-zero start time.
Here is the demo code:

#include <stdio.h>
#include <sys/mman.h>
#include <native/task.h>

main()
{
	RT_TASK task;

	mlockall(MCL_CURRENT|MCL_FUTURE);

	printf("rt_task_create=%d\n",
		rt_task_create(&task, "task", 8192*4, 10, 0));

	printf("rt_task_set_periodic=%d\n",
		rt_task_set_periodic(&task, rt_timer_read()+1, 100000));

	printf("rt_task_delete=%d\n",
		rt_task_delete(&task));
}

Once you skip rt_task_set_periodic or call it like this
rt_task_set_periodic(&task, TM_NOW, 100000), everything is fine. Tested
over trunk, but I guess over versions should suffer as well.

I noticed that the difference seems to be related to the
xnpod_suspend_thread in xnpod_set_thread_periodic. That suspend is not
called on idate == XN_INFINITE. What is it for then, specifically if you
would call xnpod_suspend_thread(thread, xnpod_get_time()+period, period)
which should have the same effect like xnpod_suspend_thread(thread, 0,
period)?

Jan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]

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

end of thread, other threads:[~2006-07-30 16:57 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-21  9:17 [Xenomai-core] [BUG] rt_task_delete kills caller Jan Kiszka
2006-07-21  9:38 ` Jan Kiszka
2006-07-21 12:48   ` Jan Kiszka
2006-07-21 15:31     ` Jan Kiszka
2006-07-21 16:08       ` Philippe Gerum
2006-07-30  9:23       ` Philippe Gerum
2006-07-30 16:48         ` Gilles Chanteperdrix
2006-07-30 16:57           ` Philippe Gerum

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.