* [Xenomai-help] Xenomai VxWorks Skin--->semTake
@ 2011-08-03 10:15 Sambasiva Rao Manchili
2011-08-03 11:27 ` Philippe Gerum
0 siblings, 1 reply; 12+ messages in thread
From: Sambasiva Rao Manchili @ 2011-08-03 10:15 UTC (permalink / raw)
To: Xenomai-help@domain.hid; +Cc: Antonio Gambin
[-- Attachment #1: Type: text/plain, Size: 1311 bytes --]
Hallo ,
Most of code containing semTake with (WAIT_FOREVER ) ported from VxWorks to Linux using Xenomai is working, but only the following semTake is always failing.
For Example:-
semTake( restab_access_smp, 1200).
Semaphore created successfully and exists.
Any reason and any hint?
Semaphore created without ERROR as follows.
if ((restab_access_smp = semMCreate (SEM_Q_PRIORITY | SEM_DELETE_SAFE
| SEM_INVERSION_SAFE)) == NULL)
{
ERROR
}
Thanks,
Samba.
Sambasiva Rao Manchili
Software Development Engineer
________________________________
NEXUS TELECOM AG
Network and Service Investigation
Feldbachstrasse 80
8634 Hombrechtikon
Switzerland
Direct/mobile: +41 78 750 6808
Main: +41 44 355 6611
Email: sambasiva.manchili@domain.hid <mailto:sambasiva.manchili@domain.hidtelecom.com>
Website: www.nexustelecom.com<http://www.nexustelecom.com/>
[cid:335065507@domain.hid]
________________________________
This email and any attachment may contain confidential information which is intended for use only by the addressee(s) named above. If you received this email by mistake, please notify the sender immediately, and delete the email from your system. You are prohibited from copying, disseminating or otherwise using the email or any attachment.
[-- Attachment #2: Type: text/html, Size: 4622 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [Xenomai-help] Xenomai VxWorks Skin--->semTake 2011-08-03 10:15 [Xenomai-help] Xenomai VxWorks Skin--->semTake Sambasiva Rao Manchili @ 2011-08-03 11:27 ` Philippe Gerum 2011-08-03 12:44 ` Sambasiva Rao Manchili 0 siblings, 1 reply; 12+ messages in thread From: Philippe Gerum @ 2011-08-03 11:27 UTC (permalink / raw) To: Sambasiva Rao Manchili; +Cc: Antonio Gambin, Xenomai-help@domain.hid On Wed, 2011-08-03 at 12:15 +0200, Sambasiva Rao Manchili wrote: > Hallo , > Most of code containing semTake with (WAIT_FOREVER ) ported from > VxWorks to Linux using Xenomai is working, but only the following > semTake is always failing. Your description is a bit terse. Failing how? Hangs, returns immediately? Crashes your board? If not, any error code reported by the skin? And rehashing a previous question which was not answered IIRC: what CPU/platform are you running on, beside "linux 2.6.37" which does not help enough? What Xenomai version? Please make sure to send any relevant information that may help reproducing the issue, this tends to convince people to actually have a look at it. > > For Example:- > semTake( restab_access_smp, 1200). > > Semaphore created successfully and exists. > Any reason and any hint? > > Semaphore created without ERROR as follows. > if ((restab_access_smp = semMCreate (SEM_Q_PRIORITY | SEM_DELETE_SAFE > | SEM_INVERSION_SAFE)) == NULL) > { > ERROR > } > > Thanks, > Samba. > > > Sambasiva Rao Manchili > Software Development Engineer > ________________________________ > > NEXUS TELECOM AG > Network and Service Investigation > > Feldbachstrasse 80 > 8634 Hombrechtikon > Switzerland > > Direct/mobile: +41 78 750 6808 > Main: +41 44 355 6611 > Email: sambasiva.manchili@domain.hid > Website: www.nexustelecom.com > > > > > > ______________________________________________________________________ > This email and any attachment may contain confidential information > which is intended for use only by the addressee(s) named above. If you > received this email by mistake, please notify the sender immediately, > and delete the email from your system. You are prohibited from > copying, disseminating or otherwise using the email or any attachment. > _______________________________________________ > Xenomai-help mailing list > Xenomai-help@domain.hid > https://mail.gna.org/listinfo/xenomai-help -- Philippe. ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Xenomai-help] Xenomai VxWorks Skin--->semTake 2011-08-03 11:27 ` Philippe Gerum @ 2011-08-03 12:44 ` Sambasiva Rao Manchili 2011-08-03 13:17 ` Gilles Chanteperdrix 0 siblings, 1 reply; 12+ messages in thread From: Sambasiva Rao Manchili @ 2011-08-03 12:44 UTC (permalink / raw) To: Philippe Gerum; +Cc: Antonio Gambin, Xenomai-help@domain.hid Hi Philppe, Failed and return with error code is <Unknown error 4294967295> and continues. I do not know the granularity of time here, if it is returning immediately or not. We have about 15 tasks spawned in this whole system. Done very very minimal changes to our VxWorks code to run on Linux over Xenomai version 2.5.6. Board does not crash. CPU Platform is Intel x86 Arch 32 Bit. Thank you for support. Samba. -----Original Message----- From: Philippe Gerum [mailto:rpm@xenomai.org] Sent: Wednesday, 03. August, 2011 13:27 To: Sambasiva Rao Manchili Cc: Xenomai-help@domain.hid; Antonio Gambin Subject: Re: [Xenomai-help] Xenomai VxWorks Skin--->semTake On Wed, 2011-08-03 at 12:15 +0200, Sambasiva Rao Manchili wrote: > Hallo , > Most of code containing semTake with (WAIT_FOREVER ) ported from > VxWorks to Linux using Xenomai is working, but only the following > semTake is always failing. Your description is a bit terse. Failing how? Hangs, returns immediately? Crashes your board? If not, any error code reported by the skin? And rehashing a previous question which was not answered IIRC: what CPU/platform are you running on, beside "linux 2.6.37" which does not help enough? What Xenomai version? Please make sure to send any relevant information that may help reproducing the issue, this tends to convince people to actually have a look at it. > > For Example:- > semTake( restab_access_smp, 1200). > > Semaphore created successfully and exists. > Any reason and any hint? > > Semaphore created without ERROR as follows. > if ((restab_access_smp = semMCreate (SEM_Q_PRIORITY | SEM_DELETE_SAFE > | SEM_INVERSION_SAFE)) == NULL) { > ERROR > } > > Thanks, > Samba. > > > Sambasiva Rao Manchili > Software Development Engineer > ________________________________ > > NEXUS TELECOM AG > Network and Service Investigation > > Feldbachstrasse 80 > 8634 Hombrechtikon > Switzerland > > Direct/mobile: +41 78 750 6808 > Main: +41 44 355 6611 > Email: sambasiva.manchili@domain.hid > Website: www.nexustelecom.com > > > > > > ______________________________________________________________________ > This email and any attachment may contain confidential information > which is intended for use only by the addressee(s) named above. If you > received this email by mistake, please notify the sender immediately, > and delete the email from your system. You are prohibited from > copying, disseminating or otherwise using the email or any attachment. > _______________________________________________ > Xenomai-help mailing list > Xenomai-help@domain.hid > https://mail.gna.org/listinfo/xenomai-help -- Philippe. This email and any attachment may contain confidential information which is intended for use only by the addressee(s) named above. If you received this email by mistake, please notify the sender immediately, and delete the email from your system. You are prohibited from copying, disseminating or otherwise using the email or any attachment. ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Xenomai-help] Xenomai VxWorks Skin--->semTake 2011-08-03 12:44 ` Sambasiva Rao Manchili @ 2011-08-03 13:17 ` Gilles Chanteperdrix 2011-08-03 13:31 ` Sambasiva Rao Manchili 0 siblings, 1 reply; 12+ messages in thread From: Gilles Chanteperdrix @ 2011-08-03 13:17 UTC (permalink / raw) To: Sambasiva Rao Manchili; +Cc: Antonio Gambin, Xenomai-help@domain.hid On 08/03/2011 02:44 PM, Sambasiva Rao Manchili wrote: > Hi Philppe, > Failed and return with error code is <Unknown error 4294967295> and continues. I do not know the granularity of time here, if it is returning immediately or not. > We have about 15 tasks spawned in this whole system. Done very very minimal changes to our VxWorks code to run on Linux over Xenomai version 2.5.6. Board does not crash. > CPU Platform is Intel x86 Arch 32 Bit. semTake does not return error code directly, it returns ERROR (which is -1, or 4294967295 if you cast to unsigned), and the real error is in the errno variable. -- Gilles. ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Xenomai-help] Xenomai VxWorks Skin--->semTake 2011-08-03 13:17 ` Gilles Chanteperdrix @ 2011-08-03 13:31 ` Sambasiva Rao Manchili 2011-08-03 13:53 ` Philippe Gerum 2011-08-03 14:03 ` Gilles Chanteperdrix 0 siblings, 2 replies; 12+ messages in thread From: Sambasiva Rao Manchili @ 2011-08-03 13:31 UTC (permalink / raw) To: Gilles Chanteperdrix; +Cc: Antonio Gambin, Xenomai-help@domain.hid Hi Gilles, I had seen the code in src\skins\vxworks\semLib.c it returns ERROR which is -1. The value that I sent earlier is the value that I got out of the following statement. serrLog( serrErr, "resu_getonline_1_svc: semTake for restab_access_smp failed!!<%s>", strerror(errnoGet())); Is it right ? Now again I tried with serrLog( serrErr, "resu_getonline_1_svc: semTake for restab_access_smp failed!!<%s> <%d>", strerror(errnoGet()), errno); Here I get value 1 for errno. Samba. -----Original Message----- From: Gilles Chanteperdrix [mailto:gilles.chanteperdrix@xenomai.org] Sent: Wednesday, 03. August, 2011 15:18 To: Sambasiva Rao Manchili Cc: Philippe Gerum; Antonio Gambin; Xenomai-help@domain.hid Subject: Re: [Xenomai-help] Xenomai VxWorks Skin--->semTake On 08/03/2011 02:44 PM, Sambasiva Rao Manchili wrote: > Hi Philppe, > Failed and return with error code is <Unknown error 4294967295> and continues. I do not know the granularity of time here, if it is returning immediately or not. > We have about 15 tasks spawned in this whole system. Done very very minimal changes to our VxWorks code to run on Linux over Xenomai version 2.5.6. Board does not crash. > CPU Platform is Intel x86 Arch 32 Bit. semTake does not return error code directly, it returns ERROR (which is -1, or 4294967295 if you cast to unsigned), and the real error is in the errno variable. -- Gilles. This email and any attachment may contain confidential information which is intended for use only by the addressee(s) named above. If you received this email by mistake, please notify the sender immediately, and delete the email from your system. You are prohibited from copying, disseminating or otherwise using the email or any attachment. ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Xenomai-help] Xenomai VxWorks Skin--->semTake 2011-08-03 13:31 ` Sambasiva Rao Manchili @ 2011-08-03 13:53 ` Philippe Gerum 2011-08-03 14:30 ` Sambasiva Rao Manchili 2011-08-03 14:03 ` Gilles Chanteperdrix 1 sibling, 1 reply; 12+ messages in thread From: Philippe Gerum @ 2011-08-03 13:53 UTC (permalink / raw) To: Sambasiva Rao Manchili; +Cc: Antonio Gambin, Xenomai-help@domain.hid On Wed, 2011-08-03 at 15:31 +0200, Sambasiva Rao Manchili wrote: > Hi Gilles, > I had seen the code in src\skins\vxworks\semLib.c it returns ERROR which is -1. > > The value that I sent earlier is the value that I got out of the following statement. > serrLog( serrErr, > "resu_getonline_1_svc: semTake for restab_access_smp failed!!<%s>", > strerror(errnoGet())); > > Is it right ? > > > Now again I tried with > serrLog( serrErr, > "resu_getonline_1_svc: semTake for restab_access_smp failed!!<%s> <%d>", > strerror(errnoGet()), errno); > > Here I get value 1 for errno. You are trying to grab the mutex from a non-Xenomai thread context. This is invalid. > > Samba. > -----Original Message----- > From: Gilles Chanteperdrix [mailto:gilles.chanteperdrix@xenomai.org] > Sent: Wednesday, 03. August, 2011 15:18 > To: Sambasiva Rao Manchili > Cc: Philippe Gerum; Antonio Gambin; Xenomai-help@domain.hid > Subject: Re: [Xenomai-help] Xenomai VxWorks Skin--->semTake > > On 08/03/2011 02:44 PM, Sambasiva Rao Manchili wrote: > > Hi Philppe, > > Failed and return with error code is <Unknown error 4294967295> and continues. I do not know the granularity of time here, if it is returning immediately or not. > > We have about 15 tasks spawned in this whole system. Done very very minimal changes to our VxWorks code to run on Linux over Xenomai version 2.5.6. Board does not crash. > > CPU Platform is Intel x86 Arch 32 Bit. > > semTake does not return error code directly, it returns ERROR (which is -1, or 4294967295 if you cast to unsigned), and the real error is in the errno variable. > > -- > Gilles. > > > This email and any attachment may contain confidential information which is intended for use only by the addressee(s) named above. If you received this email by mistake, please notify the sender immediately, and delete the email from your system. You are prohibited from copying, disseminating or otherwise using the email or any attachment. > -- Philippe. ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Xenomai-help] Xenomai VxWorks Skin--->semTake 2011-08-03 13:53 ` Philippe Gerum @ 2011-08-03 14:30 ` Sambasiva Rao Manchili 2011-08-03 14:40 ` Philippe Gerum 0 siblings, 1 reply; 12+ messages in thread From: Sambasiva Rao Manchili @ 2011-08-03 14:30 UTC (permalink / raw) To: Philippe Gerum; +Cc: Antonio Gambin, Xenomai-help@domain.hid [-- Attachment #1: Type: text/plain, Size: 3117 bytes --] Hi Philippe, Why do you say that I try to grab the mutex from non-xenomai thread context ? During porting we had written main() only this main function does pthread_create to call the very first function of VxWorks code which inturn does taskSpawn. All the taskSpawns has to go through Xenomai thread context right ? Samba. -----Original Message----- From: Philippe Gerum [mailto:rpm@xenomai.org] Sent: Wednesday, 03. August, 2011 15:53 To: Sambasiva Rao Manchili Cc: Gilles Chanteperdrix; Antonio Gambin; Xenomai-help@domain.hid Subject: RE: [Xenomai-help] Xenomai VxWorks Skin--->semTake On Wed, 2011-08-03 at 15:31 +0200, Sambasiva Rao Manchili wrote: > Hi Gilles, > I had seen the code in src\skins\vxworks\semLib.c it returns ERROR which is -1. > > The value that I sent earlier is the value that I got out of the following statement. > serrLog( serrErr, > "resu_getonline_1_svc: semTake for restab_access_smp failed!!<%s>", > strerror(errnoGet())); > > Is it right ? > > > Now again I tried with > serrLog( serrErr, > "resu_getonline_1_svc: semTake for restab_access_smp failed!!<%s> <%d>", > strerror(errnoGet()), errno); > > Here I get value 1 for errno. You are trying to grab the mutex from a non-Xenomai thread context. This is invalid. > > Samba. > -----Original Message----- > From: Gilles Chanteperdrix [mailto:gilles.chanteperdrix@xenomai.org] > Sent: Wednesday, 03. August, 2011 15:18 > To: Sambasiva Rao Manchili > Cc: Philippe Gerum; Antonio Gambin; Xenomai-help@domain.hid > Subject: Re: [Xenomai-help] Xenomai VxWorks Skin--->semTake > > On 08/03/2011 02:44 PM, Sambasiva Rao Manchili wrote: > > Hi Philppe, > > Failed and return with error code is <Unknown error 4294967295> and continues. I do not know the granularity of time here, if it is returning immediately or not. > > We have about 15 tasks spawned in this whole system. Done very very minimal changes to our VxWorks code to run on Linux over Xenomai version 2.5.6. Board does not crash. > > CPU Platform is Intel x86 Arch 32 Bit. > > semTake does not return error code directly, it returns ERROR (which is -1, or 4294967295 if you cast to unsigned), and the real error is in the errno variable. > > -- > Gilles. > > > This email and any attachment may contain confidential information which is intended for use only by the addressee(s) named above. If you received this email by mistake, please notify the sender immediately, and delete the email from your system. You are prohibited from copying, disseminating or otherwise using the email or any attachment. > -- Philippe. ________________________________ This email and any attachment may contain confidential information which is intended for use only by the addressee(s) named above. If you received this email by mistake, please notify the sender immediately, and delete the email from your system. You are prohibited from copying, disseminating or otherwise using the email or any attachment. [-- Attachment #2: Type: text/html, Size: 5455 bytes --] ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Xenomai-help] Xenomai VxWorks Skin--->semTake 2011-08-03 14:30 ` Sambasiva Rao Manchili @ 2011-08-03 14:40 ` Philippe Gerum 0 siblings, 0 replies; 12+ messages in thread From: Philippe Gerum @ 2011-08-03 14:40 UTC (permalink / raw) To: Sambasiva Rao Manchili; +Cc: Antonio Gambin, Xenomai-help@domain.hid On Wed, 2011-08-03 at 16:30 +0200, Sambasiva Rao Manchili wrote: > Hi Philippe, > Why do you say that I try to grab the mutex from non-xenomai thread > context ? Because this is what you are very likely doing. Calling a Xenomai-only service over a non-Xenomai thread. > During porting we had written main() only this main function does > pthread_create to call the very first function of VxWorks code which > inturn does taskSpawn. All the taskSpawns has to go through Xenomai > thread context right ? Task created by taskSpawn() are valid Xenomai context for sure. main() is not by default. I can't check your code, but EPERM is typical of calling a resource grabbing service out of a valid Xenomai context. Xenomai can't move your calling context to primary mode before executing this service and fails early with EPERM. > > Samba. > > > -----Original Message----- > From: Philippe Gerum [mailto:rpm@xenomai.org] > Sent: Wednesday, 03. August, 2011 15:53 > To: Sambasiva Rao Manchili > Cc: Gilles Chanteperdrix; Antonio Gambin; Xenomai-help@domain.hid > Subject: RE: [Xenomai-help] Xenomai VxWorks Skin--->semTake > > On Wed, 2011-08-03 at 15:31 +0200, Sambasiva Rao Manchili wrote: > > Hi Gilles, > > I had seen the code in src\skins\vxworks\semLib.c it returns ERROR > which is -1. > > > > The value that I sent earlier is the value that I got out of the > following statement. > > serrLog( serrErr, > > "resu_getonline_1_svc: semTake for restab_access_smp > failed!!<%s>", > > strerror(errnoGet())); > > > > Is it right ? > > > > > > Now again I tried with > > serrLog( serrErr, > > "resu_getonline_1_svc: semTake for restab_access_smp > failed!!<%s> <%d>", > > strerror(errnoGet()), errno); > > > > Here I get value 1 for errno. > > You are trying to grab the mutex from a non-Xenomai thread context. > This is invalid. > > > > > Samba. > > -----Original Message----- > > From: Gilles Chanteperdrix [mailto:gilles.chanteperdrix@xenomai.org] > > Sent: Wednesday, 03. August, 2011 15:18 > > To: Sambasiva Rao Manchili > > Cc: Philippe Gerum; Antonio Gambin; Xenomai-help@domain.hid > > Subject: Re: [Xenomai-help] Xenomai VxWorks Skin--->semTake > > > > On 08/03/2011 02:44 PM, Sambasiva Rao Manchili wrote: > > > Hi Philppe, > > > Failed and return with error code is <Unknown error 4294967295> > and continues. I do not know the granularity of time here, if it is > returning immediately or not. > > > We have about 15 tasks spawned in this whole system. Done very > very minimal changes to our VxWorks code to run on Linux over Xenomai > version 2.5.6. Board does not crash. > > > CPU Platform is Intel x86 Arch 32 Bit. > > > > semTake does not return error code directly, it returns ERROR (which > is -1, or 4294967295 if you cast to unsigned), and the real error is > in the errno variable. > > > > -- > > Gilles. > > > > > > This email and any attachment may contain confidential information > which is intended for use only by the addressee(s) named above. If you > received this email by mistake, please notify the sender immediately, > and delete the email from your system. You are prohibited from > copying, disseminating or otherwise using the email or any attachment. > > > > -- > Philippe. > > > > > > ________________________________ > This email and any attachment may contain confidential information > which is intended for use only by the addressee(s) named above. If you > received this email by mistake, please notify the sender immediately, > and delete the email from your system. You are prohibited from > copying, disseminating or otherwise using the email or any attachment. > -- Philippe. ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Xenomai-help] Xenomai VxWorks Skin--->semTake 2011-08-03 13:31 ` Sambasiva Rao Manchili 2011-08-03 13:53 ` Philippe Gerum @ 2011-08-03 14:03 ` Gilles Chanteperdrix 2011-08-03 14:24 ` Sambasiva Rao Manchili 1 sibling, 1 reply; 12+ messages in thread From: Gilles Chanteperdrix @ 2011-08-03 14:03 UTC (permalink / raw) To: Sambasiva Rao Manchili; +Cc: Antonio Gambin, Xenomai-help@domain.hid On 08/03/2011 03:31 PM, Sambasiva Rao Manchili wrote: > Hi Gilles, > I had seen the code in src\skins\vxworks\semLib.c it returns ERROR which is -1. > > The value that I sent earlier is the value that I got out of the following statement. > serrLog( serrErr, > "resu_getonline_1_svc: semTake for restab_access_smp failed!!<%s>", > strerror(errnoGet())); > > Is it right ? You want printErrno instead of strerror. > > > Now again I tried with > serrLog( serrErr, > "resu_getonline_1_svc: semTake for restab_access_smp failed!!<%s> <%d>", > strerror(errnoGet()), errno); > > Here I get value 1 for errno. 1 is EPERM. Is the thread issuing the call a thread created by Xenomai? -- Gilles. ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Xenomai-help] Xenomai VxWorks Skin--->semTake 2011-08-03 14:03 ` Gilles Chanteperdrix @ 2011-08-03 14:24 ` Sambasiva Rao Manchili 2011-08-03 15:19 ` Gilles Chanteperdrix 0 siblings, 1 reply; 12+ messages in thread From: Sambasiva Rao Manchili @ 2011-08-03 14:24 UTC (permalink / raw) To: Gilles Chanteperdrix; +Cc: Antonio Gambin, Xenomai-help@domain.hid -----Original Message----- From: Gilles Chanteperdrix [mailto:gilles.chanteperdrix@xenomai.org] Sent: Wednesday, 03. August, 2011 16:03 To: Sambasiva Rao Manchili Cc: Philippe Gerum; Antonio Gambin; Xenomai-help@domain.hid Subject: Re: [Xenomai-help] Xenomai VxWorks Skin--->semTake On 08/03/2011 03:31 PM, Sambasiva Rao Manchili wrote: > Hi Gilles, > I had seen the code in src\skins\vxworks\semLib.c it returns ERROR which is -1. > > The value that I sent earlier is the value that I got out of the following statement. > serrLog( serrErr, > "resu_getonline_1_svc: semTake for restab_access_smp failed!!<%s>", > strerror(errnoGet())); > > Is it right ? You want printErrno instead of strerror. >>Samba: >>In the beginning days of our code porting from VxWorks to Linux, Xenomai failed to create message Queue that was working on VxWorks. >>When xenomai failed to create message queue it returned 0x110001===>1114113. After reading the Xenomai code a bit I understood it is S_memLib_NOT_ENOUGH_MEMORY. >>I therefore reduced the Queue size by 5 times and it was then successful. The way I extracted the errno in beginning days is same as I did today. So I epxected a value which >>tells the actual reason of semTake failure. But I got this huge value which is -1. Am I missing something ? > > > Now again I tried with > serrLog( serrErr, > "resu_getonline_1_svc: semTake for restab_access_smp failed!!<%s> <%d>", > strerror(errnoGet()), errno); > > Here I get value 1 for errno. 1 is EPERM. Is the thread issuing the call a thread created by Xenomai? >>Samba: Yes. I guess taskSpawn leads finally to Xenomai libraries to create thread. All our VxWorks code(with minor changes) as it is running on top of Xenomai. >> Please tell me, What will you suggest me then ? -- Gilles. This email and any attachment may contain confidential information which is intended for use only by the addressee(s) named above. If you received this email by mistake, please notify the sender immediately, and delete the email from your system. You are prohibited from copying, disseminating or otherwise using the email or any attachment. ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Xenomai-help] Xenomai VxWorks Skin--->semTake 2011-08-03 14:24 ` Sambasiva Rao Manchili @ 2011-08-03 15:19 ` Gilles Chanteperdrix 2011-08-05 6:48 ` Sambasiva Rao Manchili 0 siblings, 1 reply; 12+ messages in thread From: Gilles Chanteperdrix @ 2011-08-03 15:19 UTC (permalink / raw) To: Sambasiva Rao Manchili; +Cc: Antonio Gambin, Xenomai-help@domain.hid On 08/03/2011 04:24 PM, Sambasiva Rao Manchili wrote: > You want printErrno instead of strerror. > >>> Samba: In the beginning days of our code porting from VxWorks to >>> Linux, Xenomai failed to create message Queue that was working >>> on VxWorks. When xenomai failed to create message queue it >>> returned 0x110001===>1114113. After reading the Xenomai code a >>> bit I understood it is S_memLib_NOT_ENOUGH_MEMORY. I therefore >>> reduced the Queue size by 5 times and it was then successful. >>> The way I extracted the errno in beginning days is same as I did >>> today. So I epxected a value which >>tells the actual reason of >>> semTake failure. But I got this huge value which is -1. Am I >>> missing something ? > The thing is printErrno is a xenomai posix skin function which knows S_memlib_NOT_ENOUGH_MEMORY, strerror is an unrelated glibc function, and does not. What you are missing is this comment in ksrc/skins/vxworks/syscall.c /* * By convention, error codes are passed back through the syscall * return value: * - negative codes stand for internal (i.e. nucleus) errors; * - strictly positive values stand for genuine VxWorks errors. * - zero means success. * Looking at the code, I think after a service returns an error, it may be more reliable to use errno than to use errnoOfTaskGet. > 1 is EPERM. Is the thread issuing the call a thread created by > Xenomai? > >>> Samba: Yes. I guess taskSpawn leads finally to Xenomai libraries >>> to create thread. All our VxWorks code(with minor changes) as >>> it is running on top of Xenomai. Please tell me, What will you >>> suggest me then ? Trace the kernel code to know the reason for semTake to return -EPERM. Another reason documented in txt/vxworks/skin.txt maybe that you are calling semTake in a region where the scheduler has been locked (using taskLock). NOTE: it would be nice if you could formats your mails as everybody does: quote the mail you reply to by prepending " >" to the beginning of the lines you are quoting, and do not put ">" characters in front of the lines you add. -- Gilles. ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Xenomai-help] Xenomai VxWorks Skin--->semTake 2011-08-03 15:19 ` Gilles Chanteperdrix @ 2011-08-05 6:48 ` Sambasiva Rao Manchili 0 siblings, 0 replies; 12+ messages in thread From: Sambasiva Rao Manchili @ 2011-08-05 6:48 UTC (permalink / raw) To: Gilles Chanteperdrix; +Cc: Antonio Gambin, Xenomai-help@domain.hid Hi Gilles, Thank you for hint. Apparently hint (direction that I may have to look) on error that I receive -EPREM seems to be promising. To give a try I just removed all taskLock but still no luck yet. I am trying... I have taken your NOTE. Thank you. Samba. -----Original Message----- From: Gilles Chanteperdrix [mailto:gilles.chanteperdrix@xenomai.org] Sent: Wednesday, 03. August, 2011 17:19 To: Sambasiva Rao Manchili Cc: Philippe Gerum; Antonio Gambin; Xenomai-help@domain.hid Subject: Re: [Xenomai-help] Xenomai VxWorks Skin--->semTake On 08/03/2011 04:24 PM, Sambasiva Rao Manchili wrote: > You want printErrno instead of strerror. > >>> Samba: In the beginning days of our code porting from VxWorks to >>> Linux, Xenomai failed to create message Queue that was working on >>> VxWorks. When xenomai failed to create message queue it returned >>> 0x110001===>1114113. After reading the Xenomai code a bit I >>> understood it is S_memLib_NOT_ENOUGH_MEMORY. I therefore reduced the >>> Queue size by 5 times and it was then successful. >>> The way I extracted the errno in beginning days is same as I did >>> today. So I epxected a value which >>tells the actual reason of >>> semTake failure. But I got this huge value which is -1. Am I >>> missing something ? > The thing is printErrno is a xenomai posix skin function which knows S_memlib_NOT_ENOUGH_MEMORY, strerror is an unrelated glibc function, and does not. What you are missing is this comment in ksrc/skins/vxworks/syscall.c /* * By convention, error codes are passed back through the syscall * return value: * - negative codes stand for internal (i.e. nucleus) errors; * - strictly positive values stand for genuine VxWorks errors. * - zero means success. * Looking at the code, I think after a service returns an error, it may be more reliable to use errno than to use errnoOfTaskGet. > 1 is EPERM. Is the thread issuing the call a thread created by > Xenomai? > >>> Samba: Yes. I guess taskSpawn leads finally to Xenomai libraries to >>> create thread. All our VxWorks code(with minor changes) as it is >>> running on top of Xenomai. Please tell me, What will you suggest me >>> then ? Trace the kernel code to know the reason for semTake to return -EPERM. Another reason documented in txt/vxworks/skin.txt maybe that you are calling semTake in a region where the scheduler has been locked (using taskLock). NOTE: it would be nice if you could formats your mails as everybody does: quote the mail you reply to by prepending " >" to the beginning of the lines you are quoting, and do not put ">" characters in front of the lines you add. -- Gilles. This email and any attachment may contain confidential information which is intended for use only by the addressee(s) named above. If you received this email by mistake, please notify the sender immediately, and delete the email from your system. You are prohibited from copying, disseminating or otherwise using the email or any attachment. ^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2011-08-05 6:48 UTC | newest] Thread overview: 12+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2011-08-03 10:15 [Xenomai-help] Xenomai VxWorks Skin--->semTake Sambasiva Rao Manchili 2011-08-03 11:27 ` Philippe Gerum 2011-08-03 12:44 ` Sambasiva Rao Manchili 2011-08-03 13:17 ` Gilles Chanteperdrix 2011-08-03 13:31 ` Sambasiva Rao Manchili 2011-08-03 13:53 ` Philippe Gerum 2011-08-03 14:30 ` Sambasiva Rao Manchili 2011-08-03 14:40 ` Philippe Gerum 2011-08-03 14:03 ` Gilles Chanteperdrix 2011-08-03 14:24 ` Sambasiva Rao Manchili 2011-08-03 15:19 ` Gilles Chanteperdrix 2011-08-05 6:48 ` Sambasiva Rao Manchili
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.