Skip to contentSkip to conversation

Xenomai 3 - no skin detected in program

Xenomai Huy Cong Vu 2 participants 11 messages Feb 4, 2015 – Feb 5, 2015

lore
Share & tools
lore
#0 lore raw

Hello everyone,
I recently try to run an application compiled in native skin of Xenomai 3. When trying to run the binary, these line appeared:
WARNING: [main] no skin detected in program

BUG: [main] initialization failed, EINVAL 

I know that this is a cooperplate_init() warning when trying to initialize native skin, but I don't understand the reason why:
if (pvlist_empty(&skins)){
warning("no skin detected in program");
ret = -EINVAL;
goto fail;
}
In my main(), there are still native API calls:
rt_print_auto_init(1);
rt_task_spawn(...);
rt_task_join(...);
rt_task_delete(...);
with mlockall also just to make sure, even I know that is pre-initialize since Xenomai 2.6.
I have xenomai-3-next patched on linux-3.14.17, here are my compilation flags:
cflags:
xeno-config --alchemy --cflags
xeno-config --rtdm --cflags
ldflags:
xeno-config --alchemy --ldflags
xeno-config --rtdm --ldflags

This issue is not reproduced with posix skin, I know that there are a mechanism change in the way Xenomai invoke function calls other than POSIX (alchemy, vxworks...):
https://xenomai.org//migrating-from-xenomai-2-x-to-3-x/#Copperplate_auto-initialization
Is this related with my issue? Is there anything I should add to my initialization process that I didn't know about?
Thanks for your time,

Signature · 2 lines
Huy Cong 
Wandercraft SAS 
#1 lore raw
Quoted 10 lines · Huy Cong Vu

Hello everyone,
I recently try to run an application compiled in native skin of Xenomai 3. When trying to run the binary, these line appeared:
WARNING: [main] no skin detected in program

BUG: [main] initialization failed, EINVAL 

I know that this is a cooperplate_init() warning when trying to initialize native skin, but I don't understand the reason why:
if (pvlist_empty(&skins)){
warning("no skin detected in program");
ret = -EINVAL;
goto fail;
}

It seems that your application was not linked against libalchemy.so. When API libraries are properly linked in, internal constructor routines populate this list. POSIX support is built-in within the Cobalt interface, so it won't appear here though.

You may want to check this with ldd.

Quoted 5 lines

In my main(), there are still native API calls:
rt_print_auto_init(1);
rt_task_spawn(...);
rt_task_join(...);
rt_task_delete(...);

Quoted 8 lines

with mlockall also just to make sure, even I know that is pre-initialize since Xenomai 2.6. I have xenomai-3-next patched on linux-3.14.17, here are my compilation flags:
cflags:
xeno-config --alchemy --cflags
xeno-config --rtdm --cflags
ldflags:
xeno-config --alchemy --ldflags
xeno-config --rtdm --ldflags

You should not mention --rtdm for userland apps, this is useless for Xenomai 3. This has been kept for compatibility purpose with existing application Makefiles targeting Xenomai 2.x.

Quoted 6 lines

This issue is not reproduced with posix skin, I know that there are a mechanism change in the way Xenomai invoke function calls other than POSIX (alchemy, vxworks...):
https://xenomai.org//migrating-from-xenomai-2-x-to-3-x/#Copperplate_auto-initialization
Is this related with my issue? Is there anything I should add to my initialization process that I didn't know about?
Thanks for your time,

Check lib/alchemy/testsuite for a working Makefile you could derive yours from.

Signature · 1 line
Philippe.
#2 lore raw

----- Mail original -----

Quoted 19 lines

De: "Philippe Gerum" <[email protected]>
À: "Huy Cong Vu" <[email protected]>, [email protected] Envoyé: Mercredi 4 Février 2015 10:13:14
Objet: Re: [Xenomai] Xenomai 3 - no skin detected in program

Quoted 4 lines · Huy Cong Vu

Hello everyone,
I recently try to run an application compiled in native skin of Xenomai 3. When trying to run the binary, these line appeared:
WARNING: [main] no skin detected in program

Quoted 8 lines
BUG: [main] initialization failed, EINVAL

I know that this is a cooperplate_init() warning when trying to initialize native skin, but I don't understand the reason why:
if (pvlist_empty(&skins)){
warning("no skin detected in program");
ret = -EINVAL;
goto fail;
}

Quoted 7 lines

It seems that your application was not linked against libalchemy.so. When API libraries are properly linked in, internal constructor routines populate this list. POSIX support is built-in within the Cobalt interface, so it won't appear here though.

You may want to check this with ldd.

Indeed, I'm working on the linking option to find out why, it seems that -ffunctions-sections and -Wl,--gc-sections hides the -lalchemy flag so I removed it.

Quoted 15 lines
Quoted 6 lines

In my main(), there are still native API calls:
rt_print_auto_init(1);
rt_task_spawn(...);
rt_task_join(...);
rt_task_delete(...);
with mlockall also just to make sure, even I know that is pre-initialize since

Quoted 8 lines

Xenomai 2.6.
I have xenomai-3-next patched on linux-3.14.17, here are my compilation flags:
cflags:
xeno-config --alchemy --cflags
xeno-config --rtdm --cflags
ldflags:
xeno-config --alchemy --ldflags
xeno-config --rtdm --ldflags

Quoted 4 lines

You should not mention --rtdm for userland apps, this is useless for Xenomai 3. This has been kept for compatibility purpose with existing application Makefiles targeting Xenomai 2.x.

But what if one of my static library calls from rtdm? Which flags should I add then if I can't use xeno-config --rtdm anymore?

Quoted 15 lines
Quoted 9 lines

This issue is not reproduced with posix skin, I know that there are a mechanism change in the way Xenomai invoke function calls other than POSIX (alchemy, vxworks...):
https://xenomai.org//migrating-from-xenomai-2-x-to-3-x/#Copperplate_auto-initialization
Is this related with my issue? Is there anything I should add to my initialization process that I didn't know about?
Thanks for your time,

Check lib/alchemy/testsuite for a working Makefile you could derive yours from.

--
Philippe.

Signature · 2 lines
Huy Cong
Wandercraft SAS
#3 lore raw

----- Mail original -----

Quoted 6 lines

De: "Huy Cong Vu" <[email protected]>
À: "Philippe Gerum" <[email protected]>
Cc: [email protected]
Envoyé: Mercredi 4 Février 2015 12:07:54
Objet: Re: [Xenomai] Xenomai 3 - no skin detected in program

Quoted 25 lines

----- Mail original -----

Quoted 24 lines

De: "Philippe Gerum" <[email protected]>
À: "Huy Cong Vu" <[email protected]>, [email protected] Envoyé: Mercredi 4 Février 2015 10:13:14
Objet: Re: [Xenomai] Xenomai 3 - no skin detected in program

Quoted 4 lines · Huy Cong Vu

Hello everyone,
I recently try to run an application compiled in native skin of Xenomai 3. When trying to run the binary, these line appeared:
WARNING: [main] no skin detected in program

Quoted 8 lines
BUG: [main] initialization failed, EINVAL

I know that this is a cooperplate_init() warning when trying to initialize native skin, but I don't understand the reason why:
if (pvlist_empty(&skins)){
warning("no skin detected in program");
ret = -EINVAL;
goto fail;
}

It seems that your application was not linked against libalchemy.so. When API libraries are properly linked in, internal constructor routines populate this list. POSIX support is built-in within the Cobalt interface, so it won't appear here though.

I change the order of the linker flags, now my app is linked against libalchemy.so, but this message shown up:
symbol lookup error: /usr/xenomai/lib/libcopperplate.so.0: undefined symbol: main

I guess that it stills a problem due to the linker flag, am I right?

Quoted 54 lines
Quoted 2 lines

You may want to check this with ldd.

Indeed, I'm working on the linking option to find out why, it seems that -ffunctions-sections and -Wl,--gc-sections hides the -lalchemy flag so I removed it.

Quoted 15 lines
Quoted 6 lines

In my main(), there are still native API calls:
rt_print_auto_init(1);
rt_task_spawn(...);
rt_task_join(...);
rt_task_delete(...);
with mlockall also just to make sure, even I know that is pre-initialize since

Quoted 8 lines

Xenomai 2.6.
I have xenomai-3-next patched on linux-3.14.17, here are my compilation flags:
cflags:
xeno-config --alchemy --cflags
xeno-config --rtdm --cflags
ldflags:
xeno-config --alchemy --ldflags
xeno-config --rtdm --ldflags

Quoted 4 lines

You should not mention --rtdm for userland apps, this is useless for Xenomai 3. This has been kept for compatibility purpose with existing application Makefiles targeting Xenomai 2.x.

But what if one of my static library calls from rtdm? Which flags should I add then if I can't use xeno-config --rtdm anymore?

Quoted 10 lines
Quoted 9 lines

This issue is not reproduced with posix skin, I know that there are a mechanism change in the way Xenomai invoke function calls other than POSIX (alchemy, vxworks...):
https://xenomai.org//migrating-from-xenomai-2-x-to-3-x/#Copperplate_auto-initialization
Is this related with my issue? Is there anything I should add to my initialization process that I didn't know about?
Thanks for your time,

Quoted 5 lines

Check lib/alchemy/testsuite for a working Makefile you could derive yours from.

--
Philippe.

--
Huy Cong
Wandercraft SAS

_______________________________________________
Xenomai mailing list
[email protected]
http://www.xenomai.org/mailman/listinfo/xenomai

Signature · 2 lines
Huy Cong
Wandercraft SAS
#10 lore raw
In reply to Huy Cong Vu
Quoted 47 lines · Huy Cong Vu

----- Mail original -----

Quoted 19 lines

De: "Philippe Gerum" <[email protected]>
À: "Huy Cong Vu" <[email protected]>, [email protected] Envoyé: Mercredi 4 Février 2015 10:13:14
Objet: Re: [Xenomai] Xenomai 3 - no skin detected in program

Quoted 4 lines · Huy Cong Vu

Hello everyone,
I recently try to run an application compiled in native skin of Xenomai 3. When trying to run the binary, these line appeared:
WARNING: [main] no skin detected in program

Quoted 8 lines
BUG: [main] initialization failed, EINVAL

I know that this is a cooperplate_init() warning when trying to initialize native skin, but I don't understand the reason why:
if (pvlist_empty(&skins)){
warning("no skin detected in program");
ret = -EINVAL;
goto fail;
}

Quoted 7 lines

It seems that your application was not linked against libalchemy.so. When API libraries are properly linked in, internal constructor routines populate this list. POSIX support is built-in within the Cobalt interface, so it won't appear here though.

You may want to check this with ldd.

Indeed, I'm working on the linking option to find out why, it seems that -ffunctions-sections and -Wl,--gc-sections hides the -lalchemy flag so I removed it.

Quoted 15 lines
Quoted 14 lines

In my main(), there are still native API calls:
rt_print_auto_init(1);
rt_task_spawn(...);
rt_task_join(...);
rt_task_delete(...);
with mlockall also just to make sure, even I know that is pre-initialize since Xenomai 2.6.
I have xenomai-3-next patched on linux-3.14.17, here are my compilation flags:
cflags:
xeno-config --alchemy --cflags
xeno-config --rtdm --cflags
ldflags:
xeno-config --alchemy --ldflags
xeno-config --rtdm --ldflags

Quoted 7 lines
Quoted 4 lines

You should not mention --rtdm for userland apps, this is useless for Xenomai 3. This has been kept for compatibility purpose with existing application Makefiles targeting Xenomai 2.x.

But what if one of my static library calls from rtdm? Which flags should I add then if I can't use xeno-config --rtdm anymore?

None, it's available as a built-in feature of the POSIX API over cobalt.

Signature · 1 line
Philippe.
#4 lore raw
In reply to Huy Cong Vu
Quoted 34 lines · Huy Cong Vu

----- Mail original -----

Quoted 6 lines

De: "Huy Cong Vu" <[email protected]>
À: "Philippe Gerum" <[email protected]>
Cc: [email protected]
Envoyé: Mercredi 4 Février 2015 12:07:54
Objet: Re: [Xenomai] Xenomai 3 - no skin detected in program

Quoted 25 lines

----- Mail original -----

Quoted 24 lines

De: "Philippe Gerum" <[email protected]>
À: "Huy Cong Vu" <[email protected]>, [email protected] Envoyé: Mercredi 4 Février 2015 10:13:14
Objet: Re: [Xenomai] Xenomai 3 - no skin detected in program

Quoted 4 lines · Huy Cong Vu

Hello everyone,
I recently try to run an application compiled in native skin of Xenomai 3. When trying to run the binary, these line appeared:
WARNING: [main] no skin detected in program

Quoted 8 lines
BUG: [main] initialization failed, EINVAL

I know that this is a cooperplate_init() warning when trying to initialize native skin, but I don't understand the reason why:
if (pvlist_empty(&skins)){
warning("no skin detected in program");
ret = -EINVAL;
goto fail;
}

It seems that your application was not linked against libalchemy.so. When API libraries are properly linked in, internal constructor routines populate this list. POSIX support is built-in within the Cobalt interface, so it won't appear here though.

Quoted 5 lines

I change the order of the linker flags, now my app is linked against libalchemy.so, but this message shown up:
symbol lookup error: /usr/xenomai/lib/libcopperplate.so.0: undefined symbol: main

I guess that it stills a problem due to the linker flag, am I right?

Yes. You seem to be using a set of flags with fine-grained tuning, some of which might have an adverse effect on your linking stage. You should start with the set output by xeno-config --ldflags --alchemy which are known to work, then tune gradually as appropriate.

Signature · 1 line
Philippe.
#5 lore raw

----- Mail original -----

Quoted 46 lines

De: "Philippe Gerum" <[email protected]>
À: "Huy Cong Vu" <[email protected]>
Cc: [email protected]
Envoyé: Mercredi 4 Février 2015 14:21:18
Objet: Re: [Xenomai] Xenomai 3 - no skin detected in program

Quoted 39 lines · Huy Cong Vu

----- Mail original -----

Quoted 6 lines

De: "Huy Cong Vu" <[email protected]>
À: "Philippe Gerum" <[email protected]>
Cc: [email protected]
Envoyé: Mercredi 4 Février 2015 12:07:54
Objet: Re: [Xenomai] Xenomai 3 - no skin detected in program

Quoted 25 lines

----- Mail original -----

Quoted 24 lines

De: "Philippe Gerum" <[email protected]>
À: "Huy Cong Vu" <[email protected]>, [email protected] Envoyé: Mercredi 4 Février 2015 10:13:14
Objet: Re: [Xenomai] Xenomai 3 - no skin detected in program

Quoted 4 lines · Huy Cong Vu

Hello everyone,
I recently try to run an application compiled in native skin of Xenomai 3. When trying to run the binary, these line appeared:
WARNING: [main] no skin detected in program

Quoted 8 lines
BUG: [main] initialization failed, EINVAL

I know that this is a cooperplate_init() warning when trying to initialize native skin, but I don't understand the reason why:
if (pvlist_empty(&skins)){
warning("no skin detected in program");
ret = -EINVAL;
goto fail;
}

It seems that your application was not linked against libalchemy.so. When API libraries are properly linked in, internal constructor routines populate this list. POSIX support is built-in within the Cobalt interface, so it won't appear here though.

I change the order of the linker flags, now my app is linked against libalchemy.so, but this message shown up:
symbol lookup error: /usr/xenomai/lib/libcopperplate.so.0: undefined symbol:
main

Quoted 8 lines
Quoted 2 lines

I guess that it stills a problem due to the linker flag, am I right?

Yes. You seem to be using a set of flags with fine-grained tuning, some of which might have an adverse effect on your linking stage. You should start with the set output by xeno-config --ldflags --alchemy which are known to work, then tune gradually as appropriate.

Hi Philippe,

I'm getting close to it, but it still left some undefined reference for rtdm functions.

I prepared a minimal test case attached in this email, which have only 1 call to rtdm_socket. The call to ldflags include only --cobalt, I don't know if its enough. And I can't find a testsuite file in alchemy sample list that have rtdm calls.

Can you take a look and tell me where I was wrong?

Thanks,

Quoted 2 lines

--
Philippe.

Signature · 23 lines
Huy Cong
Wandercraft SAS
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Makefile
Type: text/x-makefile
Size: 560 bytes
Desc: not available
URL: <http://www.xenomai.org/pipermail/xenomai/attachments/20150205/f82d3241/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rtdm_minimal.c
Type: text/x-c++src
Size: 907 bytes
Desc: not available
URL: <http://www.xenomai.org/pipermail/xenomai/attachments/20150205/f82d3241/attachment.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rtdm_minimal.h
Type: text/x-chdr
Size: 319 bytes
Desc: not available
URL: <http://www.xenomai.org/pipermail/xenomai/attachments/20150205/f82d3241/attachment.h>
#6 lore raw
Quoted 58 lines · Huy Cong Vu

----- Mail original -----

Quoted 46 lines

De: "Philippe Gerum" <[email protected]>
À: "Huy Cong Vu" <[email protected]>
Cc: [email protected]
Envoyé: Mercredi 4 Février 2015 14:21:18
Objet: Re: [Xenomai] Xenomai 3 - no skin detected in program

Quoted 39 lines · Huy Cong Vu

----- Mail original -----

Quoted 6 lines

De: "Huy Cong Vu" <[email protected]>
À: "Philippe Gerum" <[email protected]>
Cc: [email protected]
Envoyé: Mercredi 4 Février 2015 12:07:54
Objet: Re: [Xenomai] Xenomai 3 - no skin detected in program

Quoted 25 lines

----- Mail original -----

Quoted 24 lines

De: "Philippe Gerum" <[email protected]>
À: "Huy Cong Vu" <[email protected]>, [email protected] Envoyé: Mercredi 4 Février 2015 10:13:14
Objet: Re: [Xenomai] Xenomai 3 - no skin detected in program

Quoted 4 lines · Huy Cong Vu

Hello everyone,
I recently try to run an application compiled in native skin of Xenomai 3. When trying to run the binary, these line appeared:
WARNING: [main] no skin detected in program

Quoted 8 lines
BUG: [main] initialization failed, EINVAL

I know that this is a cooperplate_init() warning when trying to initialize native skin, but I don't understand the reason why:
if (pvlist_empty(&skins)){
warning("no skin detected in program");
ret = -EINVAL;
goto fail;
}

It seems that your application was not linked against libalchemy.so. When API libraries are properly linked in, internal constructor routines populate this list. POSIX support is built-in within the Cobalt interface, so it won't appear here though.

I change the order of the linker flags, now my app is linked against libalchemy.so, but this message shown up:
symbol lookup error: /usr/xenomai/lib/libcopperplate.so.0: undefined symbol:
main

Quoted 8 lines
Quoted 2 lines

I guess that it stills a problem due to the linker flag, am I right?

Yes. You seem to be using a set of flags with fine-grained tuning, some of which might have an adverse effect on your linking stage. You should start with the set output by xeno-config --ldflags --alchemy which are known to work, then tune gradually as appropriate.

Quoted 4 lines

Hi Philippe,

I'm getting close to it, but it still left some undefined reference for rtdm functions.

rtdm_socket() is a kernel-space API for inter-driver calls, socket() is what you need for creating a RTDM socket endpoint in your application. The Cobalt implementation will be used provided the linker is passed the proper flags (which you Makefile does).

Quoted 1 line

I prepared a minimal test case attached in this email, which have only 1 call to rtdm_socket. The call to ldflags include only --cobalt, I don't know if its enough. And I can't find a testsuite file in alchemy sample list that have rtdm calls.

--cobalt is an alias to --posix, those switches are interchangeable. The Makefile looks ok. See demo/posix/cobalt for examples using RTDM sockets for communicating with the real-time IPC driver.

Quoted 9 lines

Can you take a look and tell me where I was wrong?

Thanks,

Quoted 2 lines

--
Philippe.

Signature · 1 line
Philippe.
#7 lore raw

----- Mail original -----

Quoted 67 lines

De: "Philippe Gerum" <[email protected]>
À: "Huy Cong Vu" <[email protected]>
Cc: [email protected]
Envoyé: Jeudi 5 Février 2015 15:42:15
Objet: Re: [Xenomai] Xenomai 3 - no skin detected in program

Quoted 60 lines · Huy Cong Vu

----- Mail original -----

Quoted 46 lines

De: "Philippe Gerum" <[email protected]>
À: "Huy Cong Vu" <[email protected]>
Cc: [email protected]
Envoyé: Mercredi 4 Février 2015 14:21:18
Objet: Re: [Xenomai] Xenomai 3 - no skin detected in program

Quoted 39 lines · Huy Cong Vu

----- Mail original -----

Quoted 6 lines

De: "Huy Cong Vu" <[email protected]>
À: "Philippe Gerum" <[email protected]>
Cc: [email protected]
Envoyé: Mercredi 4 Février 2015 12:07:54
Objet: Re: [Xenomai] Xenomai 3 - no skin detected in program

Quoted 25 lines

----- Mail original -----

Quoted 24 lines

De: "Philippe Gerum" <[email protected]>
À: "Huy Cong Vu" <[email protected]>, [email protected] Envoyé: Mercredi 4 Février 2015 10:13:14
Objet: Re: [Xenomai] Xenomai 3 - no skin detected in program

Quoted 4 lines · Huy Cong Vu

Hello everyone,
I recently try to run an application compiled in native skin of Xenomai 3. When trying to run the binary, these line appeared:
WARNING: [main] no skin detected in program

Quoted 8 lines
BUG: [main] initialization failed, EINVAL

I know that this is a cooperplate_init() warning when trying to initialize native skin, but I don't understand the reason why:
if (pvlist_empty(&skins)){
warning("no skin detected in program");
ret = -EINVAL;
goto fail;
}

It seems that your application was not linked against libalchemy.so. When API libraries are properly linked in, internal constructor routines populate this list. POSIX support is built-in within the Cobalt interface, so it won't appear here though.

I change the order of the linker flags, now my app is linked against libalchemy.so, but this message shown up:
symbol lookup error: /usr/xenomai/lib/libcopperplate.so.0: undefined symbol:
main

Quoted 8 lines
Quoted 2 lines

I guess that it stills a problem due to the linker flag, am I right?

Yes. You seem to be using a set of flags with fine-grained tuning, some of which might have an adverse effect on your linking stage. You should start with the set output by xeno-config --ldflags --alchemy which are known to work, then tune gradually as appropriate.

Hi Philippe,

Quoted 8 lines
Quoted 3 lines

I'm getting close to it, but it still left some undefined reference for rtdm functions.

rtdm_socket() is a kernel-space API for inter-driver calls, socket() is what you need for creating a RTDM socket endpoint in your application. The Cobalt implementation will be used provided the linker is passed the proper flags (which you Makefile does).

So that means I will always end up in calling socket() for all skins (alchemy or cobalt) and let the linker flags differs it in kernel space? My app is then compilable. But now I have 2 differents behaviors with 2 skins in the same app:

ret1 = setsockopt();
ret2 = ioctl();
ret3 = bind();

cobalt (posix): ret1 = -1, ret2 = ret3 = 0;
alchemy (native): ret1 = 0, ret2 = ret3 = -1;

I put some #define NATIVE or POSIX in my app + xeno-config --alchemy or --cobalt to set flags. Is there a known issue related to this, or it only occurs in my case?

Quoted 23 lines
Quoted 5 lines

I prepared a minimal test case attached in this email, which have only 1 call to rtdm_socket. The call to ldflags include only --cobalt, I don't know if its enough. And I can't find a testsuite file in alchemy sample list that have rtdm calls.

--cobalt is an alias to --posix, those switches are interchangeable. The Makefile looks ok. See demo/posix/cobalt for examples using RTDM sockets for communicating with the real-time IPC driver.

Quoted 9 lines

Can you take a look and tell me where I was wrong?

Thanks,

Quoted 2 lines

--
Philippe.

--
Philippe.

Signature · 2 lines
Huy Cong
Wandercraft SAS
#8 lore raw
Quoted 74 lines · Huy Cong Vu

----- Mail original -----

Quoted 71 lines

De: "Philippe Gerum" <[email protected]>
À: "Huy Cong Vu" <[email protected]>
Cc: [email protected]
Envoyé: Jeudi 5 Février 2015 15:42:15
Objet: Re: [Xenomai] Xenomai 3 - no skin detected in program

Quoted 63 lines · Huy Cong Vu

----- Mail original -----

Quoted 46 lines

De: "Philippe Gerum" <[email protected]>
À: "Huy Cong Vu" <[email protected]>
Cc: [email protected]
Envoyé: Mercredi 4 Février 2015 14:21:18
Objet: Re: [Xenomai] Xenomai 3 - no skin detected in program

Quoted 39 lines · Huy Cong Vu

----- Mail original -----

Quoted 6 lines

De: "Huy Cong Vu" <[email protected]>
À: "Philippe Gerum" <[email protected]>
Cc: [email protected]
Envoyé: Mercredi 4 Février 2015 12:07:54
Objet: Re: [Xenomai] Xenomai 3 - no skin detected in program

Quoted 25 lines

----- Mail original -----

Quoted 24 lines

De: "Philippe Gerum" <[email protected]>
À: "Huy Cong Vu" <[email protected]>, [email protected] Envoyé: Mercredi 4 Février 2015 10:13:14
Objet: Re: [Xenomai] Xenomai 3 - no skin detected in program

Quoted 4 lines · Huy Cong Vu

Hello everyone,
I recently try to run an application compiled in native skin of Xenomai 3. When trying to run the binary, these line appeared:
WARNING: [main] no skin detected in program

Quoted 8 lines
BUG: [main] initialization failed, EINVAL

I know that this is a cooperplate_init() warning when trying to initialize native skin, but I don't understand the reason why:
if (pvlist_empty(&skins)){
warning("no skin detected in program");
ret = -EINVAL;
goto fail;
}

It seems that your application was not linked against libalchemy.so. When API libraries are properly linked in, internal constructor routines populate this list. POSIX support is built-in within the Cobalt interface, so it won't appear here though.

I change the order of the linker flags, now my app is linked against libalchemy.so, but this message shown up:
symbol lookup error: /usr/xenomai/lib/libcopperplate.so.0: undefined symbol:
main

Quoted 8 lines
Quoted 2 lines

I guess that it stills a problem due to the linker flag, am I right?

Yes. You seem to be using a set of flags with fine-grained tuning, some of which might have an adverse effect on your linking stage. You should start with the set output by xeno-config --ldflags --alchemy which are known to work, then tune gradually as appropriate.

Hi Philippe,

I'm getting close to it, but it still left some undefined reference for rtdm functions.

Quoted 6 lines
Quoted 4 lines

rtdm_socket() is a kernel-space API for inter-driver calls, socket() is what you need for creating a RTDM socket endpoint in your application. The Cobalt implementation will be used provided the linker is passed the proper flags (which you Makefile does).

So that means I will always end up in calling socket() for all skins (alchemy or cobalt) and let the linker flags differs it in kernel space?

You should have a look at the related documentation to understand how/when the Xenomai/cobalt implementation of a POSIX service (e.g. socket, ioctl, setsockopt and friends) overrides the original glibc call:

http://xenomai.org/2014/08/porting-a-linux-application-to-xenomai-dual-kernel/#Under_the_hood_the_8211wrap_flag

Quoted 9 lines

My app is then compilable. But now I have 2 differents behaviors with 2 skins in the same app:

ret1 = setsockopt();
ret2 = ioctl();
ret3 = bind();

cobalt (posix): ret1 = -1, ret2 = ret3 = 0;
alchemy (native): ret1 = 0, ret2 = ret3 = -1;

There is no information I could use here. Which RTDM driver is implementing the address family and protocol mentioned in the socket() call, which socket option and ioctl request codes are you passing to this RTDM driver via the setsockopt() and ioctl() calls, what is the errno value for each failing call?

Quoted 1 line

I put some #define NATIVE or POSIX in my app + xeno-config --alchemy or --cobalt to set flags.

The whole thing has been designed in a way that should prevent such kind of ugly #ifdefery. Definitely not the way to go.

Quoted 2 lines

Is there a known issue related to this, or it only occurs in my case?

There is no known issue regarding RTDM sockets and their usage. Again, you have access to several examples in demo/posix/cobalt illustrating RTDM socket usage. You may want to have look there first.

Quoted 24 lines
Quoted 23 lines
Quoted 5 lines

I prepared a minimal test case attached in this email, which have only 1 call to rtdm_socket. The call to ldflags include only --cobalt, I don't know if its enough. And I can't find a testsuite file in alchemy sample list that have rtdm calls.

--cobalt is an alias to --posix, those switches are interchangeable. The Makefile looks ok. See demo/posix/cobalt for examples using RTDM sockets for communicating with the real-time IPC driver.

Quoted 9 lines

Can you take a look and tell me where I was wrong?

Thanks,

Quoted 2 lines

--
Philippe.

--
Philippe.

Signature · 1 line
Philippe.
#9 lore raw
In reply to Huy Cong Vu
Quoted 74 lines · Huy Cong Vu

----- Mail original -----

Quoted 71 lines

De: "Philippe Gerum" <[email protected]>
À: "Huy Cong Vu" <[email protected]>
Cc: [email protected]
Envoyé: Jeudi 5 Février 2015 15:42:15
Objet: Re: [Xenomai] Xenomai 3 - no skin detected in program

Quoted 63 lines · Huy Cong Vu

----- Mail original -----

Quoted 46 lines

De: "Philippe Gerum" <[email protected]>
À: "Huy Cong Vu" <[email protected]>
Cc: [email protected]
Envoyé: Mercredi 4 Février 2015 14:21:18
Objet: Re: [Xenomai] Xenomai 3 - no skin detected in program

Quoted 39 lines · Huy Cong Vu

----- Mail original -----

Quoted 6 lines

De: "Huy Cong Vu" <[email protected]>
À: "Philippe Gerum" <[email protected]>
Cc: [email protected]
Envoyé: Mercredi 4 Février 2015 12:07:54
Objet: Re: [Xenomai] Xenomai 3 - no skin detected in program

Quoted 25 lines

----- Mail original -----

Quoted 24 lines

De: "Philippe Gerum" <[email protected]>
À: "Huy Cong Vu" <[email protected]>, [email protected] Envoyé: Mercredi 4 Février 2015 10:13:14
Objet: Re: [Xenomai] Xenomai 3 - no skin detected in program

Quoted 4 lines · Huy Cong Vu

Hello everyone,
I recently try to run an application compiled in native skin of Xenomai 3. When trying to run the binary, these line appeared:
WARNING: [main] no skin detected in program

Quoted 8 lines
BUG: [main] initialization failed, EINVAL

I know that this is a cooperplate_init() warning when trying to initialize native skin, but I don't understand the reason why:
if (pvlist_empty(&skins)){
warning("no skin detected in program");
ret = -EINVAL;
goto fail;
}

It seems that your application was not linked against libalchemy.so. When API libraries are properly linked in, internal constructor routines populate this list. POSIX support is built-in within the Cobalt interface, so it won't appear here though.

I change the order of the linker flags, now my app is linked against libalchemy.so, but this message shown up:
symbol lookup error: /usr/xenomai/lib/libcopperplate.so.0: undefined symbol:
main

Quoted 8 lines
Quoted 2 lines

I guess that it stills a problem due to the linker flag, am I right?

Yes. You seem to be using a set of flags with fine-grained tuning, some of which might have an adverse effect on your linking stage. You should start with the set output by xeno-config --ldflags --alchemy which are known to work, then tune gradually as appropriate.

Hi Philippe,

I'm getting close to it, but it still left some undefined reference for rtdm functions.

Quoted 6 lines
Quoted 4 lines

rtdm_socket() is a kernel-space API for inter-driver calls, socket() is what you need for creating a RTDM socket endpoint in your application. The Cobalt implementation will be used provided the linker is passed the proper flags (which you Makefile does).

So that means I will always end up in calling socket() for all skins (alchemy or cobalt) and let the linker flags differs it in kernel space?

The API layers for x3 are described here:
http://xenomai.org/start-here/#How_does_Xenomai_deliver_real-time

alchemy is one of the non-POSIX APIs.

Signature · 1 line
Philippe.