From mboxrd@z Thu Jan 1 00:00:00 1970 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C97D8D.6EE81558" Date: Fri, 23 Jan 2009 12:04:35 -0700 Message-ID: <51CAD0CE1504444DBE77CBBE51A0135D5908A3@domain.hid> From: "Steven Seeger" Subject: [Xenomai-help] shadow task and rt_task_self() List-Id: Help regarding installation and common use of Xenomai List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: xenomai@xenomai.org This is a multi-part message in MIME format. ------_=_NextPart_001_01C97D8D.6EE81558 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Using the latest xenomai we seem to always get back NULL from a shadow task using rt_task_self(). We used to get something valid with r3415. Any idea? =20 Thanks, Steven =20 ------_=_NextPart_001_01C97D8D.6EE81558 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Using the latest xenomai we seem to always get back = NULL from a shadow task using rt_task_self(). We used to get something valid = with r3415. Any idea?

 

Thanks,
Steven

 

------_=_NextPart_001_01C97D8D.6EE81558-- From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <497A1963.8030902@domain.hid> Date: Fri, 23 Jan 2009 20:24:19 +0100 From: Gilles Chanteperdrix MIME-Version: 1.0 References: <51CAD0CE1504444DBE77CBBE51A0135D5908A3@domain.hid> In-Reply-To: <51CAD0CE1504444DBE77CBBE51A0135D5908A3@domain.hid> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Xenomai-help] shadow task and rt_task_self() List-Id: Help regarding installation and common use of Xenomai List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Steven Seeger Cc: xenomai@xenomai.org Steven Seeger wrote: > Using the latest xenomai we seem to always get back NULL from a shadow > task using rt_task_self(). We used to get something valid with r3415. > Any idea? Please send us a little test program that we can run to observe the issue. And tell us which branch has the problem trunk or v2.4.x? -- Gilles. From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <497A1E95.4080805@domain.hid> Date: Fri, 23 Jan 2009 20:46:29 +0100 From: Gilles Chanteperdrix MIME-Version: 1.0 References: <51CAD0CE1504444DBE77CBBE51A0135D5908A3@domain.hid> <497A1963.8030902@domain.hid> <51CAD0CE1504444DBE77CBBE51A0135D5908A4@domain.hid> In-Reply-To: <51CAD0CE1504444DBE77CBBE51A0135D5908A4@domain.hid> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Xenomai-help] shadow task and rt_task_self() List-Id: Help regarding installation and common use of Xenomai List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Steven Seeger Cc: xenomai@xenomai.org Steven Seeger wrote: > Gilles, the problem is very simple. The initial task has self->opaque > set to XN_NO_HANDLE. After you shadow that task, rt_task_self() still > returns NULL. > > This is either an oversight or you aren't supposed to shadow the initial > task? Maybe, but please do the work of writing the simplest example. Maybe you will discover that it is something else in your bigger example that causes it. And you still did not tell me if this is a trunk issue or a v2.4.x branch issue. -- Gilles. From mboxrd@z Thu Jan 1 00:00:00 1970 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----_=_NextPart_001_01C97D93.D7D1F008" Date: Fri, 23 Jan 2009 12:50:27 -0700 Message-ID: <51CAD0CE1504444DBE77CBBE51A0135D5908A5@domain.hid> In-Reply-To: <497A1E95.4080805@domain.hid> References: <51CAD0CE1504444DBE77CBBE51A0135D5908A3@domain.hid> <497A1963.8030902@domain.hid> <51CAD0CE1504444DBE77CBBE51A0135D5908A4@domain.hid> <497A1E95.4080805@domain.hid> From: "Steven Seeger" Subject: Re: [Xenomai-help] shadow task and rt_task_self() List-Id: Help regarding installation and common use of Xenomai List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gilles Chanteperdrix Cc: xenomai@xenomai.org This is a multi-part message in MIME format. ------_=_NextPart_001_01C97D93.D7D1F008 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Gilles, Attached is my simple test that repeats this problem. Output is: 0 0 0 This is using latest xenomai trunk. Thanks, Steven > -----Original Message----- > From: Gilles Chanteperdrix [mailto:gilles.chanteperdrix@xenomai.org] > Sent: Friday, January 23, 2009 12:46 PM > To: Steven Seeger > Cc: xenomai@xenomai.org > Subject: Re: [Xenomai-help] shadow task and rt_task_self() >=20 > Steven Seeger wrote: > > Gilles, the problem is very simple. The initial task has self->opaque > > set to XN_NO_HANDLE. After you shadow that task, rt_task_self() still > > returns NULL. > > > > This is either an oversight or you aren't supposed to shadow the > initial > > task? >=20 > Maybe, but please do the work of writing the simplest example. Maybe > you > will discover that it is something else in your bigger example that > causes it. And you still did not tell me if this is a trunk issue or a > v2.4.x branch issue. >=20 > -- > Gilles. ------_=_NextPart_001_01C97D93.D7D1F008 Content-Type: application/octet-stream; name="self.cpp" Content-Transfer-Encoding: base64 Content-Description: self.cpp Content-Disposition: attachment; filename="self.cpp" I2luY2x1ZGUgPHN5cy9tbWFuLmg+CiNpbmNsdWRlIDxpb3N0cmVhbT4KI2luY2x1ZGUgPG5hdGl2 ZS90YXNrLmg+Ci8vI2luY2x1ZGUgImkzODcuaCIKCnN0YXRpYyBSVF9UQVNLIHNoYWRvd2VkX3Rh c2s7CgppbnQgbWFpbigpCnsKICAgaW50IHJldDsKICAgCiAgICBtbG9ja2FsbChNQ0xfQ1VSUkVO VCB8IE1DTF9GVVRVUkUpOwoKICAgIHN0ZDo6Y291dCA8PCAodm9pZCopcnRfdGFza19zZWxmKCkg PDwgc3RkOjplbmRsOwogICAgCiAgICByZXQgPSBydF90YXNrX3NoYWRvdygmc2hhZG93ZWRfdGFz aywgInNoYWRvdyB0ZXN0IiwgMSwgMCk7CiAgICBzdGQ6OmNvdXQgPDwgKHZvaWQqKXJ0X3Rhc2tf c2VsZigpIDw8ICcgJyA8PCByZXQgPDwgc3RkOjplbmRsOwogICAgICAgIAogICAgcmV0dXJuIDA7 Cn0K ------_=_NextPart_001_01C97D93.D7D1F008-- From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <497A2344.8060605@domain.hid> Date: Fri, 23 Jan 2009 21:06:28 +0100 From: Gilles Chanteperdrix MIME-Version: 1.0 References: <51CAD0CE1504444DBE77CBBE51A0135D5908A3@domain.hid> <497A1963.8030902@domain.hid> <51CAD0CE1504444DBE77CBBE51A0135D5908A4@domain.hid> <497A1E95.4080805@domain.hid> <51CAD0CE1504444DBE77CBBE51A0135D5908A5@domain.hid> In-Reply-To: <51CAD0CE1504444DBE77CBBE51A0135D5908A5@domain.hid> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Xenomai-help] shadow task and rt_task_self() List-Id: Help regarding installation and common use of Xenomai List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Steven Seeger Cc: xenomai@xenomai.org Steven Seeger wrote: > Gilles, > > Attached is my simple test that repeats this problem. > > Output is: > > 0 > 0 0 > > This is using latest xenomai trunk. > Ok. Try this: Index: src/skins/native/task.c =================================================================== --- src/skins/native/task.c (revision 4570) +++ src/skins/native/task.c (working copy) @@ -210,8 +210,12 @@ int rt_task_shadow(RT_TASK *task, const err = XENOMAI_SKINCALL2(__native_muxid, __native_task_create, &bulk, NULL); - if (!err) + if (!err) { +#ifdef HAVE___THREAD + __native_self = *task; +#endif /* HAVE___THREAD */ xeno_set_current(); + } return err; } -- Gilles. From mboxrd@z Thu Jan 1 00:00:00 1970 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Date: Fri, 23 Jan 2009 13:11:51 -0700 Message-ID: <51CAD0CE1504444DBE77CBBE51A0135D5908A8@domain.hid> In-Reply-To: <497A2344.8060605@domain.hid> References: <51CAD0CE1504444DBE77CBBE51A0135D5908A3@domain.hid> <497A1963.8030902@domain.hid> <51CAD0CE1504444DBE77CBBE51A0135D5908A4@domain.hid> <497A1E95.4080805@domain.hid> <51CAD0CE1504444DBE77CBBE51A0135D5908A5@domain.hid> <497A2344.8060605@domain.hid> From: "Steven Seeger" Subject: Re: [Xenomai-help] shadow task and rt_task_self() List-Id: Help regarding installation and common use of Xenomai List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gilles Chanteperdrix Cc: xenomai@xenomai.org That worked perfectly. Or at the very least, did not return NULL. :)=20 Thank you! Steven > -----Original Message----- > From: Gilles Chanteperdrix [mailto:gilles.chanteperdrix@xenomai.org] > Sent: Friday, January 23, 2009 1:06 PM > To: Steven Seeger > Cc: xenomai@xenomai.org > Subject: Re: [Xenomai-help] shadow task and rt_task_self() >=20 > Steven Seeger wrote: > > Gilles, > > > > Attached is my simple test that repeats this problem. > > > > Output is: > > > > 0 > > 0 0 > > > > This is using latest xenomai trunk. > > >=20 > Ok. Try this: >=20 > Index: src/skins/native/task.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- src/skins/native/task.c (revision 4570) > +++ src/skins/native/task.c (working copy) > @@ -210,8 +210,12 @@ int rt_task_shadow(RT_TASK *task, const > err =3D XENOMAI_SKINCALL2(__native_muxid, __native_task_create, > &bulk, > NULL); >=20 > - if (!err) > + if (!err) { > +#ifdef HAVE___THREAD > + __native_self =3D *task; > +#endif /* HAVE___THREAD */ > xeno_set_current(); > + } >=20 > return err; > } >=20 >=20 > -- > Gilles. From mboxrd@z Thu Jan 1 00:00:00 1970 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Date: Fri, 23 Jan 2009 12:43:15 -0700 Message-ID: <51CAD0CE1504444DBE77CBBE51A0135D5908A4@domain.hid> In-Reply-To: <497A1963.8030902@domain.hid> References: <51CAD0CE1504444DBE77CBBE51A0135D5908A3@domain.hid> <497A1963.8030902@domain.hid> From: "Steven Seeger" Subject: Re: [Xenomai-help] shadow task and rt_task_self() List-Id: Help regarding installation and common use of Xenomai List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gilles Chanteperdrix Cc: xenomai@xenomai.org Gilles, the problem is very simple. The initial task has self->opaque set to XN_NO_HANDLE. After you shadow that task, rt_task_self() still returns NULL. This is either an oversight or you aren't supposed to shadow the initial task? Thanks, Steven > -----Original Message----- > From: Gilles Chanteperdrix [mailto:gilles.chanteperdrix@xenomai.org] > Sent: Friday, January 23, 2009 12:24 PM > To: Steven Seeger > Cc: xenomai@xenomai.org > Subject: Re: [Xenomai-help] shadow task and rt_task_self() >=20 > Steven Seeger wrote: > > Using the latest xenomai we seem to always get back NULL from a > shadow > > task using rt_task_self(). We used to get something valid with r3415. > > Any idea? >=20 > Please send us a little test program that we can run to observe the > issue. And tell us which branch has the problem trunk or v2.4.x? >=20 > -- > Gilles.