All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai] xenomai-3.0-rc5 : binding named semaphores from external process
@ 2015-07-13 13:37 Frederik Bayart
  2015-07-14  9:53 ` Philippe Gerum
  0 siblings, 1 reply; 24+ messages in thread
From: Frederik Bayart @ 2015-07-13 13:37 UTC (permalink / raw)
  To: xenomai@xenomai.org

Hallo,

I have problems to bind named semaphores from an external process using
the alchemy API.  Below a detailed description. Does anyone have a suggestion

what could be wrong or what I could do to solve the problem ?
Kind regards,

Frederik

In attachment an example to reproduce my problem (makefile, stest.c).
If you run 'sudo ./stest 1', a named semaphore is created and a task is started
that binds it and perform a p operation. The main task is waiting on CTRL+C,
and then ask the numer of waiters and performs v operations.
If you run 'sudo ./stest 0', the named semaphore is not created, only a task is
started that binds it and perform a p operation.

I start first 'sudo ./stest 1'. The process binds the semaphore and blocks on rt_sem_p.
The content of /var/run/xenomai is :

xenomai/
xenomai/root
xenomai/root/anon@1262
xenomai/root/anon@1262/1262
xenomai/root/anon@1262/system

Now I execute 'sudo ./stest 0' in another shell.
This process blocks on rt_sem_bind, so the semaphore is not found 

The content of /var/run/xenomai is now :
xenomai/
xenomai/root
xenomai/root/anon@1277
xenomai/root/anon@1277/1277
xenomai/root/anon@1277/system
xenomai/root/anon@1262
xenomai/root/anon@1262/1262
xenomai/root/anon@1262/system

If I press CTRL-C on the first process, I get 

stest.c:146: nwaiters = 1
stest.c:147: count = 0
stest.c:152: calling rt_sem_v 1...
stest.c:60: rt_sem_p passed
stest.c:161: rt_sem_v called
stest.c:184: nwaiters = 0
stest.c:185: count = 0


So there is only 1 waiter (because the 2nd process didn't succeed the bind).

I tried the example also on xenomai 2.4.10 and there it's working.

I'm using linux-3.18.12, xenomai-3.0-rc5 (from tarball) and ipipe-core-3.18.12-x86-1.patch
I configured CONFIG_FUSE_FS=m in the kernel (see configuration in attachment), module fuse is loaded.

My linux distribution is debian - jessie. The fuse packages are installed :

ii  fuse             2.9.3-15+b1  amd64    Filesystem in Userspace
ii  gvfs-fuse        1.22.2-1     amd64    userspace virtual filesystem - fuse server
ii  libfuse-dev      2.9.3-15+b1  amd64    Filesystem in Userspace (development)
ii  libfuse2:amd64   2.9.3-15+b1  amd64    Filesystem in Userspace (library)

To build xenomai debian packages, I added following configure options to debian/rules :
--with-core=cobalt --enable-smp --enable-pshared --enable-registry
and then executed `debuild -uc -us`

The output of `xeno-config --info` :

Linux dev-x10sae 3.18.12-x86-64-xeno-3.0.rc5 #1 SMP PREEMPT Fri Jul 10 12:29:14 CEST 2015 x86_64 GNU/Linux
Kernel parameters: BOOT_IMAGE=/boot/vmlinuz-3.18.12-x86-64-xeno-3.0.rc5
root=UUID=fc8ecefa-fc73-487f-a045-cffa99c38a11
ro quiet console=tty0 console=ttyS0,115200n8
I-pipe release #1 detected
Cobalt core 3.0-rc5 detected
Compiler: gcc version 4.9.2 (Debian 4.9.2-10) 
Build args: --prefix=/usr --includedir=/usr/include/xenomai
--mandir=/usr/share/man --with-testdir=/usr/lib/xenomai/testsuite
--with-core=cobalt --enable-smp --enable-pshared --enable-registry
--build x86_64-linux-gnu build_alias=x86_64-linux-gnu

The shared libraries in use :
ldd ./stest
linux-vdso.so.1 (0x00007fff422e5000)
libalchemy.so.0 => /usr/lib/libalchemy.so.0 (0x00007f0da8bf6000)
libcopperplate.so.0 => /usr/lib/libcopperplate.so.0 (0x00007f0da89df000)
libcobalt.so.2 => /usr/lib/libcobalt.so.2 (0x00007f0da87be000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f0da85a1000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f0da8399000)
libfuse.so.2 => /lib/x86_64-linux-gnu/libfuse.so.2 (0x00007f0da815a000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f0da7db1000)
/lib64/ld-linux-x86-64.so.2 (0x00007f0da8e25000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f0da7bad000)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: config-3.18.12-x86-64-xeno-3.0.rc5
Type: application/octet-stream
Size: 126458 bytes
Desc: not available
URL: <http://xenomai.org/pipermail/xenomai/attachments/20150713/4f971614/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: makefile
Type: application/octet-stream
Size: 794 bytes
Desc: not available
URL: <http://xenomai.org/pipermail/xenomai/attachments/20150713/4f971614/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: stest.c
Type: text/x-csrc
Size: 4041 bytes
Desc: not available
URL: <http://xenomai.org/pipermail/xenomai/attachments/20150713/4f971614/attachment.c>

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2015-08-03  9:59 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-13 13:37 [Xenomai] xenomai-3.0-rc5 : binding named semaphores from external process Frederik Bayart
2015-07-14  9:53 ` Philippe Gerum
2015-07-15 12:45   ` Frederik Bayart
2015-07-16 15:35     ` Philippe Gerum
2015-07-28 15:19       ` Frederik Bayart
2015-07-29 10:12         ` Philippe Gerum
2015-07-29 11:48           ` Frederik Bayart
2015-07-29 12:20             ` Philippe Gerum
2015-07-29 12:28             ` Philippe Gerum
2015-07-29 12:48             ` Philippe Gerum
2015-07-29 12:56               ` Philippe Gerum
2015-07-29 15:14               ` Frederik Bayart
2015-07-29 18:27                 ` Philippe Gerum
2015-07-29 18:42                   ` Philippe Gerum
2015-07-30 14:28                     ` Frederik Bayart
2015-07-30 15:08                       ` Frederik Bayart
2015-07-30 16:10                         ` Philippe Gerum
2015-07-31 17:54                           ` Frederik Bayart
2015-08-01  7:59                             ` Philippe Gerum
2015-08-01  8:43                             ` Philippe Gerum
2015-08-03  9:59                               ` Frederik Bayart
2015-07-30 15:58                       ` Philippe Gerum
2015-07-30 16:36                       ` Philippe Gerum
2015-07-31 16:04                         ` Frederik Bayart

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.