All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-help] Program hangs using "rt_task_sleep" in a particular way
@ 2011-06-27  6:31 Adrien LEMAITRE
  2011-06-27 10:53 ` Gilles Chanteperdrix
  0 siblings, 1 reply; 9+ messages in thread
From: Adrien LEMAITRE @ 2011-06-27  6:31 UTC (permalink / raw)
  To: xenomai


[-- Attachment #1.1: Type: text/plain, Size: 1494 bytes --]

Hello,

I raise a problem encountered and always present. Before on this configuration
:

- linux kernel : 2.6.29.6
- adeos patch : adeos-ipipe-2.6.29-arm-1.13-00.patch
- xenomai : 2.4.8
- host linux distribution : ubuntu 10.04 (64 bits)
- compiler : gcc 4.2.1 (buildroot's generated toolchain)

And it is always present with this configuration :

- Linux kernel : 2.6.37
- Adeos patch : adeos-ipipe-2.6.37-x86-2.9-00.patch
- Xenomai : 2.5.6
- Host Linux distribution : Ubuntu 10.04
- Compiler : gcc-4.4.3

Configuration of kernel:

I used the default configuration of Ubunut 10.04 and i change this:
In "Power management and ACPI options" :
- deactivate APM
- deactivate CPU frequency scaling
- deactivate ACPI
- deactivate CPU idle PM support
In "Device drivers/Input device support/Miscelaneous devices":
- deactivate PC Speaker support
In "Processor type and features":
- deactivate HPET_TIMER
- deactivate Enable -fstack-protector buffer overflow detection
(EXPERIMENTAL)


We encounter a problem in a particular situation. In the attached
source, when we change the value passed to rt_task_sleep (line 36), the
program never returns.

This appears only with values greater or equal to 100000 (and maybe some
other values between 10000 and 100000) and only when we use
rt_task_sleep between the two rt_task_spawn calls.

Is there something we've done wrong ? A problem with the kernel
configuration? Or a bug of Xenomai ?


Adrien Lemaître.

[-- Attachment #1.2: Type: text/html, Size: 5803 bytes --]

[-- Attachment #2: projet_vierge.c --]
[-- Type: text/x-csrc, Size: 1102 bytes --]

#include "utils.h"
#include <assert.h>
#include <stdio.h>
#include <native/task.h>
#include <native/queue.h>
#include <sys/mman.h>

int Counter1=0;
int Counter2=0;
volatile int test1=0;
volatile int test2=0;

void WorkingTask1()
{
	while(test1==0)
	{
		Counter1++;
	}
}

void WorkingTask2()
{ 
	while(test2==0)
	{
		Counter2++;
	}
}

void go ()
{
	RT_TASK Rt_Working_task1;
	RT_TASK Rt_Working_task2;

	rt_task_spawn (&Rt_Working_task1, "WorkingTask1", DEFAULT_STACK_SIZE,10, T_FPU|T_JOINABLE, &WorkingTask1, NULL);
  
  rt_task_sleep(100000); // does not work
  //rt_task_sleep(10000);  // works

	rt_task_spawn (&Rt_Working_task2, "WorkingTask2", DEFAULT_STACK_SIZE, 20, T_FPU|T_JOINABLE, &WorkingTask2, NULL);

	test1=1;
	test2=1;
}

int main (void)
{
  RT_TASK Rt_main_task;
  int error;

  error = mlockall( MCL_CURRENT | MCL_FUTURE );
  assert (error == 0);

  error = rt_task_spawn (&Rt_main_task, "go", DEFAULT_STACK_SIZE, 50, T_FPU | T_JOINABLE, &go, NULL);
  assert (error == 0);

  error = rt_task_join(&Rt_main_task);
  assert (error == 0);
  
  printf("End program\r\n");
  
  return 0;
}

^ permalink raw reply	[flat|nested] 9+ messages in thread
* [Xenomai-help] Program hangs using "rt_task_sleep" in a particular way
@ 2011-03-07  9:18 Jonathan ILIAS-PILLET
  2011-03-07 10:15 ` Gilles Chanteperdrix
  0 siblings, 1 reply; 9+ messages in thread
From: Jonathan ILIAS-PILLET @ 2011-03-07  9:18 UTC (permalink / raw)
  To: xenomai; +Cc: armadeus-forum

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

Hello,

We encounter a problem in a particular situation. In the attached
source, when we change the value passed to rt_task_sleep (line 35), the
program never returns.

This appears only with values greater or equal to 100000 (and maybe some
other values between 10000 and 100000) and only when we use
rt_task_sleep between the two rt_task_spawn calls.

Is there something we've done wrong ?

We use and Armadeus APF27 platform. I don't know if this behavior is
related to this architecture, to Xenomai or both.

-- 
Jonathan ILIAS-PILLET

[-- Attachment #2: projet_vierge.c --]
[-- Type: text/x-csrc, Size: 1084 bytes --]

#include "utils.h"
#include <assert.h>
#include <stdio.h>
#include <native/task.h>
 
int Compteur1=0;
int Compteur2=0;
volatile int test1=0;
volatile int test2=0;

void WorkingTask1()
{
	while(test1==0)
	{
		Compteur1++;
	}
}

void WorkingTask2()
{ 
	while(test2==0)
	{
		Compteur2++;
	}
}

void go ()
{
	int erreur;
	RT_TASK Rt_Working_task1;
	RT_TASK Rt_Working_task2;

	rt_task_spawn (&Rt_Working_task1, "WorkingTask1", DEFAULT_STACK_SIZE,10, T_FPU|T_JOINABLE, &WorkingTask1, NULL);
  
  rt_task_sleep(100000); // does not work
  //rt_task_sleep(10000);  // works

	rt_task_spawn (&Rt_Working_task2, "WorkingTask2", DEFAULT_STACK_SIZE, 20, T_FPU|T_JOINABLE, &WorkingTask2, NULL);

	test1=1;
	test2=1;
}

int main (void)
{
  RT_TASK Rt_main_task;
  int erreur;

  erreur = mlockall( MCL_CURRENT | MCL_FUTURE );
  assert (erreur == 0);

  erreur = rt_task_spawn (&Rt_main_task, "go", DEFAULT_STACK_SIZE, 50, T_FPU | T_JOINABLE, &go, NULL);
  assert (erreur == 0);

  erreur = rt_task_join(&Rt_main_task);
  assert (erreur == 0);
  
  printf("Fin du programme\r\n");
  
  return 0;
}

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

end of thread, other threads:[~2011-06-28 15:08 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-27  6:31 [Xenomai-help] Program hangs using "rt_task_sleep" in a particular way Adrien LEMAITRE
2011-06-27 10:53 ` Gilles Chanteperdrix
     [not found]   ` <BANLkTimCab2u0EOrJ6JtLTVLNAzktbvFQg@domain.hid>
2011-06-28 13:08     ` Gilles Chanteperdrix
2011-06-28 14:02       ` Adrien LEMAITRE
2011-06-28 15:08         ` Gilles Chanteperdrix
  -- strict thread matches above, loose matches on Subject: below --
2011-03-07  9:18 Jonathan ILIAS-PILLET
2011-03-07 10:15 ` Gilles Chanteperdrix
2011-03-07 14:29   ` Jonathan ILIAS-PILLET
     [not found]   ` <AANLkTinnCqCNrJ-tukjxGd-zdtM9nuG2fw4Zer+iTSiQ@mail.gmail.com>
2011-03-07 14:33     ` Gilles Chanteperdrix

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.