Franz Engel wrote: > Philippe 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. I'm not sure if I understand you correct. I change the function in rt_print.h (line 706) from "static __attribute__((constructor)) void __rt_print_init(void)" to "static __late_constructor__ void __rt_print_init(void)" and I insert the following lines into the compiler.h (absolutly new lines): #ifdef __IN_XENO__ #if __GNUC__ == 4 && __GNUC_MINOR__ == 6 #define __constructor__ __attribute__((constructor(200), noclone)) #define __late_constructor__ __attribute__((constructor, noclone)) #else /* Gcc not 4.6 */ #define __constructor__ __attribute__((constructor(200))) #define __late_constructor__ __attribute__((constructor)) #endif /* Gcc not 4.6 */ #endif /* In xenomai */
Is it correct? I have still the same failure. regards, Franz _______________________________________________ Xenomai mailing list Xenomai@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai