Re: [Xenomai-core] Fwd: Re: rt_task_delete doesn't work

2011-06-15 Thread Gilles Chanteperdrix
On 06/14/2011 01:59 PM, Roberto Bielli wrote:
> 
> 
> Here is the example and the command.
> 
> RT_TASK pippo;
> RT_TASK pluto;
> 
> void test1()
> {
>  int err;
> 
>  err = rt_task_delete(&pippo );
>  if( err != 0 )
>  printf("error task delete\n");
> 
> }
> 
> int main (int argc, char *argv[])
> {
>  //Porta di comunicazione
>  //int s;
> 
>  mlockall(MCL_CURRENT|MCL_FUTURE);
> 
>  // gestione signal handler
>  //struct sigaction sa;
>  //sa.sa_sigaction = (void *)sigHandler;
>  //sigemptyset (&sa.sa_mask);
>  //sa.sa_flags = SA_SIGINFO;
> 
>  //sigaction(SIGTERM,&sa, NULL);
>  //sigaction(SIGINT,&sa, NULL);
>  //sigaction(SIGPIPE,&sa, NULL);
>  //sigaction(SIGFPE,&sa, NULL);
>  //sigaction(SIGSEGV,&sa, NULL);
> 
> 
>  char * namePippo = "pippo";
>  char * namePluto = "pluto";
>  int err;
>  err = rt_task_create(&pippo, namePippo, 0x2000, 20, T_FPU );
>  if( err != 0 )
>  printf("error task create %s\n", namePippo );
>  err = rt_task_create(&pluto, namePluto, 0x2000, 20, T_FPU );
>  if( err != 0 )
>  printf("error task create %s\n", namePluto );
> 
>  err = rt_task_start(&pluto, (void *)test1, NULL );
>  if( err != 0 )
>  printf("error task start %s\n", namePluto );
> 
> }
> 
> --COMMAND--
> 
> # gdb --args ./apgs -D
> GNU gdb (GDB) 6.8.50.20080821-cvs
> Copyright (C) 2008 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later
> 
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
> and "show warranty" for details.
> This GDB was configured as "arm-mv5sft-linux-gnueabi".
> For bug reporting instructions, please see:
> ...
> (gdb) r
> `/flash/apgs' has disappeared; keeping its symbols.
> Starting program: /flash/apgs -D
> [Thread debugging using libthread_db enabled]
> [New Thread 0x2acf7490 (LWP 537)]
> [New Thread 0x2acfc490 (LWP 538)]
> 
> Program received signal SIGSEGV, Segmentation fault.
> [Switching to Thread 0x2acfc490 (LWP 538)]
> 0x2aab9d74 in _dl_catch_error () from /lib/ld-linux.so.3
> (gdb)

The segfault is due to a stack overflow. The stack sizes you pass are 
too small.

Note that if you are using Xenomai on an ARMv5, if you choose to enable 
FCSE (which is really recommended for latencies anyway), the 
configuration option CONFIG_ARM_FCSE_MESSAGES will tell you when you 
likely had a stack overflow. 

Here is the traces I got when running the example you sent:

[00d22f9c] *pgd=23a50031, *pte=23d6e04f, *ppte=23d6e00e
   
Pid: 908, comm:pluto   
CPU: 0Not tainted  (2.6.37.6 #2)   
PC is at 0x89d7a4  
LR is at 0x8b5000  
pc : [<0089d7a4>]lr : [<008b5000>]psr: 6010
sp : 00d22f90  ip : 0048  fp : 00d231b4
r10: 00a525ac  r9 :   r8 : 008c8ff8
r7 : 8001  r6 : 0048  r5 : 008b5000  r4 :  
r3 : 008a2384  r2 : 00d2318f  r1 : 00d23184  r0 : 00d23188 
Flags: nZCv  IRQs on  FIQs on  Mode USER_32  ISA ARM  Segment user 
Control: 0005317f  Table: 23a68000  DAC: 0015  
mappings:  
0x8000-0x9000 r-xp 0x /usr/bin/test_task_delete
0x0001-0x00011000 rwxp 0x /usr/bin/test_task_delete
0x00011000-0x00032000 rwxp 0x00011000 [heap]   
0x0081e000-0x0081f000 rwxp 0x0081e000  
0x0083-0x00839000 r-xp 0x /usr/lib/libnative.so.3.0.0  
0x00839000-0x0084 ---p 0x9000 /usr/lib/libnative.so.3.0.0  
0x0084-0x00841000 rwxp 0x8000 /usr/lib/libnative.so.3.0.0  
0x0086e000-0x0086f000 rwxp 0x0086e000  
0x0088f000-0x008ad000 r-xp 0x /lib/ld-linux.so.3 <- PC 
0x008b4000-0x008b5000 r-xp 0x0001d000 /lib/ld-linux.so.3   
0x008b5000-0x008b6000 rwxp 0x0001e000 /lib/ld-linux.so.3   
0x008b6000-0x008cb000 r-xp 0x /lib/libpthread.so.0 
0x008cb000-0x008d2000 ---p 0x00015000 /lib/libpthread.so.0 
0x008d2000-0x008d3000 r-xp 0x00014000 /lib/libpthread.so.0 
0x008d3000-0x008d4000 rwxp 0x00015000 /lib/libpthread.so.0 
0x008d4000-0x008d6000 rwxp 0x008d40

Re: [Xenomai-core] Fwd: Re: rt_task_delete doesn't work

2011-06-15 Thread Roberto Bielli

the tasks has not the same rt_task. One it's a create, one is a start.



Il 14/06/2011 18:27, Cagnulein ha scritto:

  err = rt_task_create(&pluto, namePluto, 0x2000, 20, T_FPU );
  if( err != 0 )
  printf("error task create %s\n", namePluto );

  err = rt_task_start(&pluto, (void *)test1, NULL );

You've created 2 tasks with the same RT_TASK variable. Is it volunteer?
Roberto Viola



Here is the example and the command.

RT_TASK pippo;
RT_TASK pluto;

void test1()
{
  int err;

  err = rt_task_delete(&pippo );
  if( err != 0 )
  printf("error task delete\n");

}

int main (int argc, char *argv[])
{
  //Porta di comunicazione
  //int s;

  mlockall(MCL_CURRENT|MCL_FUTURE);

  // gestione signal handler
  //struct sigaction sa;
  //sa.sa_sigaction = (void *)sigHandler;
  //sigemptyset (&sa.sa_mask);
  //sa.sa_flags = SA_SIGINFO;

  //sigaction(SIGTERM,&sa, NULL);
  //sigaction(SIGINT,&sa, NULL);
  //sigaction(SIGPIPE,&sa, NULL);
  //sigaction(SIGFPE,&sa, NULL);
  //sigaction(SIGSEGV,&sa, NULL);


  char * namePippo = "pippo";
  char * namePluto = "pluto";
  int err;
  err = rt_task_create(&pippo, namePippo, 0x2000, 20, T_FPU );
  if( err != 0 )
  printf("error task create %s\n", namePippo );
  err = rt_task_create(&pluto, namePluto, 0x2000, 20, T_FPU );
  if( err != 0 )
  printf("error task create %s\n", namePluto );

  err = rt_task_start(&pluto, (void *)test1, NULL );
  if( err != 0 )
  printf("error task start %s\n", namePluto );

}

--COMMAND--

# gdb --args ./apgs -D
GNU gdb (GDB) 6.8.50.20080821-cvs
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later

This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "arm-mv5sft-linux-gnueabi".
For bug reporting instructions, please see:
...
(gdb) r
`/flash/apgs' has disappeared; keeping its symbols.
Starting program: /flash/apgs -D
[Thread debugging using libthread_db enabled]
[New Thread 0x2acf7490 (LWP 537)]
[New Thread 0x2acfc490 (LWP 538)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x2acfc490 (LWP 538)]
0x2aab9d74 in _dl_catch_error () from /lib/ld-linux.so.3
(gdb)


Il 10/06/2011 19:32, Gilles Chanteperdrix ha scritto:

  On 06/10/2011 06:51 PM, Roberto Bielli wrote:

  The segmentation fault was not on this code line.
  i upgraded the version to 2.5.6 but the error is the same.

  The fault is when i try to delete a realtime task from another
realtime
  task.

  It's possible to do that  ?

  Please post a self-contained testcase. A self-contained test case is
  worth a thousand words.




-
Nessun virus nel messaggio.
Controllato da AVG - www.avg.com
Versione: 10.0.1382 / Database dei virus: 1513/3699 -  Data di rilascio:
12/06/2011


___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core




-
Nessun virus nel messaggio.
Controllato da AVG - www.avg.com
Versione: 10.0.1382 / Database dei virus: 1513/3703 -  Data di rilascio: 
14/06/2011



--
++

Roberto Bielli
Sviluppo Software   
Axel S.r.l. 

Via Del Cannino, 3  
21020 Crosio Della Valle
Varese - Italy  

Telefono: +39 0332 949600   
Fax:  +39 0332 969315   

E-mail:   roberto.bie...@axelsw.it  
Web Site: www.axelsw.it

++

Si precisa che le informazioni contenute in questo messaggio sono riservate e 
ad uso esclusivo del destinatario.
Qualora il messaggio in parola Le fosse pervenuto per errore, La preghiamo di 
eliminarlo senza copiarlo e di non inoltrarlo a terzi,
dandocene gentilmente comunicazione. Grazie.
Informativa sul trattamento dei dati personali (D. Lgs. 196/2003).
I dati utilizzati per la spedizione del presente messaggio sono utilizzati da 
Axel S.r.l., titolare del trattamento,
per l'invio delle comunicazioni dei diversi settori aziendali, non essendo 
autorizzata la divulgazione a terzi.
Potrete rivolgere alla seguente mail richieste di verifica, rettifica o 
cancellazione dei Vostri dati: i...@axelsw.it

This e-mail and any attachments is confi

Re: [Xenomai-core] Fwd: Re: rt_task_delete doesn't work

2011-06-14 Thread Cagnulein
>  err = rt_task_create(&pluto, namePluto, 0x2000, 20, T_FPU );
>  if( err != 0 )
>  printf("error task create %s\n", namePluto );
>
>  err = rt_task_start(&pluto, (void *)test1, NULL );

You've created 2 tasks with the same RT_TASK variable. Is it volunteer?
Roberto Viola

>
>
> Here is the example and the command.
>
> RT_TASK pippo;
> RT_TASK pluto;
>
> void test1()
> {
>  int err;
>
>  err = rt_task_delete(&pippo );
>  if( err != 0 )
>  printf("error task delete\n");
>
> }
>
> int main (int argc, char *argv[])
> {
>  //Porta di comunicazione
>  //int s;
>
>  mlockall(MCL_CURRENT|MCL_FUTURE);
>
>  // gestione signal handler
>  //struct sigaction sa;
>  //sa.sa_sigaction = (void *)sigHandler;
>  //sigemptyset (&sa.sa_mask);
>  //sa.sa_flags = SA_SIGINFO;
>
>  //sigaction(SIGTERM,&sa, NULL);
>  //sigaction(SIGINT,&sa, NULL);
>  //sigaction(SIGPIPE,&sa, NULL);
>  //sigaction(SIGFPE,&sa, NULL);
>  //sigaction(SIGSEGV,&sa, NULL);
>
>
>  char * namePippo = "pippo";
>  char * namePluto = "pluto";
>  int err;
>  err = rt_task_create(&pippo, namePippo, 0x2000, 20, T_FPU );
>  if( err != 0 )
>  printf("error task create %s\n", namePippo );
>  err = rt_task_create(&pluto, namePluto, 0x2000, 20, T_FPU );
>  if( err != 0 )
>  printf("error task create %s\n", namePluto );
>
>  err = rt_task_start(&pluto, (void *)test1, NULL );
>  if( err != 0 )
>  printf("error task start %s\n", namePluto );
>
> }
>
> --COMMAND--
>
> # gdb --args ./apgs -D
> GNU gdb (GDB) 6.8.50.20080821-cvs
> Copyright (C) 2008 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later
> 
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
> and "show warranty" for details.
> This GDB was configured as "arm-mv5sft-linux-gnueabi".
> For bug reporting instructions, please see:
> ...
> (gdb) r
> `/flash/apgs' has disappeared; keeping its symbols.
> Starting program: /flash/apgs -D
> [Thread debugging using libthread_db enabled]
> [New Thread 0x2acf7490 (LWP 537)]
> [New Thread 0x2acfc490 (LWP 538)]
>
> Program received signal SIGSEGV, Segmentation fault.
> [Switching to Thread 0x2acfc490 (LWP 538)]
> 0x2aab9d74 in _dl_catch_error () from /lib/ld-linux.so.3
> (gdb)
>
>
> Il 10/06/2011 19:32, Gilles Chanteperdrix ha scritto:
>>  On 06/10/2011 06:51 PM, Roberto Bielli wrote:
>>>  The segmentation fault was not on this code line.
>>>  i upgraded the version to 2.5.6 but the error is the same.
>>>
>>>  The fault is when i try to delete a realtime task from another
>>> realtime
>>>  task.
>>>
>>>  It's possible to do that  ?
>>  Please post a self-contained testcase. A self-contained test case is
>>  worth a thousand words.
>>
>
>
>
> -
> Nessun virus nel messaggio.
> Controllato da AVG - www.avg.com
> Versione: 10.0.1382 / Database dei virus: 1513/3699 -  Data di rilascio:
> 12/06/2011
>
>
> ___
> Xenomai-core mailing list
> Xenomai-core@gna.org
> https://mail.gna.org/listinfo/xenomai-core
>



___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core