* [Xenomai-help] Problems with gdb and rt_task_delete
@ 2011-07-11 9:50 Adrien LEMAITRE
2011-07-11 11:05 ` Gilles Chanteperdrix
0 siblings, 1 reply; 6+ messages in thread
From: Adrien LEMAITRE @ 2011-07-11 9:50 UTC (permalink / raw)
To: xenomai
[-- Attachment #1.1: Type: text/plain, Size: 1468 bytes --]
Hello,
I have two problems. Just before explain my problems i would like to clarify
the context. This exercice is for student. In this exercice, they program a
WorkingTask (infini loop) and they pilot this task with an other (go task).
The first problem is when i used rt_task_delete for stop and delete
WorkingTask, the Xenomai program doesn't finish.
But if i use rt_task_suspend before use rt_task_delete, the program stop
correctly.
Why i must use rt_task_suspend before? what is problem with rt_task_delete?
The second problem: I would like to debug a Xenomai program. But in some
situation, i have problems. Xenomai take all ressource, the simulateur
doesn't respond and gdb is blocked in waiting.
The code of this program is join in this email.
I launched gdb and I used these gdb's commands :
b main
b WorkingTask
b 34
start
continue
next
continue
And after the simulateur doesn't respond and gdb is blocked.
What is problem? do you have other problem with gdb?
A solution of how can i used gdb for debug?
The 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
- GDB : 7.1
Configuration of kernel:
I used the default configuration of Ubunut 10.04 and i change this:
In "Processor type and features":
- change the processor familly : Ahtlon64
- deactivate Enable -fstack-protector buffer overflow detection
(EXPERIMENTAL)
[-- Attachment #1.2: Type: text/html, Size: 5824 bytes --]
[-- Attachment #2: projet_vierge.c --]
[-- Type: text/x-csrc, Size: 1259 bytes --]
#include <native/task.h>
#include <sys/mman.h>
#include <assert.h>
#include <stdio.h>
#include "utils.h"
RT_TASK Rt_working_task;
int compteur;
void WorkingTask (){
compteur=0;
while (1){
compteur++;
rt_task_sleep (100);
}
}
void go (){
int codeErreur;
codeErreur = rt_task_start (&Rt_working_task, &WorkingTask, NULL);
assert (codeErreur == 0);
codeErreur = rt_task_sleep (TIME(MS_2_NS(100)));
assert (codeErreur == 0);
codeErreur = rt_task_suspend (&Rt_working_task); // if you delete this ligne, the program doesn't stop
assert (codeErreur == 0);
codeErreur = rt_task_delete (&Rt_working_task);
assert (codeErreur == 0);
}
int main (void){
RT_TASK Rt_go_task;
int codeErreur;
codeErreur = mlockall( MCL_CURRENT | MCL_FUTURE );
assert (codeErreur == 0);
codeErreur = rt_task_create (&Rt_go_task, "go", DEFAULT_STACK_SIZE, 50, T_FPU | T_JOINABLE);
assert (codeErreur == 0);
codeErreur = rt_task_create (&Rt_working_task, "working", DEFAULT_STACK_SIZE, 30, T_FPU | T_JOINABLE);
assert (codeErreur == 0);
codeErreur = rt_task_start (&Rt_go_task, &go, NULL);
assert (codeErreur == 0);
codeErreur = rt_task_join(&Rt_go_task);
assert (codeErreur == 0);
printf("End of program\r\n");
return 0;
}
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [Xenomai-help] Problems with gdb and rt_task_delete
2011-07-11 9:50 [Xenomai-help] Problems with gdb and rt_task_delete Adrien LEMAITRE
@ 2011-07-11 11:05 ` Gilles Chanteperdrix
2011-07-11 11:48 ` Adrien LEMAITRE
0 siblings, 1 reply; 6+ messages in thread
From: Gilles Chanteperdrix @ 2011-07-11 11:05 UTC (permalink / raw)
To: Adrien LEMAITRE; +Cc: xenomai
On 07/11/2011 11:50 AM, Adrien LEMAITRE wrote:
> Hello,
>
> I have two problems. Just before explain my problems i would like to clarify
> the context. This exercice is for student. In this exercice, they program a
> WorkingTask (infini loop)
That is the problem, there should not busy inifinite loops.
rt_task_sleep(100) asks for 100ns sleep, which is equivalent to not
sleeping at all.
I seem to remember that I already told you this in answer to your
previous post.
--
Gilles.
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [Xenomai-help] Problems with gdb and rt_task_delete
2011-07-11 11:05 ` Gilles Chanteperdrix
@ 2011-07-11 11:48 ` Adrien LEMAITRE
2011-07-11 12:12 ` Gilles Chanteperdrix
0 siblings, 1 reply; 6+ messages in thread
From: Adrien LEMAITRE @ 2011-07-11 11:48 UTC (permalink / raw)
To: xenomai
[-- Attachment #1: Type: text/plain, Size: 984 bytes --]
2011/7/11 Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
> On 07/11/2011 11:50 AM, Adrien LEMAITRE wrote:
> > Hello,
> >
> > I have two problems. Just before explain my problems i would like to
> clarify
> > the context. This exercice is for student. In this exercice, they program
> a
> > WorkingTask (infini loop)
>
> That is the problem, there should not busy inifinite loops.
> rt_task_sleep(100) asks for 100ns sleep, which is equivalent to not
> sleeping at all.
>
> I seem to remember that I already told you this in answer to your
> previous post.
>
yes and thanks you, i have a better understanding now. So ok if i would like
to make an infini loop i must add a sleep of 5ms, otherwise i have problems.
That is why i had needed rt_task_suspend(). And the problem with gdb is
gone.
But i don't see information of this in the wiki, could you show me exactly
where i can find it?
>
> --
> Gilles.
>
[-- Attachment #2: Type: text/html, Size: 1537 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Xenomai-help] Problems with gdb and rt_task_delete
2011-07-11 11:48 ` Adrien LEMAITRE
@ 2011-07-11 12:12 ` Gilles Chanteperdrix
2011-07-11 12:20 ` Adrien LEMAITRE
2011-07-11 13:25 ` Philippe Gerum
0 siblings, 2 replies; 6+ messages in thread
From: Gilles Chanteperdrix @ 2011-07-11 12:12 UTC (permalink / raw)
To: Adrien LEMAITRE; +Cc: xenomai
On 07/11/2011 01:48 PM, Adrien LEMAITRE wrote:
> 2011/7/11 Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
>
>> On 07/11/2011 11:50 AM, Adrien LEMAITRE wrote:
>>> Hello,
>>>
>>> I have two problems. Just before explain my problems i would like to
>> clarify
>>> the context. This exercice is for student. In this exercice, they program
>> a
>>> WorkingTask (infini loop)
>>
>> That is the problem, there should not busy inifinite loops.
>> rt_task_sleep(100) asks for 100ns sleep, which is equivalent to not
>> sleeping at all.
>>
>> I seem to remember that I already told you this in answer to your
>> previous post.
>>
>
> yes and thanks you, i have a better understanding now. So ok if i would like
> to make an infini loop i must add a sleep of 5ms, otherwise i have problems.
> That is why i had needed rt_task_suspend(). And the problem with gdb is
> gone.
>
> But i don't see information of this in the wiki, could you show me exactly
> where i can find it?
>
You can probably sleep for shorter times than 5ms, 100us should be
enough. This is not documented, because it is an unwanted shortcoming,
which we hope to avoid one day, by implementing signals for xenomai,
working even for interrupting an infinite busy loop.
--
Gilles.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Xenomai-help] Problems with gdb and rt_task_delete
2011-07-11 12:12 ` Gilles Chanteperdrix
@ 2011-07-11 12:20 ` Adrien LEMAITRE
2011-07-11 13:25 ` Philippe Gerum
1 sibling, 0 replies; 6+ messages in thread
From: Adrien LEMAITRE @ 2011-07-11 12:20 UTC (permalink / raw)
To: xenomai
[-- Attachment #1: Type: text/plain, Size: 1489 bytes --]
2011/7/11 Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
> On 07/11/2011 01:48 PM, Adrien LEMAITRE wrote:
> > 2011/7/11 Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
> >
> >> On 07/11/2011 11:50 AM, Adrien LEMAITRE wrote:
> >>> Hello,
> >>>
> >>> I have two problems. Just before explain my problems i would like to
> >> clarify
> >>> the context. This exercice is for student. In this exercice, they
> program
> >> a
> >>> WorkingTask (infini loop)
> >>
> >> That is the problem, there should not busy inifinite loops.
> >> rt_task_sleep(100) asks for 100ns sleep, which is equivalent to not
> >> sleeping at all.
> >>
> >> I seem to remember that I already told you this in answer to your
> >> previous post.
> >>
> >
> > yes and thanks you, i have a better understanding now. So ok if i would
> like
> > to make an infini loop i must add a sleep of 5ms, otherwise i have
> problems.
> > That is why i had needed rt_task_suspend(). And the problem with gdb is
> > gone.
> >
> > But i don't see information of this in the wiki, could you show me
> exactly
> > where i can find it?
> >
>
> You can probably sleep for shorter times than 5ms, 100us should be
> enough. This is not documented, because it is an unwanted shortcoming,
> which we hope to avoid one day, by implementing signals for xenomai,
> working even for interrupting an infinite busy loop.
>
>
Yes sorry it's not 5ms but 5us. Thanks a lot.
> --
> Gilles.
>
[-- Attachment #2: Type: text/html, Size: 2269 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Xenomai-help] Problems with gdb and rt_task_delete
2011-07-11 12:12 ` Gilles Chanteperdrix
2011-07-11 12:20 ` Adrien LEMAITRE
@ 2011-07-11 13:25 ` Philippe Gerum
1 sibling, 0 replies; 6+ messages in thread
From: Philippe Gerum @ 2011-07-11 13:25 UTC (permalink / raw)
To: Gilles Chanteperdrix; +Cc: Adrien LEMAITRE, xenomai
On Mon, 2011-07-11 at 14:12 +0200, Gilles Chanteperdrix wrote:
> On 07/11/2011 01:48 PM, Adrien LEMAITRE wrote:
> > 2011/7/11 Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
> >
> >> On 07/11/2011 11:50 AM, Adrien LEMAITRE wrote:
> >>> Hello,
> >>>
> >>> I have two problems. Just before explain my problems i would like to
> >> clarify
> >>> the context. This exercice is for student. In this exercice, they program
> >> a
> >>> WorkingTask (infini loop)
> >>
> >> That is the problem, there should not busy inifinite loops.
> >> rt_task_sleep(100) asks for 100ns sleep, which is equivalent to not
> >> sleeping at all.
> >>
> >> I seem to remember that I already told you this in answer to your
> >> previous post.
> >>
> >
> > yes and thanks you, i have a better understanding now. So ok if i would like
> > to make an infini loop i must add a sleep of 5ms, otherwise i have problems.
> > That is why i had needed rt_task_suspend(). And the problem with gdb is
> > gone.
> >
> > But i don't see information of this in the wiki, could you show me exactly
> > where i can find it?
> >
>
> You can probably sleep for shorter times than 5ms, 100us should be
> enough. This is not documented, because it is an unwanted shortcoming,
> which we hope to avoid one day, by implementing signals for xenomai,
> working even for interrupting an infinite busy loop.
>
I won't call this a shortcoming, it is rather that you can't expect two
kernels to run on the same hardware without sharing the CPU between them
somehow, even if unfairly as we do. In the present case, enabling
CONFIG_XENO_OPT_WATCHDOG would prevent the total lockup.
--
Philippe.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-07-11 13:25 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-11 9:50 [Xenomai-help] Problems with gdb and rt_task_delete Adrien LEMAITRE
2011-07-11 11:05 ` Gilles Chanteperdrix
2011-07-11 11:48 ` Adrien LEMAITRE
2011-07-11 12:12 ` Gilles Chanteperdrix
2011-07-11 12:20 ` Adrien LEMAITRE
2011-07-11 13:25 ` 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.