All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philippe Gerum <rpm@xenomai.org>
To: Franz Engel <franz_lambert_engel@yahoo.de>
Cc: "xenomai@xenomai.org" <xenomai@xenomai.org>
Subject: Re: [Xenomai] __xn_sys_current_info failed: Operation not permitted
Date: Fri, 19 Jul 2013 15:22:29 +0200	[thread overview]
Message-ID: <51E93D95.40900@xenomai.org> (raw)
In-Reply-To: <1374231441.29790.YahooMailNeo@web172205.mail.ir2.yahoo.com>

On 07/19/2013 12:57 PM, Franz Engel wrote:
>
>
>     ------------------------------------------------------------------------
>     *Von:* Philippe Gerum <rpm@xenomai.org>
>     *An:* Franz Engel <franz_lambert_engel@yahoo.de>
>     *CC:* "xenomai@xenomai.org" <xenomai@xenomai.org>
>     *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;
>            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.

-- 
Philippe.


  reply	other threads:[~2013-07-19 13:22 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-18 10:24 [Xenomai] __xn_sys_current_info failed: Operation not permitted Franz Engel
2013-07-18 11:09 ` Gilles Chanteperdrix
2013-07-18 11:21   ` Franz Engel
2013-07-18 11:22     ` Gilles Chanteperdrix
2013-07-19  9:02 ` Philippe Gerum
2013-07-19  9:49   ` Franz Engel
2013-07-19 10:09     ` Philippe Gerum
2013-07-19 10:57       ` Franz Engel
2013-07-19 13:22         ` Philippe Gerum [this message]
2013-07-22  7:37         ` Philippe Gerum
     [not found]           ` <1374495002.37795.YahooMailNeo@web172201.mail.ir2.yahoo.com>
     [not found]             ` <51ED2DA8.2060307@xenomai.org>
2013-07-22 14:29               ` Franz Engel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51E93D95.40900@xenomai.org \
    --to=rpm@xenomai.org \
    --cc=franz_lambert_engel@yahoo.de \
    --cc=xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.