Skip to contentSkip to conversation

__xn_sys_current_info failed: Operation not permitted

Xenomai Franz Engel 3 participants 11 messages Jul 18, 2013 – Jul 22, 2013 2 messages not in the archive

lore
Share & tools
lore
#0 lore raw

Hi,

I get this error when I run a programm:
__xn_sys_current_info failed: Operation not permitted

I know that the error comes from the assert_nrt_inner(void) function inside the assert_context.c file. But I have no idea what is the reason. The Operation not permitted is the return value from XENOMAI_SYSCALL1(__xn_sys_current_info, &info);. But I found no documentation about this function.

Regards,
     Franz

#1 lore raw
Quoted 4 lines · Franz Engel

Hi,

I get this error when I run a programm:
__xn_sys_current_info failed: Operation not permitted

Are you running this program with root privileges?

Signature · 1 line
                                                                Gilles.
#2 lore raw
Quoted 8 lines
Quoted 5 lines · Gilles

Franz wrote:
Hi,

I get this error when I run a programm:
__xn_sys_current_info failed: Operation not permitted

Are you running this program with root privileges?

Yes.
--
                                                                Gilles.

#3 lore raw
Quoted 11 lines · Franz Engel
Quoted 8 lines
Quoted 5 lines · Gilles

Franz wrote:
Hi,

I get this error when I run a programm:
__xn_sys_current_info failed: Operation not permitted

Are you running this program with root privileges?

Yes.
--
Gilles.

Could you post an example allowing us to reproduce the issue?

Signature · 1 line
                                                                Gilles.
#4 lore raw
In reply to Franz Engel
Quoted 7 lines · Franz Engel

Hi,

I get this error when I run a programm:
__xn_sys_current_info failed: Operation not permitted

I know that the error comes from the assert_nrt_inner(void) function inside the assert_context.c file. But I have no idea what is the reason. The Operation not permitted is the return value from XENOMAI_SYSCALL1(__xn_sys_current_info, &info);. But I found no documentation about this function.

This is reminiscent of a symptom observed for a bug fixed in the -forge tree, a while ago: http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=014898add6a697e1a0d69f9e20b910ade74f1940

Do you happen to call fork() in your application?

Signature · 1 line
Philippe.
#5 lore raw
Quoted 5 lines · Philippe wrote:>> Franz Engel wrote:
Quoted 5 lines

 Hi,

 I get this error when I run a programm:
 __xn_sys_current_info failed: Operation not permitted

Quoted 8 lines
Quoted 1 line

 I know that the error comes from the assert_nrt_inner(void) function inside the assert_context.c file. But I have no idea what is the reason. The Operation not permitted is the return value from XENOMAI_SYSCALL1(__xn_sys_current_info, &info);. But I found no documentation about this function.

This is reminiscent of a symptom observed for a bug fixed in the -forge tree, a while ago:
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=014898add6a697e1a0d69f9e20b910ade74f1940

Do you happen to call fork() in your application?

Yes. I do? What I can do to solve the problem. Should I try to modify the xenomai files as discrept in the git-link?

regards,
    franz

#6 lore raw
Quoted 10 lines · Franz Engel
Quoted 7 lines · Philippe
Quoted 7 lines

Franz Engel wrote:
Hi,

I get this error when I run a programm:
__xn_sys_current_info failed: Operation not permitted

I know that the error comes from the assert_nrt_inner(void) function inside the assert_context.c file. But I have no idea what is the reason. The Operation not permitted is the return value from XENOMAI_SYSCALL1(__xn_sys_current_info, &info);. But I found no documentation about this function.

Quoted 9 lines
Quoted 5 lines

This is reminiscent of a symptom observed for a bug fixed in the -forge tree, a while ago:
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=014898add6a697e1a0d69f9e20b910ade74f1940

Do you happen to call fork() in your application?

Yes. I do? What I can do to solve the problem. Should I try to modify the xenomai files as discrept in the git-link?

I'm unsure, although this would be possible to backport portions of the logic, the implementation has now diverged significantly between the 2.x and 3.x code bases.

Could you try the patch below? It's untested, but should work around the root issue in your case:

include/nucleus/compiler.h +4 -2
index 30f32c7..da4ea03 100644
@@ -37,9 +37,11 @@
 
 #ifdef __IN_XENO__
 #if __GNUC__ == 4 && __GNUC_MINOR__ == 6
-#define __constructor__ __attribute__((constructor, noclone))
+#define __constructor__ __attribute__((constructor(200), noclone))
+#define __late_constructor__ __attribute__((constructor, noclone))
 #else /* Gcc not 4.6 */
-#define __constructor__ __attribute__((constructor))
+#define __constructor__ __attribute__((constructor(200)))
+#define __late_constructor__ __attribute__((constructor))
 #endif /* Gcc not 4.6 */
 #endif /* In xenomai */
 
src/skins/common/rt_print.c +1 -1
index dfa8b33..e056cd6 100644
@@ -738,7 +738,7 @@ static void forked_child_init(void)
 		spawn_printer_thread();
 }
 
-static __constructor__ void __rt_print_init(void)
+static __late_constructor__ void __rt_print_init(void)
 {
 	const char *value_str;
 	unsigned long long period;
Signature · 1 line
Philippe.
#7 lore raw
Quoted 78 lines

________________________________
Von: Philippe Gerum <[email protected]>
An: Franz Engel <[email protected]>
CC: "[email protected]" <[email protected]>
Gesendet: 12:09 Freitag, 19.Juli 2013
Betreff: Re: [Xenomai] __xn_sys_current_info failed: Operation not permitted

Quoted 10 lines · Franz Engel
Quoted 7 lines · Philippe
Quoted 7 lines

Franz Engel wrote:
Hi,

I get this error when I run a programm:
__xn_sys_current_info failed: Operation not permitted

I know that the error comes from the assert_nrt_inner(void) function inside the assert_context.c file. But I have no idea what is the reason. The Operation not permitted is the return value from XENOMAI_SYSCALL1(__xn_sys_current_info, &info);. But I found no documentation about this function.

Quoted 9 lines
Quoted 5 lines

This is reminiscent of a symptom observed for a bug fixed in the -forge tree, a while ago:
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=014898add6a697e1a0d69f9e20b910ade74f1940

Do you happen to call fork() in your  application?

Yes. I do? What I can do to solve the problem. Should I try to modify the xenomai files as discrept in the git-link?

I'm unsure, although this would be possible to backport portions of the logic, the implementation has now diverged significantly between the 2.x and 3.x code bases.

Could you try the patch below? It's untested, but should work around the root issue in your case:

include/nucleus/compiler.h +4 -2
index 30f32c7..da4ea03 100644
@@ -37,9 +37,11 @@
 
   #ifdef __IN_XENO__
   #if __GNUC__ == 4 && __GNUC_MINOR__ == 6
-#define __constructor__ __attribute__((constructor, noclone))
+#define __constructor__ __attribute__((constructor(200), noclone))
+#define __late_constructor__ __attribute__((constructor, noclone))
   #else /* Gcc not 4.6 */
-#define __constructor__ __attribute__((constructor))
+#define __constructor__ __attribute__((constructor(200)))
+#define __late_constructor__ __attribute__((constructor))
   #endif /* Gcc not 4.6 */
   #endif /* In xenomai */
 
src/skins/common/rt_print.c +1 -1
index dfa8b33..e056cd6 100644
@@ -738,7 +738,7 @@ static void forked_child_init(void)
           spawn_printer_thread();
   }
 
-static __constructor__ void __rt_print_init(void)
+static __late_constructor__ void __rt_print_init(void)
   {
       const char *value_str;
       unsigned long long period;
Signature · 4 lines
-- 
Philippe.

I tried the patch. But I think it is not the correct version of xenomai. In my compiler.h there is no line "#define __constructor__ __attribute__((constructor, noclone))". I use Xenomai 2.6.2.1.
#8 lore raw
Quoted 75 lines · Franz Engel

    ------------------------------------------------------------------------
    *Von:* Philippe Gerum <[email protected]>
    *An:* Franz Engel <[email protected]>
    *CC:* "[email protected]" <[email protected]>
    *Gesendet:* 12:09 Freitag, 19.Juli 2013
    *Betreff:* Re: [Xenomai] __xn_sys_current_info failed: Operation not
    permitted

    On 07/19/2013 11:49 AM, Franz Engel wrote:
     > Philippe wrote:
     >>> Franz Engel wrote:
     >>> Hi,
     >> >
     >>> I get this error when I run a programm:
     >>> __xn_sys_current_info failed: Operation not permitted
     >> >
     >>> I know that the error comes from the assert_nrt_inner(void)
    function inside the assert_context.c file. But I have no idea what
    is the reason. The Operation not permitted is the return value from
    XENOMAI_SYSCALL1(__xn_sys_current_info, &info);. But I found no
    documentation about this function.
     >
     >
     >>This is reminiscent of a symptom observed for a bug fixed in the
    -forge
     >>tree, a while ago:
     >>http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=014898add6a697e1a0d69f9e20b910ade74f1940
     >
     >>Do you happen to call fork() in your  application?
     >
     > Yes. I do? What I can do to solve the problem. Should I try to modify
     > the xenomai files as discrept in the git-link?
     >

    I'm unsure, although this would be possible to backport portions of the
    logic, the implementation has now diverged significantly between the
    2.x
    and 3.x code bases.

    Could you try the patch below? It's untested, but should work around
    the
    root issue in your case:

    diff --git a/include/nucleus/compiler.h b/include/nucleus/compiler.h
    index 30f32c7..da4ea03 100644
    --- a/include/nucleus/compiler.h
    +++ b/include/nucleus/compiler.h
    @@ -37,9 +37,11 @@

       #ifdef __IN_XENO__
       #if __GNUC__ == 4 && __GNUC_MINOR__ == 6
    -#define __constructor__ __attribute__((constructor, noclone))
    +#define __constructor__ __attribute__((constructor(200), noclone))
    +#define __late_constructor__ __attribute__((constructor, noclone))
       #else /* Gcc not 4.6 */
    -#define __constructor__ __attribute__((constructor))
    +#define __constructor__ __attribute__((constructor(200)))
    +#define __late_constructor__ __attribute__((constructor))
       #endif /* Gcc not 4.6 */
       #endif /* In xenomai */

    diff --git a/src/skins/common/rt_print.c b/src/skins/common/rt_print.c
    index dfa8b33..e056cd6 100644
    --- a/src/skins/common/rt_print.c
    +++ b/src/skins/common/rt_print.c
    @@ -738,7 +738,7 @@ static void forked_child_init(void)
               spawn_printer_thread();
    }

    -static __constructor__ void __rt_print_init(void)
    +static __late_constructor__ void __rt_print_init(void)
       {
           const char *value_str;
Quoted 9 lines
           unsigned long long period;

    --
    Philippe.

    I tried the patch. But I think it is not the correct version of
    xenomai. In my compiler.h there is no line "#define __constructor__
    __attribute__((constructor, noclone))". I use Xenomai 2.6.2.1.

Simply ignore the noclone spec when applying the patch manually. You should end up with the normal/high priority ctor at priority 200, the late one with an implicit, unspecified low priority.

Signature · 1 line
Philippe.
#9 lore raw
In reply to Franz Engel
Quoted 75 lines · Franz Engel

    ------------------------------------------------------------------------
    *Von:* Philippe Gerum <[email protected]>
    *An:* Franz Engel <[email protected]>
    *CC:* "[email protected]" <[email protected]>
    *Gesendet:* 12:09 Freitag, 19.Juli 2013
    *Betreff:* Re: [Xenomai] __xn_sys_current_info failed: Operation not
    permitted

    On 07/19/2013 11:49 AM, Franz Engel wrote:
     > Philippe wrote:
     >>> Franz Engel wrote:
     >>> Hi,
     >> >
     >>> I get this error when I run a programm:
     >>> __xn_sys_current_info failed: Operation not permitted
     >> >
     >>> I know that the error comes from the assert_nrt_inner(void)
    function inside the assert_context.c file. But I have no idea what
    is the reason. The Operation not permitted is the return value from
    XENOMAI_SYSCALL1(__xn_sys_current_info, &info);. But I found no
    documentation about this function.
     >
     >
     >>This is reminiscent of a symptom observed for a bug fixed in the
    -forge
     >>tree, a while ago:
     >>http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=014898add6a697e1a0d69f9e20b910ade74f1940
     >
     >>Do you happen to call fork() in your  application?
     >
     > Yes. I do? What I can do to solve the problem. Should I try to modify
     > the xenomai files as discrept in the git-link?
     >

    I'm unsure, although this would be possible to backport portions of the
    logic, the implementation has now diverged significantly between the
    2.x
    and 3.x code bases.

    Could you try the patch below? It's untested, but should work around
    the
    root issue in your case:

    diff --git a/include/nucleus/compiler.h b/include/nucleus/compiler.h
    index 30f32c7..da4ea03 100644
    --- a/include/nucleus/compiler.h
    +++ b/include/nucleus/compiler.h
    @@ -37,9 +37,11 @@

       #ifdef __IN_XENO__
       #if __GNUC__ == 4 && __GNUC_MINOR__ == 6
    -#define __constructor__ __attribute__((constructor, noclone))
    +#define __constructor__ __attribute__((constructor(200), noclone))
    +#define __late_constructor__ __attribute__((constructor, noclone))
       #else /* Gcc not 4.6 */
    -#define __constructor__ __attribute__((constructor))
    +#define __constructor__ __attribute__((constructor(200)))
    +#define __late_constructor__ __attribute__((constructor))
       #endif /* Gcc not 4.6 */
       #endif /* In xenomai */

    diff --git a/src/skins/common/rt_print.c b/src/skins/common/rt_print.c
    index dfa8b33..e056cd6 100644
    --- a/src/skins/common/rt_print.c
    +++ b/src/skins/common/rt_print.c
    @@ -738,7 +738,7 @@ static void forked_child_init(void)
               spawn_printer_thread();
    }

    -static __constructor__ void __rt_print_init(void)
    +static __late_constructor__ void __rt_print_init(void)
       {
           const char *value_str;
Quoted 9 lines
           unsigned long long period;

    --
    Philippe.

    I tried the patch. But I think it is not the correct version of
    xenomai. In my compiler.h there is no line "#define __constructor__
    __attribute__((constructor, noclone))". I use Xenomai 2.6.2.1.

With 2.6.2.1, you need the patch below applied, before applying the suggested work around:
6e89cb2287378a7dcbba987949d0168460dabbe7

Bottom line is that all library constructor routines shall be tagged with the __constructor__ qualifier, except rt_print_init which should be __late_constructor__ instead. Otherwise the change makes no sense.

Signature · 1 line
Philippe.

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#12 lore raw

Von: Philippe Gerum <[email protected]>

An: Franz Engel <[email protected]>

Quoted 4 lines

Gesendet: 15:03 Montag, 22.Juli 2013
Betreff: Re: [Xenomai] __xn_sys_current_info failed: Operation not permitted

Quoted 15 lines
Quoted 14 lines · Franz Engel

    On 07/19/2013 12:57 PM, Franz Engel wrote:

      >
      >    On 07/19/2013 11:49 AM, Franz Engel wrote:
      >      > Philippe wrote:
      >      >>> Franz Engel wrote:
      > >>> Hi,
      >      >> >
      >      >>> I get this error when I run a programm:
      >      >>> __xn_sys_current_info failed: Operation not permitted >      >> >
      >

    >>> I know that the error comes from the assert_nrt_inner(void)

Quoted 13 lines
Quoted 12 lines

      >    function inside the assert_context.c file. But I have no idea what >    is the reason. The Operation not permitted is the return value from
      >    XENOMAI_SYSCALL1(__xn_sys_current_info, &info);. But I found no >    documentation about this function.
      >      >
      >      >
      >      >>This is reminiscent of a symptom observed for a bug fixed in the
      >    -forge
      >      >>tree, a while ago:

Quoted 11 lines
Quoted 11 lines

      >>http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=014898add6a697e1a0d69f9e20b910ade74f1940 >      >
      >      >>Do you happen to call fork() in your  application?
      >      >
      >      > Yes. I do? What I can do to solve the problem. Should I
    try to modify
      >      > the xenomai files as discrept in the git-link?
      >      >
      >
      >    I'm unsure, although this would be possible to backport

portions of the

Quoted 7 lines
Quoted 7 lines

      >    logic, the implementation has now diverged significantly between the
      >    2.x
      >    and 3.x code bases.
      >
      >    Could you try the patch below? It's untested, but should work around

Quoted 8 lines
Quoted 8 lines

      >    the
      >    root issue in your case:
      >
      >    diff --git a/include/nucleus/compiler.h b/include/nucleus/compiler.h
      >    index 30f32c7..da4ea03 100644
      >    --- a/include/nucleus/compiler.h >    +++

b/include/nucleus/compiler.h

Quoted 4 lines
Quoted 4 lines

      >    @@ -37,9 +37,11 @@
      >
      >        #ifdef __IN_XENO__
      >        #if __GNUC__ == 4 && __GNUC_MINOR__ == 6

Quoted 8 lines
Quoted 8 lines

      >    -#define __constructor__ __attribute__((constructor, noclone)) >    +#define __constructor__ __attribute__((constructor(200), noclone))
      >    +#define __late_constructor__ __attribute__((constructor, noclone))
      >        #else /* Gcc not 4.6 */
      >    -#define __constructor__ __attribute__((constructor)) >  +#define __constructor__

__attribute__((constructor(200)))

Quoted 12 lines
Quoted 4 lines

      >    +#define __late_constructor__ __attribute__((constructor)) >        #endif /* Gcc not 4.6 */
      >        #endif /* In xenomai */
      >

Quoted 8 lines

      >    diff --git a/src/skins/common/rt_print.c b/src/skins/common/rt_print.c
      >    index dfa8b33..e056cd6 100644
      >    --- a/src/skins/common/rt_print.c
      >    +++ b/src/skins/common/rt_print.c
      >    @@ -738,7 +738,7 @@ static void forked_child_init(void) >                spawn_printer_thread();

Quoted 15 lines

    }

Quoted 14 lines

      >
      >    -static __constructor__ void __rt_print_init(void) >    +static __late_constructor__ void __rt_print_init(void) >        {
      > const char *value_str;
      >            unsigned long long period;
      >
      >    --
      >    Philippe.
      >
      >    I tried the patch. But I think it is not the correct version of >    xenomai. In my compiler.h there is no line "#define __constructor__
      >    __attribute__((constructor,

noclone))". I use Xenomai 2.6.2.1.

Quoted 15 lines
Quoted 15 lines

      >

    With 2.6.2.1, you need the patch below applied, before applying the suggested work around:
    6e89cb2287378a7dcbba987949d0168460dabbe7

    Bottom line is that all library constructor routines shall be tagged with the __constructor__ qualifier, except rt_print_init which should be
    __late_constructor__ instead. Otherwise the change makes no sense.

    --
    Philippe.

Quoted 12 lines
Quoted 3 lines

O.k. I used the revision "6e89cb2287378a7dcbba987949d0168460dabbe7" and I use the patch (the workaround). But the failure is still the same. Any other idea?

Do you mention --with-__thread in your configuration line? If so, please retry without.

Signature · 1 line
Philippe.

Do you
mean the configuration for xenomai befor I install it? I don't use any
parameter. Is there a way to trace such a failure. I get the error from a programm, that is not developed be my selfe.