Skip to contentSkip to conversation

rt_task_sleep causing crashes on PowerPC

Xenomai-help Steve Deiters 5 participants 15 messages May 15, 2010 – Jun 17, 2010

lore
Share & tools
lore
#0 lore raw

I am running Xenomai 2.5.3, I-pipe version 2.9-00, with Linux 2.6.33.4 on a PowerPC MPC5121. With small values of sleep ticks passed to rt_task_sleep, I get various sorts of crashes. Here is a simple program using a delay loop that exhibits the behavior.

-----
#include <stdio.h>
#include <errno.h>
#include <native/task.h>
#include <native/timer.h>

int main(int argc, char **argv)
{
int cnt=0;
while(1)

   {
      int ret;
      if((ret = rt_task_sleep(rt_timer_ns2ticks(1000UL)))) {
         errno = -ret;
         perror("rt_task_sleep");
      }
      if(cnt++ > 100)
         break;

}
return 0;
}

If I increase the tick count, it seems to not occur. The errors I get are not quite consistent. Here are a few examples of the output I get from the kernel log.

-----

[   22.213774] Xenomai: Switching  to secondary mode after exception
#769 from user-space at 0xff7c7ac (pid 571)
[   22.226494] I-pipe: Detected illicit call from domain 'Xenomai'
[   22.226505] <3>        into a service reserved for domain 'Linux' and

below.

-----

[  216.495518] BUG: scheduling while atomic: gatekeeper/0/155/0x00000002
[  216.501932] Modules linked in:
[  216.504933] Call Trace:
[  216.507414] [c7883ed0] [c0008ba0] show_stack+0x3c/0x160 (unreliable)
[  216.513727] [c7883f00] [c001b338] __schedule_bug+0x6c/0x80
[  216.519211] [c7883f20] [c02792ec] schedule+0x5a8/0x5bc
[  216.524345] [c7883f70] [c00737cc] gatekeeper_thread+0x150/0x194
[  216.530250] [c7883fc0] [c003f250] kthread+0x78/0x7c
[  216.535111] [c7883ff0] [c0012ee8] kernel_thread+0x4c/0x68

I'm not sure if I have something misconfigured or what. I am upgrading from Xenomai 2.4.10 on an older kernel and I did not have this same problem.

Thanks.

#1 lore raw
Quoted 4 lines · Steve Deiters

I am running Xenomai 2.5.3, I-pipe version 2.9-00, with Linux 2.6.33.4 on a PowerPC MPC5121. With small values of sleep ticks passed to rt_task_sleep, I get various sorts of crashes. Here is a simple program using a delay loop that exhibits the behavior.

<snip>

Quoted 5 lines

I'm not sure if I have something misconfigured or what. I am upgrading from Xenomai 2.4.10 on an older kernel and I did not have this same problem.

Bug confirmed here. Your setup is not involved, I'll send a fix asap.

Quoted 7 lines

Thanks.

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

Signature · 1 line
Philippe.
#2 lore raw
Quoted 9 lines · Philippe Gerum
Quoted 4 lines · Steve Deiters

I am running Xenomai 2.5.3, I-pipe version 2.9-00, with Linux 2.6.33.4 on a PowerPC MPC5121. With small values of sleep ticks passed to rt_task_sleep, I get various sorts of crashes. Here is a simple program using a delay loop that exhibits the behavior.

<snip>

Quoted 1 line
Quoted 6 lines
Quoted 4 lines

I'm not sure if I have something misconfigured or what. I am upgrading from Xenomai 2.4.10 on an older kernel and I did not have this same problem.

Bug confirmed here. Your setup is not involved, I'll send a fix asap.

It turned out to be a stack overflow issue, which could happen under very high IRQ pressure with unlocked context switch enabled. In short, the smaller the tick passed in your example, the more likely the Xenomai rescheduling code to accept another IRQ while switching thread contexts, then enter a deadly recursive rescheduling loop, eating the underlying stack space up to a complete overflow.

For that to happen, a significant (i.e. long enough) IRQ burst must hit the system at a frequency which is higher than what the platform can cope with, or at least close to the limit.

rt_task_sleep() is not directly involved in the bug, it just happened to trigger the next incoming timer IRQ, but any timed service would have caused the same issue, or any external IRQ flood leading some interrupt handler to raise the need-to-reschedule bit continuously.

Please try this fix:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=5f1d30a5da27b7f57c486a3a25caf3c26a709073

If you don't want to patch your tree yet, a work around for this bug is to disable the support for unlocked context switching from the "Machine" menu (CONFIG_XENO_HW_UNLOCKED_SWITCH).

The bad news is that all archs implementing unlocked context switching are affected by this bug in all 2.5.x releases, meaning arm and powerpc for now. The good news, is... Crap. There is no good news.

PS: Xenomai 2.4.x is immune to this bug (it does not have unlocked context switching support in the first place).

Signature · 1 line
Philippe.
#3 lore raw
In reply to Philippe Gerum

Hi

I get similar problem the xenomai posix skin. I have the latest version of Xenomai (2.5.3) and kernel 2.6.28.

I am using clock_nanosleep(CLOCK_REALTIME, ......) to wait for 1 millisecond. It freezes the system. However if I sleep for a second it is fine.

Philippe, should your fix work in my case too? If so, can you please send the fix.

thanks
Abhijit

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Philippe Gerum
Sent: Sunday, May 16, 2010 2:58 PM
To: Steve Deiters
Cc: [email protected]
Subject: Re: [Xenomai-help] rt_task_sleep causing crashes on PowerPC

Quoted 3 lines · Steve Deiters

I am running Xenomai 2.5.3, I-pipe version 2.9-00, with Linux 2.6.33.4 on a PowerPC MPC5121. With small values of sleep ticks passed to rt_task_sleep, I get various sorts of crashes. Here is a simple

program

Quoted 1 line

using a delay loop that exhibits the behavior.

<snip>

Quoted 2 lines

I'm not sure if I have something misconfigured or what. I am

upgrading

Quoted 3 lines

from Xenomai 2.4.10 on an older kernel and I did not have this same problem.

Bug confirmed here. Your setup is not involved, I'll send a fix asap.

Quoted 7 lines

Thanks.

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

Signature · 8 lines
Philippe.



_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help
#4 lore raw
Quoted 10 lines · Abhijit Majumdar

Hi

I get similar problem the xenomai posix skin. I have the latest version of Xenomai (2.5.3) and kernel 2.6.28.

I am using clock_nanosleep(CLOCK_REALTIME, ......) to wait for 1 millisecond. It freezes the system. However if I sleep for a second it is fine.

Philippe, should your fix work in my case too?

I have no idea which platform you are running your code on, so my answer won't be specific, but in short: it is unlikely. This could rather be an application error. You may want to try the failing code in a small standalone unit test, and post that code to the list if it still fails in that context, so we could have a look.

Quoted 41 lines

If so, can you please
send the fix.

thanks
Abhijit

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Philippe Gerum
Sent: Sunday, May 16, 2010 2:58 PM
To: Steve Deiters
Cc: [email protected]
Subject: Re: [Xenomai-help] rt_task_sleep causing crashes on PowerPC

Quoted 3 lines · Steve Deiters

I am running Xenomai 2.5.3, I-pipe version 2.9-00, with Linux 2.6.33.4 on a PowerPC MPC5121. With small values of sleep ticks passed to rt_task_sleep, I get various sorts of crashes. Here is a simple

program

Quoted 1 line

using a delay loop that exhibits the behavior.

<snip>

Quoted 2 lines

I'm not sure if I have something misconfigured or what. I am

upgrading

Quoted 3 lines

from Xenomai 2.4.10 on an older kernel and I did not have this same problem.

Bug confirmed here. Your setup is not involved, I'll send a fix asap.

Quoted 7 lines

Thanks.

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

Signature · 1 line
Philippe.
#5 lore raw

Hi Philippe

I have attached a standalone test program which crashes my system. It uses poxis skin to create a simple task which sleeps for 10 micro sec and wakes up and continues to do so until the user kills the process.

Interesting things note --

1. If I uncomment the printf statement at the beginning of the
while loop the program does not crash any more.
2. OR if I use rt_task_sleep instead of clock_nanosleep it does
not crash.

I am using xenomai 2.5.2 and the arm platform has kernel 2.6.28. I've cc-ed this email to a tech expert (Travis) of the vendor (EMAC) of the arm system.

At the time of crashing I see the following error message on the screen
----

WARNING: at /home/travis/projects/customers/pivotal_systems/workspace/linux-2.6. 28-xenomai-pivotal/kernel/sched.c:4382 add_preempt_count+0x84/0x98()

Modules linked in: at91_udc
[<c002e374>] (dump_stack+0x0/0x14) from [<c004510c>]
(warn_on_slowpath+0x4c/0x68

)
[<c00450c0>] (warn_on_slowpath+0x0/0x68) from [<c003dd44>] (add_preempt_count+0x
84/0x98)
r6:c38dc02c r5:00000000 r4:00000001
[<c003dcc0>] (add_preempt_count+0x0/0x98) from [<c0045d24>] (vprintk+0x2c/0x3d4)
[<c0045cf8>] (vprintk+0x0/0x3d4) from [<c00466c8>] (printk+0xe0/0x194) [<c00465e8>] (printk+0x0/0x194) from [<c00768f0>] (__xnpod_schedule+0x38c/0x550)
r3:00000003 r2:c039e3a0 r1:c3854000 r0:c032f630 r8:c480d408 r7:c3b98ca0 r6:c3b98ca0 r5:00000000 r4:c03a0d10
[<c0076564>] (__xnpod_schedule+0x0/0x550) from [<c007698c>] (__xnpod_schedule+0x
428/0x550)
[<c0076564>] (__xnpod_schedule+0x0/0x550) from [<c007698c>] (__xnpod_schedule+0x
428/0x550)
[<c0076564>] (__xnpod_schedule+0x0/0x550) from [<c007698c>] (__xnpod_schedule+0x
428/0x550)
[<c0076564>] (__xnpod_schedule+0x0/0x550) <1>Unable to handle kernel paging requ
est at virtual address 00001008

Thanks for your help

Abhijit

-----Original Message-----
From: Philippe Gerum [mailto:[email protected]
Sent: Friday, May 28, 2010 1:05 AM
To: Abhijit Majumdar
Cc: Steve Deiters; [email protected]
Subject: RE: [Xenomai-help] rt_task_sleep causing crashes on PowerPC

Quoted 3 lines · Abhijit Majumdar

Hi

I get similar problem the xenomai posix skin. I have the latest

version

Quoted 7 lines

of Xenomai (2.5.3) and kernel 2.6.28.

I am using clock_nanosleep(CLOCK_REALTIME, ......) to wait for 1 millisecond. It freezes the system. However if I sleep for a second it is fine.

Philippe, should your fix work in my case too?

I have no idea which platform you are running your code on, so my answer won't be specific, but in short: it is unlikely. This could rather be an application error. You may want to try the failing code in a small standalone unit test, and post that code to the list if it still fails in that context, so we could have a look.

Quoted 8 lines

If so, can you please
send the fix.

thanks
Abhijit

-----Original Message-----
From: [email protected]

[mailto:[email protected]]

Quoted 8 lines

On Behalf Of Philippe Gerum
Sent: Sunday, May 16, 2010 2:58 PM
To: Steve Deiters
Cc: [email protected]
Subject: Re: [Xenomai-help] rt_task_sleep causing crashes on PowerPC

Quoted 1 line · Steve Deiters

I am running Xenomai 2.5.3, I-pipe version 2.9-00, with Linux

2.6.33.4

Quoted 25 lines
Quoted 2 lines

on a PowerPC MPC5121. With small values of sleep ticks passed to rt_task_sleep, I get various sorts of crashes. Here is a simple

program

Quoted 1 line

using a delay loop that exhibits the behavior.

<snip>

Quoted 2 lines

I'm not sure if I have something misconfigured or what. I am

upgrading

Quoted 3 lines

from Xenomai 2.4.10 on an older kernel and I did not have this same problem.

Bug confirmed here. Your setup is not involved, I'll send a fix asap.

Quoted 7 lines

Thanks.

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

Signature · 1 line
Philippe.
#6 lore raw

Abhijit,

Quoted 6 lines · Abhijit Majumdar

Hi Philippe

I have attached a standalone test program which crashes my system. It uses poxis skin to create a simple task which sleeps for 10 micro sec and wakes up and continues to do so until the user kills the process.

Quoted 6 lines

Interesting things note --

1. If I uncomment the printf statement at the beginning of the
while loop the program does not crash any more.
2. OR if I use rt_task_sleep instead of clock_nanosleep it does
not crash.

What happens if you use rt_printf() rather than printf() inside the real-time loop. Some of the examples that I have sent you show the correct usage for this function.

Quoted 121 lines

I am using xenomai 2.5.2 and the arm platform has kernel 2.6.28. I've cc-ed this email to a tech expert (Travis) of the vendor (EMAC) of the arm system.

At the time of crashing I see the following error message on the screen
----

WARNING: at /home/travis/projects/customers/pivotal_systems/workspace/linux-2.6. 28-xenomai-pivotal/kernel/sched.c:4382 add_preempt_count+0x84/0x98()

Modules linked in: at91_udc
[<c002e374>] (dump_stack+0x0/0x14) from [<c004510c>]
(warn_on_slowpath+0x4c/0x68

)
[<c00450c0>] (warn_on_slowpath+0x0/0x68) from [<c003dd44>] (add_preempt_count+0x
84/0x98)
r6:c38dc02c r5:00000000 r4:00000001
[<c003dcc0>] (add_preempt_count+0x0/0x98) from [<c0045d24>] (vprintk+0x2c/0x3d4)
[<c0045cf8>] (vprintk+0x0/0x3d4) from [<c00466c8>] (printk+0xe0/0x194) [<c00465e8>] (printk+0x0/0x194) from [<c00768f0>] (__xnpod_schedule+0x38c/0x550)
r3:00000003 r2:c039e3a0 r1:c3854000 r0:c032f630 r8:c480d408 r7:c3b98ca0 r6:c3b98ca0 r5:00000000 r4:c03a0d10
[<c0076564>] (__xnpod_schedule+0x0/0x550) from [<c007698c>] (__xnpod_schedule+0x
428/0x550)
[<c0076564>] (__xnpod_schedule+0x0/0x550) from [<c007698c>] (__xnpod_schedule+0x
428/0x550)
[<c0076564>] (__xnpod_schedule+0x0/0x550) from [<c007698c>] (__xnpod_schedule+0x
428/0x550)
[<c0076564>] (__xnpod_schedule+0x0/0x550) <1>Unable to handle kernel paging requ
est at virtual address 00001008

Thanks for your help

Abhijit

-----Original Message-----
From: Philippe Gerum [mailto:[email protected]]
Sent: Friday, May 28, 2010 1:05 AM
To: Abhijit Majumdar
Cc: Steve Deiters; [email protected]
Subject: RE: [Xenomai-help] rt_task_sleep causing crashes on PowerPC

Quoted 3 lines · Abhijit Majumdar

Hi

I get similar problem the xenomai posix skin. I have the latest

version

Quoted 7 lines

of Xenomai (2.5.3) and kernel 2.6.28.

I am using clock_nanosleep(CLOCK_REALTIME, ......) to wait for 1 millisecond. It freezes the system. However if I sleep for a second it is fine.

Philippe, should your fix work in my case too?

I have no idea which platform you are running your code on, so my answer won't be specific, but in short: it is unlikely. This could rather be an application error. You may want to try the failing code in a small standalone unit test, and post that code to the list if it still fails in that context, so we could have a look.

Quoted 8 lines

If so, can you please
send the fix.

thanks
Abhijit

-----Original Message-----
From: [email protected]

[mailto:[email protected]]

Quoted 8 lines

On Behalf Of Philippe Gerum
Sent: Sunday, May 16, 2010 2:58 PM
To: Steve Deiters
Cc: [email protected]
Subject: Re: [Xenomai-help] rt_task_sleep causing crashes on PowerPC

Quoted 1 line · Steve Deiters

I am running Xenomai 2.5.3, I-pipe version 2.9-00, with Linux

2.6.33.4

Quoted 25 lines
Quoted 2 lines

on a PowerPC MPC5121. With small values of sleep ticks passed to rt_task_sleep, I get various sorts of crashes. Here is a simple

program

Quoted 1 line

using a delay loop that exhibits the behavior.

<snip>

Quoted 2 lines

I'm not sure if I have something misconfigured or what. I am

upgrading

Quoted 3 lines

from Xenomai 2.4.10 on an older kernel and I did not have this same problem.

Bug confirmed here. Your setup is not involved, I'll send a fix asap.

Quoted 7 lines

Thanks.

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

#7 lore raw
In reply to Abhijit Majumdar
Quoted 6 lines · Abhijit Majumdar

Hi Philippe

I have attached a standalone test program which crashes my system. It uses poxis skin to create a simple task which sleeps for 10 micro sec and wakes up and continues to do so until the user kills the process.

Quoted 8 lines

Interesting things note --

1. If I uncomment the printf statement at the beginning of the
while loop the program does not crash any more.
2. OR if I use rt_task_sleep instead of clock_nanosleep it does
not crash.

I am using xenomai 2.5.2 and the arm platform has kernel 2.6.28.

That is a not vague. In any case, 10us on an ARM is much too short. As I think I already told someone at pivotal systems, ARM latencies are larger than 50 us, and most of the time larger than 100us. So, asking for a 10us sleep is preposterous.

However, if you want your report to be useful:
- please try the latest version (that would be Xenomai 2.5.3)
- send us the full log of the serial console, not the part you think is relevant (the error comes here while xnpod_schedule is trying to print a message, the interesting part is not the failure of add_preempt_count, but probably more the error message which xnpod_schedule wants to print).
- sens us your kernel configuration.

Signature · 1 line
					    Gilles.
#8 lore raw
Quoted 21 lines · Gilles Chanteperdrix
Quoted 6 lines · Abhijit Majumdar

Hi Philippe

I have attached a standalone test program which crashes my system. It uses poxis skin to create a simple task which sleeps for 10 micro sec and wakes up and continues to do so until the user kills the process.

Quoted 8 lines

Interesting things note --

1. If I uncomment the printf statement at the beginning of the
while loop the program does not crash any more.
2. OR if I use rt_task_sleep instead of clock_nanosleep it does
not crash.

I am using xenomai 2.5.2 and the arm platform has kernel 2.6.28.

That is a not vague. In any case, 10us on an ARM is much too short. As I think I already told someone at pivotal systems, ARM latencies are larger than 50 us, and most of the time larger than 100us. So, asking for a 10us sleep is preposterous.

Quoted 7 lines

However, if you want your report to be useful:
- please try the latest version (that would be Xenomai 2.5.3)
- send us the full log of the serial console, not the part you think is relevant (the error comes here while xnpod_schedule is trying to print a message, the interesting part is not the failure of add_preempt_count, but probably more the error message which xnpod_schedule wants to print).
- sens us your kernel configuration.

And include the version of the I-pipe patch you are using.

Quoted 1 line
Signature · 1 line
					    Gilles.
#9 lore raw

We use adeos-ipipe-2.6.28.10-arm-1.12-07.patch.

--Abhijit

-----Original Message-----
From: Gilles Chanteperdrix [mailto:[email protected]
Sent: Wednesday, June 16, 2010 11:53 AM
To: Abhijit Majumdar
Cc: [email protected]; Steve Deiters
Subject: Re: [Xenomai-help] rt_task_sleep causing crashes on PowerPC

Quoted 9 lines · Gilles Chanteperdrix
Quoted 8 lines · Abhijit Majumdar

Hi Philippe

I have attached a standalone test program which crashes my system. It uses poxis skin to create a simple task which sleeps for 10 micro sec and wakes up and continues to do so until the user kills the process.

Interesting things note --

Quoted 8 lines
Quoted 6 lines

1. If I uncomment the printf statement at the beginning of the
while loop the program does not crash any more.
2. OR if I use rt_task_sleep instead of clock_nanosleep it does
not crash.

I am using xenomai 2.5.2 and the arm platform has kernel 2.6.28.

That is a not vague. In any case, 10us on an ARM is much too short. As

I

Quoted 7 lines

think I already told someone at pivotal systems, ARM latencies are larger than 50 us, and most of the time larger than 100us. So, asking for a 10us sleep is preposterous.

However, if you want your report to be useful:
- please try the latest version (that would be Xenomai 2.5.3)
- send us the full log of the serial console, not the part you think

is

Quoted 1 line

relevant (the error comes here while xnpod_schedule is trying to print

a

Quoted 2 lines

message, the interesting part is not the failure of add_preempt_count, but probably more the error message which xnpod_schedule wants to

print).

Quoted 1 line

- sens us your kernel configuration.

And include the version of the I-pipe patch you are using.

Quoted 1 line
Signature · 1 line
					    Gilles.
#10 lore raw
Quoted 1 line · Abhijit Majumdar

We use adeos-ipipe-2.6.28.10-arm-1.12-07.patch.

Ok. That is the latest I-pipe patch for 2.6.28. However, why are you using a 2.6.28 kernel? If you are starting a new project, there is no reason not to pick the latest kernel.

Signature · 1 line
					    Gilles.
#11 lore raw

Gilles,

Quoted 6 lines · Gilles Chanteperdrix
Quoted 1 line · Abhijit Majumdar

We use adeos-ipipe-2.6.28.10-arm-1.12-07.patch.

Ok. That is the latest I-pipe patch for 2.6.28. However, why are you using a 2.6.28 kernel? If you are starting a new project, there is no reason not to pick the latest kernel.

The 2.6.28.10 kernel that they are using is the latest release that we provide that has support patches for the board that they are using. We pick a stable version and develop with that for awhile before updating to a newer version, as we simply don't have enough developers to continually update and re-test newer kernel versions for all of our products. We are working on a newer version for a new board but that hasn't been tested yet.

Abhijit: it would be possible to compile a new kernel (i.e. 2.6.33) with Xenomai 2.5.3 for the AT91SAM9G20 eval board that would work with your board (after some configuration changes). It wouldn't support all of the custom I/O but you would be able to test the failure that you are seeing. The AT91 patch set for 2.6.33 would also need to be applied. The at91 experimental patch set is not ported to 2.6.33 yet, but this shouldn't be a problem for initial testing.

Thanks,

TAS

#12 lore raw
Quoted 17 lines · Travis Stratman

Gilles,

Quoted 5 lines · Gilles Chanteperdrix
Quoted 1 line · Abhijit Majumdar

We use adeos-ipipe-2.6.28.10-arm-1.12-07.patch.

Ok. That is the latest I-pipe patch for 2.6.28. However, why are you using a 2.6.28 kernel? If you are starting a new project, there is no reason not to pick the latest kernel.

The 2.6.28.10 kernel that they are using is the latest release that we provide that has support patches for the board that they are using. We pick a stable version and develop with that for awhile before updating to a newer version, as we simply don't have enough developers to continually update and re-test newer kernel versions for all of our products. We are working on a newer version for a new board but that hasn't been tested yet.

Quoted 7 lines

Abhijit: it would be possible to compile a new kernel (i.e. 2.6.33) with Xenomai 2.5.3 for the AT91SAM9G20 eval board that would work with your board (after some configuration changes). It wouldn't support all of the custom I/O but you would be able to test the failure that you are seeing. The AT91 patch set for 2.6.33 would also need to be applied. The at91 experimental patch set is not ported to 2.6.33 yet, but this shouldn't be a problem for initial testing.

Ok, forget it, 2.6.28 is fine.

Signature · 1 line
					    Gilles.
#13 lore raw
In reply to Gilles Chanteperdrix

Hi Gilles

I attached the kernel configuration.

Actually I sent whatever error message I saw in the console. However next couple of times I saw different error messages.

One time I saw --

WARNING: at /home/travis/projects/customers/pivotal_systems/workspace/linux-2.6.28-x enomai-pivotal/kernel/sched.c:4382 add_preempt_count+0x84 /0x98()

Unable to handle kernel NULL pointer dereference at virtual address

0000000c

Another time ---

Xenomai: fatal: zombie thread ROOT (c03a0d10) would not die...

 CPU  PID    PRI      TIMEOUT  STAT      NAME
>  0  0       -1      0        00400080  ROOT
   0  971      0      0        00200380  sleep_test
   0  972     90      0        00200188  sleep_test

Master time base: clock=91270892

thanks
Abhijit

-----Original Message-----
From: Gilles Chanteperdrix [mailto:[email protected]
Sent: Wednesday, June 16, 2010 11:51 AM
To: Abhijit Majumdar
Cc: Philippe Gerum; [email protected]; Steve Deiters
Subject: Re: [Xenomai-help] rt_task_sleep causing crashes on PowerPC

Quoted 6 lines · Abhijit Majumdar

Hi Philippe

I have attached a standalone test program which crashes my system. It uses poxis skin to create a simple task which sleeps for 10 micro sec and wakes up and continues to do so until the user kills the process.

Quoted 8 lines

Interesting things note --

1. If I uncomment the printf statement at the beginning of the
while loop the program does not crash any more.
2. OR if I use rt_task_sleep instead of clock_nanosleep it does
not crash.

I am using xenomai 2.5.2 and the arm platform has kernel 2.6.28.

That is a not vague. In any case, 10us on an ARM is much too short. As I think I already told someone at pivotal systems, ARM latencies are larger than 50 us, and most of the time larger than 100us. So, asking for a 10us sleep is preposterous.

However, if you want your report to be useful:
- please try the latest version (that would be Xenomai 2.5.3)
- send us the full log of the serial console, not the part you think is relevant (the error comes here while xnpod_schedule is trying to print a message, the interesting part is not the failure of add_preempt_count, but probably more the error message which xnpod_schedule wants to print).
- sens us your kernel configuration.

Signature · 1 line
					    Gilles.
#14 lore raw
Quoted 17 lines · Abhijit Majumdar

Hi Gilles

I attached the kernel configuration.

Actually I sent whatever error message I saw in the console. However next couple of times I saw different error messages.

One time I saw --

WARNING: at /home/travis/projects/customers/pivotal_systems/workspace/linux-2.6.28-x enomai-pivotal/kernel/sched.c:4382 add_preempt_count+0x84 /0x98()

Unable to handle kernel NULL pointer dereference at virtual address

0000000c

Quoted 8 lines

Another time ---

Xenomai: fatal: zombie thread ROOT (c03a0d10) would not die...

 CPU  PID    PRI      TIMEOUT  STAT      NAME
>  0  0       -1      0        00400080  ROOT
   0  971      0      0        00200380  sleep_test
   0  972     90      0        00200188  sleep_test

Master time base: clock=91270892

Apparently, I have not made myself clear, so, I am going to try again.

So, from your configuration, I see that the ARM you are using is an AT91SAM9G20.

First, try Xenomai 2.5.3 to see if you still get the bug.

If you still get the bug, then include in your full report the full serial console log, from the boot up to the bug.

Signature · 1 line
					    Gilles.