Skip to contentSkip to conversation

Using pipes in 3.0rc

Xenomai Registrierungen 3 participants 8 messages Oct 28, 2014 – Oct 30, 2014

lore
Share & tools
lore
#0 lore raw

Hello,

i try to switch with my working project from Xenomai 2.6 to 3.0rc Cobaltusing the native/alchemy skin.

Creating tasks,etc. seems to works fine.

If i try to open a pipe from the realtime taks using rt_pipe_create it returns with the error -88. XDDP/rpc ist activted in th kernel.
I used this Makefile config:

XENO_CONFIG := /usr/xenomai/bin/xeno-config
CFLAGS := $(shell $(XENO_CONFIG) --skin=alchemy --cflags) LDFLAGS := $(shell $(XENO_CONFIG) --skin=alchemy --ldflags) CC := $(shell $(XENO_CONFIG) --cc)

Has anything changed handling pipes in 3.0?

What exacliy this error means?

Thanks

Sascha

#1 lore raw
Quoted 9 lines · Registrierungen

Hello,

i try to switch with my working project from Xenomai 2.6 to 3.0rc Cobaltusing the native/alchemy skin.

Creating tasks,etc. seems to works fine.

If i try to open a pipe from the realtime taks using rt_pipe_create it returns with the error -88.

This is -ENOTSOCK, you can check all error codes there:
/usr/include/asm-generic/errno-base.h /usr/include/asm-generic/errno.h

ENOTSOCK is not raised by the alchemy API, so this must be a syscall taking the wrong route to the glibc in the core lib. Please try this patch:

lib/alchemy/pipe.c +3 -3
index 93da9be..439a00f 100644
@@ -166,8 +166,8 @@ int rt_pipe_create(RT_PIPE *pipe,
 	}
 
 	if (poolsize > 0) {
-		ret = setsockopt(pcb->sock, SOL_XDDP, XDDP_POOLSZ,
-				 &poolsize, sizeof(poolsize));
+		ret = __RT(setsockopt(pcb->sock, SOL_XDDP, XDDP_POOLSZ,
+				      &poolsize, sizeof(poolsize)));
 		if (ret)
 			goto fail_sockopt;
 	}
@@ -181,7 +181,7 @@ int rt_pipe_create(RT_PIPE *pipe,
 	memset(&saddr, 0, sizeof(saddr));
 	saddr.sipc_family = AF_RTIPC;
 	saddr.sipc_port = minor;
-	ret = bind(sock, (struct sockaddr *)&saddr, sizeof(saddr));
+	ret = __RT(bind(sock, (struct sockaddr *)&saddr, sizeof(saddr)));
 	if (ret)
 		goto fail_sockopt;
 
Quoted 2 lines

Has anything changed handling pipes in 3.0?

All user-visible changes are reported here:
http://localhost/xenomai/migrating-from-xenomai-2-x-to-3-x/

Signature · 1 line
Philippe.
#2 lore raw

Thanks for your support.

Unfortainly it din'twork for me.
I patched and recompiled and installed xenomai and my app, but i have still the same error.

Have you got another idea, or need some other informations from my side?

Sascha

Am 28.10.2014 11:01, schrieb Philippe Gerum:

Quoted 46 lines · Registrierungen
Quoted 9 lines

Hello,

i try to switch with my working project from Xenomai 2.6 to 3.0rc Cobaltusing the native/alchemy skin.

Creating tasks,etc. seems to works fine.

If i try to open a pipe from the realtime taks using rt_pipe_create it returns with the error -88.

This is -ENOTSOCK, you can check all error codes there:
/usr/include/asm-generic/errno-base.h /usr/include/asm-generic/errno.h

ENOTSOCK is not raised by the alchemy API, so this must be a syscall taking the wrong route to the glibc in the core lib. Please try this patch:

lib/alchemy/pipe.c +3 -3
index 93da9be..439a00f 100644
@@ -166,8 +166,8 @@ int rt_pipe_create(RT_PIPE *pipe,
  	}
 
  	if (poolsize > 0) {
-		ret = setsockopt(pcb->sock, SOL_XDDP, XDDP_POOLSZ,
-				 &poolsize, sizeof(poolsize));
+		ret = __RT(setsockopt(pcb->sock, SOL_XDDP, XDDP_POOLSZ,
+				      &poolsize, sizeof(poolsize)));
  		if (ret)
  			goto fail_sockopt;
  	}
@@ -181,7 +181,7 @@ int rt_pipe_create(RT_PIPE *pipe,
  	memset(&saddr, 0, sizeof(saddr));
  	saddr.sipc_family = AF_RTIPC;
  	saddr.sipc_port = minor;
-	ret = bind(sock, (struct sockaddr *)&saddr, sizeof(saddr));
+	ret = __RT(bind(sock, (struct sockaddr *)&saddr, sizeof(saddr)));
  	if (ret)
  		goto fail_sockopt;
 
Quoted 1 line

Has anything changed handling pipes in 3.0?

All user-visible changes are reported here:
http://localhost/xenomai/migrating-from-xenomai-2-x-to-3-x/

#3 lore raw
Quoted 7 lines · Registrierungen

Thanks for your support.

Unfortainly it din'twork for me.
I patched and recompiled and installed xenomai and my app, but i have still the same error.

Have you got another idea, or need some other informations from my side?

You may want to trace your app with gdb, configuring with --enable-debug=full, then single-stepping in rt_pipe_create() to pinpoint the failing call in there.

Quoted 51 lines

Sascha

Am 28.10.2014 11:01, schrieb Philippe Gerum:

Quoted 45 lines · Registrierungen
Quoted 9 lines

Hello,

i try to switch with my working project from Xenomai 2.6 to 3.0rc Cobaltusing the native/alchemy skin.

Creating tasks,etc. seems to works fine.

If i try to open a pipe from the realtime taks using rt_pipe_create it returns with the error -88.

This is -ENOTSOCK, you can check all error codes there:
/usr/include/asm-generic/errno-base.h /usr/include/asm-generic/errno.h

ENOTSOCK is not raised by the alchemy API, so this must be a syscall taking the wrong route to the glibc in the core lib. Please try this patch:

lib/alchemy/pipe.c +3 -3
index 93da9be..439a00f 100644
@@ -166,8 +166,8 @@ int rt_pipe_create(RT_PIPE *pipe,
      }
        if (poolsize > 0) {
-        ret = setsockopt(pcb->sock, SOL_XDDP, XDDP_POOLSZ,
-                 &poolsize, sizeof(poolsize));
+        ret = __RT(setsockopt(pcb->sock, SOL_XDDP, XDDP_POOLSZ,
+                      &poolsize, sizeof(poolsize)));
          if (ret)
              goto fail_sockopt;
      }
@@ -181,7 +181,7 @@ int rt_pipe_create(RT_PIPE *pipe,
      memset(&saddr, 0, sizeof(saddr));
      saddr.sipc_family = AF_RTIPC;
      saddr.sipc_port = minor;
-    ret = bind(sock, (struct sockaddr *)&saddr, sizeof(saddr));
+    ret = __RT(bind(sock, (struct sockaddr *)&saddr, sizeof(saddr)));
      if (ret)
          goto fail_sockopt;
 
Quoted 1 line

Has anything changed handling pipes in 3.0?

All user-visible changes are reported here:
http://localhost/xenomai/migrating-from-xenomai-2-x-to-3-x/

Signature · 1 line
Philippe.
#7 lore raw
In reply to Registrierungen
Quoted 7 lines · Registrierungen

Thanks for your support.

Unfortainly it din'twork for me.
I patched and recompiled and installed xenomai and my app, but i have still the same error.

Have you got another idea, or need some other informations from my side?

Just a stupid question, you are sure you have RTIPC and XDDP enabled in kernel configuration, right?

Signature · 1 line
					    Gilles.
#4 lore raw
In reply to Philippe Gerum

Addendum:
I am using a x64 Kernel.
Does it matter?

Am 28.10.2014 14:54, schrieb Philippe Gerum:

Quoted 62 lines · Registrierungen
Quoted 7 lines

Thanks for your support.

Unfortainly it din'twork for me.
I patched and recompiled and installed xenomai and my app, but i have still the same error.

Have you got another idea, or need some other informations from my side?

You may want to trace your app with gdb, configuring with --enable-debug=full, then single-stepping in rt_pipe_create() to pinpoint the failing call in there.

Quoted 49 lines

Sascha

Am 28.10.2014 11:01, schrieb Philippe Gerum:

Quoted 45 lines · Registrierungen
Quoted 9 lines

Hello,

i try to switch with my working project from Xenomai 2.6 to 3.0rc Cobaltusing the native/alchemy skin.

Creating tasks,etc. seems to works fine.

If i try to open a pipe from the realtime taks using rt_pipe_create it returns with the error -88.

This is -ENOTSOCK, you can check all error codes there:
/usr/include/asm-generic/errno-base.h /usr/include/asm-generic/errno.h

ENOTSOCK is not raised by the alchemy API, so this must be a syscall taking the wrong route to the glibc in the core lib. Please try this patch:

lib/alchemy/pipe.c +3 -3
index 93da9be..439a00f 100644
@@ -166,8 +166,8 @@ int rt_pipe_create(RT_PIPE *pipe,
       }
         if (poolsize > 0) {
-        ret = setsockopt(pcb->sock, SOL_XDDP, XDDP_POOLSZ,
-                 &poolsize, sizeof(poolsize));
+        ret = __RT(setsockopt(pcb->sock, SOL_XDDP, XDDP_POOLSZ,
+                      &poolsize, sizeof(poolsize)));
           if (ret)
               goto fail_sockopt;
       }
@@ -181,7 +181,7 @@ int rt_pipe_create(RT_PIPE *pipe,
       memset(&saddr, 0, sizeof(saddr));
       saddr.sipc_family = AF_RTIPC;
       saddr.sipc_port = minor;
-    ret = bind(sock, (struct sockaddr *)&saddr, sizeof(saddr));
+    ret = __RT(bind(sock, (struct sockaddr *)&saddr, sizeof(saddr)));
       if (ret)
           goto fail_sockopt;
 
Quoted 1 line

Has anything changed handling pipes in 3.0?

All user-visible changes are reported here:
http://localhost/xenomai/migrating-from-xenomai-2-x-to-3-x/

#5 lore raw
Quoted 3 lines · Registrierungen

Addendum:
I am using a x64 Kernel.
Does it matter?

No, it does not. Do you plan to debug with gdb as I suggested?

Quoted 66 lines

Am 28.10.2014 14:54, schrieb Philippe Gerum:

Quoted 62 lines · Registrierungen
Quoted 7 lines

Thanks for your support.

Unfortainly it din'twork for me.
I patched and recompiled and installed xenomai and my app, but i have still the same error.

Have you got another idea, or need some other informations from my side?

You may want to trace your app with gdb, configuring with --enable-debug=full, then single-stepping in rt_pipe_create() to pinpoint the failing call in there.

Quoted 49 lines

Sascha

Am 28.10.2014 11:01, schrieb Philippe Gerum:

Quoted 45 lines · Registrierungen
Quoted 9 lines

Hello,

i try to switch with my working project from Xenomai 2.6 to 3.0rc Cobaltusing the native/alchemy skin.

Creating tasks,etc. seems to works fine.

If i try to open a pipe from the realtime taks using rt_pipe_create it returns with the error -88.

This is -ENOTSOCK, you can check all error codes there:
/usr/include/asm-generic/errno-base.h /usr/include/asm-generic/errno.h

ENOTSOCK is not raised by the alchemy API, so this must be a syscall taking the wrong route to the glibc in the core lib. Please try this patch:

lib/alchemy/pipe.c +3 -3
index 93da9be..439a00f 100644
@@ -166,8 +166,8 @@ int rt_pipe_create(RT_PIPE *pipe,
      }
        if (poolsize > 0) {
-        ret = setsockopt(pcb->sock, SOL_XDDP, XDDP_POOLSZ,
-                 &poolsize, sizeof(poolsize));
+        ret = __RT(setsockopt(pcb->sock, SOL_XDDP, XDDP_POOLSZ,
+                      &poolsize, sizeof(poolsize)));
          if (ret)
              goto fail_sockopt;
      }
@@ -181,7 +181,7 @@ int rt_pipe_create(RT_PIPE *pipe,
      memset(&saddr, 0, sizeof(saddr));
      saddr.sipc_family = AF_RTIPC;
      saddr.sipc_port = minor;
-    ret = bind(sock, (struct sockaddr *)&saddr, sizeof(saddr));
+    ret = __RT(bind(sock, (struct sockaddr *)&saddr, sizeof(saddr)));
      if (ret)
          goto fail_sockopt;
 
Quoted 1 line

Has anything changed handling pipes in 3.0?

All user-visible changes are reported here:
http://localhost/xenomai/migrating-from-xenomai-2-x-to-3-x/

Signature · 1 line
Philippe.
#6 lore raw
Quoted 6 lines · Philippe Gerum
Quoted 3 lines · Registrierungen

Addendum:
I am using a x64 Kernel.
Does it matter?

No, it does not. Do you plan to debug with gdb as I suggested?

This is what you need to enable pipes with Alchemy:

https://git.xenomai.org/xenomai-3.git/commit/?h=next&id=eb69a837eaab4cd6639772503c789de0a52906c0
https://git.xenomai.org/xenomai-3.git/commit/?h=next&id=caf0a0b4a3f279e3e4bd42e6b62bc09fab4fba94

Quoted 69 lines
Quoted 67 lines

Am 28.10.2014 14:54, schrieb Philippe Gerum:

Quoted 62 lines · Registrierungen
Quoted 7 lines

Thanks for your support.

Unfortainly it din'twork for me.
I patched and recompiled and installed xenomai and my app, but i have still the same error.

Have you got another idea, or need some other informations from my side?

You may want to trace your app with gdb, configuring with --enable-debug=full, then single-stepping in rt_pipe_create() to pinpoint the failing call in there.

Quoted 49 lines

Sascha

Am 28.10.2014 11:01, schrieb Philippe Gerum:

Quoted 45 lines · Registrierungen
Quoted 9 lines

Hello,

i try to switch with my working project from Xenomai 2.6 to 3.0rc Cobaltusing the native/alchemy skin.

Creating tasks,etc. seems to works fine.

If i try to open a pipe from the realtime taks using rt_pipe_create it returns with the error -88.

This is -ENOTSOCK, you can check all error codes there:
/usr/include/asm-generic/errno-base.h /usr/include/asm-generic/errno.h

ENOTSOCK is not raised by the alchemy API, so this must be a syscall taking the wrong route to the glibc in the core lib. Please try this patch:

lib/alchemy/pipe.c +3 -3
index 93da9be..439a00f 100644
@@ -166,8 +166,8 @@ int rt_pipe_create(RT_PIPE *pipe,
      }
        if (poolsize > 0) {
-        ret = setsockopt(pcb->sock, SOL_XDDP, XDDP_POOLSZ,
-                 &poolsize, sizeof(poolsize));
+        ret = __RT(setsockopt(pcb->sock, SOL_XDDP, XDDP_POOLSZ,
+                      &poolsize, sizeof(poolsize)));
          if (ret)
              goto fail_sockopt;
      }
@@ -181,7 +181,7 @@ int rt_pipe_create(RT_PIPE *pipe,
      memset(&saddr, 0, sizeof(saddr));
      saddr.sipc_family = AF_RTIPC;
      saddr.sipc_port = minor;
-    ret = bind(sock, (struct sockaddr *)&saddr, sizeof(saddr));
+    ret = __RT(bind(sock, (struct sockaddr *)&saddr, sizeof(saddr)));
      if (ret)
          goto fail_sockopt;
 
Quoted 1 line

Has anything changed handling pipes in 3.0?

All user-visible changes are reported here:
http://localhost/xenomai/migrating-from-xenomai-2-x-to-3-x/

Signature · 1 line
Philippe.