Skip to contentSkip to conversation

2.5.3++ on Blackfin: Irritating warning

Xenomai-help Kolja Waschk 2 participants 2 messages Dec 21, 2010

lore
Share & tools
lore
#0 lore raw

Hi,

I'm in the process of upgrading my Blackfin uclinux dist base from 2009R1.1 to 2010R1. This also includes a kernel and Xenomai upgrade.

The kernel is now 2.6.34 with I-pipe 1.14.02. With Xenomai 2.5.3, my application told me "Xenomai: User-space support anterior to 2.5.2 detected" on startup. I looked into newer Xenomai and found that there might have been related code changes, so I tried 2.5.5.2 (and also upgraded to I-pipe 1.15-01, but that doesn't seem to make a difference).

Now with 2.5.5.2, the warning when starting the application is gone, but I still get one when killing the application using SIGINT for the first time. The attached small example allows me to reliably reproduce the problem (please inform me if attachment didn't get through, it's only 30 lines).

When starting it after system reboot and then killing it with Ctrl-C after a few seconds, the warning is printed:

/ # /tmp/try
press ctrl-c to stop
press ctrl-c to stop
press ctrl-c to stop
^CXenomai: User-space support anterior to 2.5.2 detected, may corrupt memory upon thread termination. Upgrade is recommended
/ #

The warning doesn't appear when starting and killing "try" a the second time.

I also experience some other problems with debugging, console output duplication and (probably) memory fragmentation, maybe they're related but I have not been able to reproduce them with a small example yet.

Thanks in advance for any hints in advance!
Kolja

/* Compile with gcc-4.3.5 (Blackfin toolchain 2010R1-RC4)

   bfin-linux-uclibc-gcc \
      -I/opt/uClinux/blackfin-linux-dist/staging/usr/include \
      -g -D_GNU_SOURCE -D_REENTRANT -D__XENO__ -o try.gdb try.c \
      -L/opt/uClinux/blackfin-linux-dist/staging/usr/lib -lxenomai -lnative -lpthread -lrt

*/

#include <stdio.h>
#include <unistd.h>
#include <signal.h>
#include <sys/mman.h>
#include <native/task.h>

static int quit;

void sighandler(int sig)

{
    quit++;
}

int main ()

{
    quit = 0;
    signal(SIGINT, sighandler);

    int r;
    RT_TASK maintask;
    mlockall(MCL_CURRENT|MCL_FUTURE);
    r = rt_task_shadow(&maintask, "maintask", 3, 0);

    while (quit==0)
    {
        printf("press ctrl-c to stop\n");
        sleep(1);
    }

    return r;
}
#1 lore raw
Quoted 18 lines · Kolja Waschk

Hi,

I'm in the process of upgrading my Blackfin uclinux dist base from 2009R1.1 to 2010R1. This also includes a kernel and Xenomai upgrade.

The kernel is now 2.6.34 with I-pipe 1.14.02. With Xenomai 2.5.3, my application told me "Xenomai: User-space support anterior to 2.5.2 detected" on startup. I looked into newer Xenomai and found that there might have been related code changes, so I tried 2.5.5.2 (and also upgraded to I-pipe 1.15-01, but that doesn't seem to make a difference).

Now with 2.5.5.2, the warning when starting the application is gone, but I still get one when killing the application using SIGINT for the first time. The attached small example allows me to reliably reproduce the problem (please inform me if attachment didn't get through, it's only 30 lines).

When starting it after system reboot and then killing it with Ctrl-C after a few seconds, the warning is printed:

/ # /tmp/try
press ctrl-c to stop
press ctrl-c to stop
press ctrl-c to stop
^CXenomai: User-space support anterior to 2.5.2 detected, may corrupt memory upon thread termination. Upgrade is recommended
/ #

Quoted 1 line

The warning doesn't appear when starting and killing "try" a the second time.

Mmf, commit 90b3e7cf6 does not do what it says it does. It should read:

ksrc/nucleus/shadow.c +1 -1
index 5ac182b..449a9a4 100644
@@ -2214,7 +2214,7 @@ static void handle_shadow_exit(void)
 	 */
 	if (thread->u_mode && !warned) {
 		warned = 1;
-#ifndef CONFIG_MMU
+#ifdef CONFIG_MMU
 		printk(KERN_WARNING
 		       "Xenomai: User-space support anterior to 2.5.2"
 		       " detected, may corrupt memory upon\n"
Quoted 6 lines

I also experience some other problems with debugging, console output duplication and (probably) memory fragmentation, maybe they're related but I have not been able to reproduce them with a small example yet.

Thanks in advance for any hints in advance!
Kolja
_______________________________________________ Xenomai-help mailing list [email protected] https://mail.gna.org/listinfo/xenomai-help

Signature · 1 line
Philippe.