Re: [Xenomai-core] rt_task_suspend, rt_task_delete chooses wrong tasks
On 08/01/2011 05:18 PM, Roberto Bielli wrote: > Hi, > > i send the source files with the initialization. > In the file apgs.c there is the main procedure that call the function > InitRTEnv() that initialize all. > > Thanks a lot > > Best regards > > Il 01/08/2011 16:42, Gilles Chanteperdrix ha scritto: >> Could you show us the code which initializes the rtDesc member of the >> structure, in order to allow us reproducing your scenario? > > There is way too much code to be sure that the bug comes from Xenomai. Please try and reduce the code to a simple, self-contained (and I stress it) test case. -- Gilles. ___ Xenomai-core mailing list Xenomai-core@gna.org https://mail.gna.org/listinfo/xenomai-core
Re: [Xenomai-core] rt_task_suspend, rt_task_delete chooses wrong tasks
Hi, i send the source files with the initialization. In the file apgs.c there is the main procedure that call the function InitRTEnv() that initialize all. Thanks a lot Best regards Il 01/08/2011 16:42, Gilles Chanteperdrix ha scritto: Could you show us the code which initializes the rtDesc member of the structure, in order to allow us reproducing your scenario? -- ++ 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 confidential and may contain privileged information intended for the addressee(s) only. Dissemination, copying, printing or use by anybody else is unauthorised. If you are not the intended recipient, please delete this message and any attachments and advise the sender by return e-mail.Thank you. ++ /** \file APgs.c * Applicazione per eseguire PLC in tempo reale. Axel S.r.l. 2008 * */ #include #include #include #include #include "cext.h" #include "fujitsu.h" #include "pc.h" #include "rttasks.h" #include "sysgen.h" #include "version.h" #include "alplc/communication.h" #include "alplc/plcmanager.h" #include "TraceInput.h" #include "TraceLog.h" /** versione Real time */ #define RT_VERSION "AXEL S.R.L - " NAME_ARM_APGS " - v. " VERS_ARM_APGS " - " DATE_ARM_APGS /** opzioni da linea di comando */ #define CMD_OPT "p:hc:DM:" static boolean stopApplication; /** gestore dei segnali di processo */ void sigHandler( int sig, siginfo_t *info,void *context ) { ucontext_t *uc = (ucontext_t *)context; int i = 0; RT_TASK_INFO dstTaskSig; if (! stopApplication) { for( i = 0; i < NUMTASKS; i++ ) { if( rt_task_inquire( tabRtTask[i].rtDesc, &dstTaskSig ) == 0 && ( dstTaskSig.status & 0x380 ) == 0x380 ) { AltTraceInN( ALTRACE_LEV_BASE, "Il Task RT %s ha generato un segnale: 0x%08X", dstTaskSig.name, dstTaskSig.status ); break; } } switch( sig ) { case SIGTERM: AltTraceIn0( ALTRACE_LEV_BASE, "Arrivato segnale di SIGTERM" ); break; // case SIGINT: // PrintTimeMex( TRUE,"Arrivato segnale di SIGINT\n" ); // break; case SIGPIPE: AltTraceIn0( ALTRACE_LEV_BASE,"Arrivato segnale di SIGPIPE" ); break; case SIGFPE: AltTraceInN( ALTRACE_LEV_BASE,"Arrivato segnale di SIGFPE all'indirizzo: 0x%08x", uc->uc_mcontext.fault_address ); break; case SIGSEGV: AltTraceInN( ALTRACE_LEV_BASE,"Arrivato segnale di SIGSEGV all'indirizzo: 0x%08x", uc->uc_mcontext.fault_address ); signal( SIGSEGV, SIG_DFL ); break; case SIGBUS: AltTraceInN( ALTRACE_LEV_BASE, "Arrivato segnale di SIGBUS all'indirizzo: 0x%08x", uc->uc_mcontext.arm_pc); signal( SIGBUS, SIG_DFL );
Re: [Xenomai-core] rt_task_suspend, rt_task_delete chooses wrong tasks
On 08/01/2011 12:04 PM, Roberto Bielli wrote: > Hi, > > i see a big problem in xenomai. Aftear a certain number of task deletion > (rt_task_delete) and re-create task > the RT_TASK descriptors that i have in my application don't match with > the correct task. Could you show us the code which initializes the rtDesc member of the structure, in order to allow us reproducing your scenario? -- Gilles. ___ Xenomai-core mailing list Xenomai-core@gna.org https://mail.gna.org/listinfo/xenomai-core
[Xenomai-core] rt_task_suspend, rt_task_delete chooses wrong tasks
Hi, i see a big problem in xenomai. Aftear a certain number of task deletion (rt_task_delete) and re-create task the RT_TASK descriptors that i have in my application don't match with the correct task. 1. function for deleting the task. int mtsuspendtask( int idTsk ) { int err; RT_TASK_INFO tskInfo; RT_TASK_INFO tskInfoD; rt_task_inquire( rt_task_self(), &tskInfo ); //non sospendo task che non esistono if((err = (rt_task_inquire (tabRtTask[idTsk].rtDesc, NULL ))) != 0) { AltTraceInN(ALTRACE_LEV_OS_TASK, "rt_task_inquire (ts): %s - err %d (caller: %s)", tabRtTask[idTsk].name, err, tskInfo.name ); return err; } err = rt_task_suspend ( tabRtTask[idTsk].rtDesc ); AltTraceInN(ALTRACE_LEV_OS_TASK, "rt_task_suspend : %s - err %d (caller: %s)", tabRtTask[idTsk].name, err, tskInfo.name ); if( err != 0 ) { return err; } err = rt_task_delete (tabRtTask[idTsk].rtDesc); AltTraceInN(ALTRACE_LEV_OS_TASK, "rt_task_delete : %s - err %d (caller: %s)", tabRtTask[idTsk].name, err, tskInfo.name ); if ((err != 0) && (err != -3)) { return (err); } while ((err = (rt_task_inquire (tabRtTask[idTsk].rtDesc, &tskInfoD))) == 0) { AltTraceInN(ALTRACE_LEV_OS_TASK, "idTsk in tabella: %d", idTsk ); AltTraceInN(ALTRACE_LEV_OS_TASK, "rt_task_inquire : %s", tskInfoD.name ); AltTraceInN(ALTRACE_LEV_OS_TASK, "rt_task_inquire : %s - err %d (caller: %s)", tabRtTask[idTsk].name, err, tskInfo.name ); mtsleep (2); //...rt_task_sleep( 4 milliseconds ); } return (err); } 2. function for creating the task int mtresettask( int idTsk ) { int err; RT_TASK_INFO tskInfo; rt_task_inquire( rt_task_self(), &tskInfo ); memset( tabRtTask[idTsk].rtDesc, 0, sizeof( RT_TASK ) ); err = rt_task_create( tabRtTask[idTsk].rtDesc, tabRtTask[idTsk].name, tabRtTask[idTsk].stkSize,tabRtTask[idTsk].priority,tabRtTask[idTsk].mode); AltTraceInN(ALTRACE_LEV_OS_TASK, "rt_task_create : %s - err %d (caller: %s)", tabRtTask[idTsk].name, err, tskInfo.name ); if( err != 0 ) return err; err = rt_task_start( tabRtTask[idTsk].rtDesc, (void (*)(void*))tabRtTask[idTsk].fnAddr, tabRtTask[idTsk].tskArgs ); AltTraceInN(ALTRACE_LEV_OS_TASK, "rt_task_start : %s - err %d (caller: %s)", tabRtTask[idTsk].name, err, tskInfo.name ); return (err); } Thanks in advance Best Regards -- ++ 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 confidential and may contain privileged information intended for the addressee(s) only. Dissemination, copying, printing or use by anybody else is unauthorised. If you are not the intended recipient, please delete this message and any attachments and advise the sender by return e-mail.Thank you. ++ ___ Xenomai-core mailing list Xenomai-core@gna.org https://mail.gna.org/listinfo/xenomai-core