[Xenomai] Mixing Posix RT APIs and vxWorks APIs

Alex Plits alex_plits at radwin.com
Mon Apr 25 13:42:23 CEST 2016



> -----Original Message-----
> From: Philippe Gerum [mailto:rpm at xenomai.org]
> Sent: Monday, April 25, 2016 1:42 PM
> To: Alex Plits; Gilles Chanteperdrix
> Cc: xenomai at xenomai.org
> Subject: Re: [Xenomai] Mixing Posix RT APIs and vxWorks APIs
> 
> On 04/25/2016 12:38 PM, Philippe Gerum wrote:
> > On 04/25/2016 12:03 PM, Alex Plits wrote:
> >>
> >>
> >>> -----Original Message-----
> >>> From: Philippe Gerum [mailto:rpm at xenomai.org]
> >>> Sent: Thursday, April 07, 2016 8:56 PM
> >>> To: Alex Plits; Gilles Chanteperdrix
> >>> Cc: xenomai at xenomai.org
> >>> Subject: Re: [Xenomai] Mixing Posix RT APIs and vxWorks APIs
> >>>
> >>> On 04/07/2016 07:56 AM, Alex Plits wrote:
> >>>>
> >>>>
> >>>>> -----Original Message-----
> >>>>> From: Gilles Chanteperdrix
> >>>>> [mailto:gilles.chanteperdrix at xenomai.org]
> >>>>> Sent: Tuesday, April 05, 2016 10:03 AM
> >>>>> To: Alex Plits
> >>>>> Cc: xenomai at xenomai.org
> >>>>> Subject: Re: [Xenomai] Mixing Posix RT APIs and vxWorks APIs
> >>>>>
> >>>>> On Mon, Apr 04, 2016 at 01:42:11PM +0000, Alex Plits wrote:
> >>>>>> Hi,
> >>>>>>
> >>>>>> We are currently porting some of our vxWorks  xenomai
> >>>>>> (copperplate) APIs we use in our application to Posix (cobalt I guess).
> >>>>>
> >>>>> Well, if you do not know whether you are using Cobalt or Mercury,
> >>>>> we can not know it for you...
> >>>> [Alex Plits]
> >>>> Cobalt :)
> >>>>>
> >>>>>> We have started with the VxWorks "tasks" but it seems that we're
> >>>>>> getting strange behavior on The remaining VxWorks APIs when used
> >>>>>> from
> >>>>> the POSIX generated tasks (threads is the right word in posix) e.g.
> >>>>> MsqQRecv function gets segfault but when it is used From a VxWorks
> >>>>> generated task it works fine.
> >>>>>> I understand from the comments in code it should work but I was
> >>>>> wondering if there are known issues.
> >>>>>>
> >>>>>> We are using currently xenomai 3 rc-6 (I saw there were fixes in
> >>>>>> xenomai
> >>>>> 3.0.2).
> >>>>>
> >>>>> Could you send a self-contained, simplest possible test case which
> >>>>> causes the problem for you, that we can test on the latest Xenomai
> >>>>> release to see if the problem has not been already fixed?
> >>>>>
> >>>> [Alex Plits]
> >>>> Attached code that is ripped from xenomai examples and initiates 2
> >>> threads using posix api then uses VxWorks MsgQ to communicate.
> >>>> Please advise if this code works as expected -  it seems that when
> >>>> we use
> >>> WAIT_FOREVER flag we have an issue.
> >>>>
> >>>> Sorry in advance for the #ifdef's and comments in code -
> >>>
> >>> For the record, 3.0-rc6 won't work properly with --enable-pshared
> setups.
> >>> For sane shared processing involving multiple copperplate-based APIs
> >>> (such as VxWorks), you do need 3.0.2.
> >> [Alex Plits]
> >> We have configured --enable-pshared on xenomai 3.0.2 and now
> >> compiling empty application (just empty main routine) using non posix
> skin e.g. vxworks or even alchemy causes the "Bus error" in runtime(see
> below). Removing --enable-pshared bootstrap completes successfully.
> >>
> >> # ./posixvx --trace=1
> >> --  xenomai_init() running
> >> --  cobalt->init()
> >> --  connected to Cobalt
> >> --  memory locked
> >> --  memory heaps mapped
> >> --  boilerplate->init()
> >> --  copperplate->init()
> >> Bus error
> >
> > gdb backtrace?
> >
> >
> 
> The output of posixvx --dump-config is needed as well.
[Alex Plits] 
See below --dump-config , working to get the gdb backtrace.

# ./posixvx 
Bus error
# ./posixvx --dump-config 
based on Xenomai/cobalt v3.0.2
CONFIG_MMU=1
CONFIG_SMP=1
CONFIG_XENO_BUILD_ARGS=" '--target=arm-openwrt-linux' '--host=arm-openwrt-linux' '--build=x86_64-linux-gnu' '--program-prefix=' '--program-suffix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--libexecdir=/usr/lib' '--sysconfdir=/etc' '--datadir=/usr/share' '--localstatedir=/var' '--mandir=/usr/man' '--infodir=/usr/info' '--disable-nls' '--with-core=cobalt' '--enable-smp' '--enable-lores-clock' '--enable-pshared' 'build_alias=x86_64-linux-gnu' 'host_alias=arm-openwrt-linux' 'target_alias=arm-openwrt-linux' 'CC=arm-openwrt-linux-uclibcgnueabi-gcc' 'CFLAGS=-Os -pipe -march=armv7-a -mtune=cortex-a7 -fno-caller-saves -fstack-protector -Wl,-z,relro,-z,now -fhonour-copts -Wno-error=unused-but-set-variable -mfloat-abi=soft ' 'LDFLAGS=-L/media/HD/SDK/PLATFORM/SDK/staging_dir/target-arm_cortex-a7_uClibc-0.9.33.2_eabi/usr/lib -L/media/HD/SDK/PLATFORM/SDK/staging_dir/target-arm_cortex-a7_uClibc-0.9.33.2_eabi/lib -Wl,-z,relro,-z,now -L/media/HD/SDK/PLATFORM/SDK/staging_dir/toolchain-arm_cortex-a7_gcc-4.8-linaro_uClibc-0.9.33.2_eabi/usr/lib -L/media/HD/SDK/PLATFORM/SDK/staging_dir/toolchain-arm_cortex-a7_gcc-4.8-linaro_uClibc-0.9.33.2_eabi/lib ' 'CPPFLAGS=-I/media/HD/SDK/PLATFORM/SDK/staging_dir/target-arm_cortex-a7_uClibc-0.9.33.2_eabi/usr/include -I/media/HD/SDK/PLATFORM/SDK/staging_dir/target-arm_cortex-a7_uClibc-0.9.33.2_eabi/include -I/media/HD/SDK/PLATFORM/SDK/staging_dir/toolchain-arm_cortex-a7_gcc-4.8-linaro_uClibc-0.9.33.2_eabi/usr/include -I/media/HD/SDK/PLATFORM/SDK/staging_dir/toolchain-arm_cortex-a7_gcc-4.8-linaro_uClibc-0.9.33.2_eabi/include ' 'PKG_CONFIG=/media/HD/SDK/PLATFORM/SDK/staging_dir/host/bin/pkg-config' 'PKG_CONFIG_PATH=/media/HD/SDK/PLATFORM/SDK/staging_dir/target-arm_cortex-a7_uClibc-0.9.33.2_eabi/usr/lib/pkgconfig:/media/HD/SDK/PLATFORM/SDK/staging_dir/target-arm_cortex-a7_uClibc-0.9.33.2_eabi/usr/share/pkgconfig' 'PKG_CONFIG_LIBDIR=/media/HD/SDK/PLATFORM/SDK/staging_dir/target-arm_cortex-a7_uClibc-0.9.33.2_eabi/usr/lib/pkgconfig:/media/HD/SDK/PLATFORM/SDK/staging_dir/target-arm_cortex-a7_uClibc-0.9.33.2_eabi/usr/share/pkgconfig'"
CONFIG_XENO_BUILD_STRING="x86_64-pc-linux-gnu"
CONFIG_XENO_COBALT=1
CONFIG_XENO_COMPILER="gcc version 4.8.3 (OpenWrt/Linaro GCC 4.8-2014.01 r43761) "
CONFIG_XENO_DEFAULT_PERIOD=1000000
CONFIG_XENO_HOST_STRING="arm-openwrt-linux-gnu"
CONFIG_XENO_PREFIX="/usr"
CONFIG_XENO_PSHARED=1
CONFIG_XENO_RAW_CLOCK_ENABLED=1
CONFIG_XENO_REVISION_LEVEL=2
CONFIG_XENO_SANITY=1
CONFIG_XENO_TLSF=1
CONFIG_XENO_TLS_MODEL="initial-exec"
CONFIG_XENO_UAPI_LEVEL=14
CONFIG_XENO_VERSION_MAJOR=3
CONFIG_XENO_VERSION_MINOR=0
CONFIG_XENO_VERSION_NAME="Exact Zero"
CONFIG_XENO_VERSION_STRING="3.0.2"
CONFIG_XENO_X86_VSYSCALL=1
---
CONFIG_XENO_ASYNC_CANCEL is OFF
CONFIG_XENO_COPPERPLATE_CLOCK_RESTRICTED is OFF
CONFIG_XENO_DEBUG is OFF
CONFIG_XENO_DEBUG_FULL is OFF
CONFIG_XENO_FORTIFY is OFF
CONFIG_XENO_LIBS_DLOPEN is OFF
CONFIG_XENO_LORES_CLOCK_DISABLED is OFF
CONFIG_XENO_MERCURY is OFF
CONFIG_XENO_REGISTRY is OFF
CONFIG_XENO_REGISTRY_ROOT is OFF
CONFIG_XENO_VALGRIND_API is OFF
CONFIG_XENO_WORKAROUND_CONDVAR_PI is OFF
---
PTHREAD_STACK_DEFAULT=65536

> 
> --
> Philippe.



More information about the Xenomai mailing list