Skip to contentSkip to conversation

Xenomai v2.4-rc4: freeze with RTAI skin, fine with other skins

Xenomai-core Fillod Stephane 3 participants 3 messages Oct 22, 2007

lore
Share & tools
lore
#0 lore raw

Hi,

As Philippe has been suggesting it, I've been testing v2.4-rc4 on x86 (not favourite board though :) with the RTAI skin (not my favourite skin too).
Anyway, a legacy RTAI application which was fine with v2.3.2/2.6.20, is now
freezing the box randomly in the first 30 seconds. On the other hand, the programs from the testsuite are running stable. So we may rule out a problem in the I-Pipe/kernel.

For the legacy RTAI application to load, the attached patch was necessary.
The patch against ksrc/skins/rtai/shm.c is somewhat defeating the purpose
of a lower XNCORE_PAGE_SIZE, so a better fix might be expected.

The box is running FC5 on a pentium D, but kernel is compiled for UP.

$ cat /proc/ipipe/version
1.10-09
$ cat /proc/xenomai/version
2.4-rc4
$ cat /proc/version
Linux version 2.6.23.1 () (gcc version 4.1.1 20070105 (Red Hat
4.1.1-51))

The kernel config file is attached.

I'm currently stripping down the RTAI code out of the application in order to have a simple testbed reproducing the freeze.

In the mean time, does anyone have a clue where to look particularly?

TIA

Signature · 1 line
Stephane
ksrc/skins/rtai/shm.c +2 -2
diff -ru xenomai-2.4-rc4.orig/ksrc/skins/rtai/shm.c xenomai-2.4-rc4/ksrc/skins/rtai/shm.c
@@ -144,8 +144,8 @@
 	/* Make sure we won't hit trivial argument errors when calling
 	   xnheap_init(). */
 
-	if (heapsize < 2 * XNCORE_PAGE_SIZE)
-		heapsize = 2 * XNCORE_PAGE_SIZE;
+	if (heapsize < 2 * PAGE_SIZE)
+		heapsize = 2 * PAGE_SIZE;
 
 	/* Account for the overhead so that the actual free space is
 	   large enough to match the requested size. */
ksrc/skins/rtai/task.c +3 -0
diff -ru xenomai-2.4-rc4.orig/ksrc/skins/rtai/task.c xenomai-2.4-rc4/ksrc/skins/rtai/task.c
@@ -139,6 +139,9 @@
 	task->body = body;
 	task->sigfn = sigfn;
 
+	if (xnarch_cpus_empty(task->affinity))
+		task->affinity = XNPOD_ALL_CPUS;
+
 	xnlock_get_irqsave(&nklock, s);
 
 	err = xnpod_start_thread(&task->thread_base, XNSUSP,	/* Suspend on startup. */
#1 lore raw
Quoted 1 line · Fillod Stephane

In the mean time, does anyone have a clue where to look particularly?

A case of freeze is a system call called in a loop which fails without its return value being checked.

Signature · 1 line
                                               Gilles Chanteperdrix
#2 lore raw
In reply to Fillod Stephane
Quoted 11 lines · Fillod Stephane

Hi,

As Philippe has been suggesting it, I've been testing v2.4-rc4 on x86 (not favourite board though :) with the RTAI skin (not my favourite skin too).
Anyway, a legacy RTAI application which was fine with v2.3.2/2.6.20, is now
freezing the box randomly in the first 30 seconds. On the other hand, the programs from the testsuite are running stable. So we may rule out a problem in the I-Pipe/kernel.

Quoted 6 lines

For the legacy RTAI application to load, the attached patch was necessary.
The patch against ksrc/skins/rtai/shm.c is somewhat defeating the purpose
of a lower XNCORE_PAGE_SIZE, so a better fix might be expected.

This one should prevent -EINVAL from being returned. Hopefully.

skins/rtai/shm.c +1 -2
@@ -150,8 +150,7 @@
 	/* Account for the overhead so that the actual free space is
 	   large enough to match the requested size. */
 
-	heapsize += xnheap_overhead(heapsize, XNCORE_PAGE_SIZE);
-	heapsize = XNCORE_PAGE_ALIGN(heapsize);
+	heapsize = xnheap_rounded_size(heapsize, XNCORE_PAGE_SIZE);
 
 #ifdef CONFIG_XENO_OPT_PERVASIVE
 	err = xnheap_init_mapped(p->heap,
Quoted 9 lines

The box is running FC5 on a pentium D, but kernel is compiled for UP.

$ cat /proc/ipipe/version
1.10-09
$ cat /proc/xenomai/version
2.4-rc4
$ cat /proc/version
Linux version 2.6.23.1 () (gcc version 4.1.1 20070105 (Red Hat
4.1.1-51))
Quoted 7 lines

The kernel config file is attached.

I'm currently stripping down the RTAI code out of the application in order to have a simple testbed reproducing the freeze.

In the mean time, does anyone have a clue where to look particularly?

Hard to say at this point. Since the nucleus watchdog does not trigger, you may want to try disabling X86_UP_IOAPIC while keeping X86_UP_APIC, and arm the kernel NMI watchdog on the LAPIC (nmi_watchdog=2). You may be lucky and have a backtrace after the freeze.

PS: maybe enabling all the nucleus debug options would catch something too.

Quoted 9 lines

TIA

------------------------------------------------------------------------

_______________________________________________
Xenomai-core mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-core

Signature · 1 line
Philippe.