* [Xenomai-help] Hang at glibc time() function call
[not found] ` <200811281542.10754@domain.hid>
@ 2008-11-28 14:42 ` Petr Cervenka
2008-11-28 16:01 ` Gilles Chanteperdrix
2008-11-29 1:24 ` Jan Kiszka
0 siblings, 2 replies; 4+ messages in thread
From: Petr Cervenka @ 2008-11-28 14:42 UTC (permalink / raw)
To: xenomai-help
Hello,
we have a problems with hanging of our real-time application. In fact, the computer stops to respond totally.
I succeeded to find the exact hang position in couple of our tasks (but not all of them) by setting of some digital outputs of HW device:
1) The most real-time task with the highest priority is still running as it should be (100us period).
2) Some of the tasks are in "sleep" state. They are waiting on some event or timeout.
3) One low priority task seems to be blocked at glibc time() function call.
But I would like to know if it is the source of the problem or only a consequent.
I will try to replace the time() function call with rt_timer_read(), but couldn't be the problem elsewhere?
Configuration:
Athlon XP 4600+
linux-2.6.26.3
xenomai-2.4.5 + patch for proper queue deletion
Thanks for any advice.
Petr Cervenka
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Xenomai-help] Hang at glibc time() function call
2008-11-28 14:42 ` [Xenomai-help] Hang at glibc time() function call Petr Cervenka
@ 2008-11-28 16:01 ` Gilles Chanteperdrix
2008-11-29 1:24 ` Jan Kiszka
1 sibling, 0 replies; 4+ messages in thread
From: Gilles Chanteperdrix @ 2008-11-28 16:01 UTC (permalink / raw)
To: Petr Cervenka; +Cc: xenomai-help
Petr Cervenka wrote:
> Hello, we have a problems with hanging of our real-time application.
> In fact, the computer stops to respond totally. I succeeded to find
> the exact hang position in couple of our tasks (but not all of them)
> by setting of some digital outputs of HW device: 1) The most
> real-time task with the highest priority is still running as it
> should be (100us period). 2) Some of the tasks are in "sleep" state.
> They are waiting on some event or timeout. 3) One low priority task
> seems to be blocked at glibc time() function call.
>
> But I would like to know if it is the source of the problem or only a
> consequent. I will try to replace the time() function call with
> rt_timer_read(), but couldn't be the problem elsewhere?
>
> Configuration: Athlon XP 4600+ linux-2.6.26.3 xenomai-2.4.5 + patch
> for proper queue deletion
Could not it be that the highest priority task is using all the CPU?
--
Gilles.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Xenomai-help] Hang at glibc time() function call
2008-11-28 14:42 ` [Xenomai-help] Hang at glibc time() function call Petr Cervenka
2008-11-28 16:01 ` Gilles Chanteperdrix
@ 2008-11-29 1:24 ` Jan Kiszka
2008-12-01 10:28 ` Petr Cervenka
1 sibling, 1 reply; 4+ messages in thread
From: Jan Kiszka @ 2008-11-29 1:24 UTC (permalink / raw)
To: Petr Cervenka; +Cc: xenomai-help
[-- Attachment #1: Type: text/plain, Size: 1183 bytes --]
Petr Cervenka wrote:
> Hello,
> we have a problems with hanging of our real-time application. In fact, the computer stops to respond totally.
> I succeeded to find the exact hang position in couple of our tasks (but not all of them) by setting of some digital outputs of HW device:
> 1) The most real-time task with the highest priority is still running as it should be (100us period).
> 2) Some of the tasks are in "sleep" state. They are waiting on some event or timeout.
> 3) One low priority task seems to be blocked at glibc time() function call.
Is the low priority task also mapped as Xenomai task? In that case
calling standard Linux time services can be lethal:
If the Linux clocksource is TSC or HPET, glibc will use a syscall-less
variant for time of day reading. That variant has two properties:
A) It doesn't switch Xenomai task into secondary mode like ordinary
syscalls do.
B) It can deadlock with the Linux kernel, leaving the caller spinning
forever so that Linux is no longer executed.
The testsuite's clocktest used to have this issue as well (luckily, I
was able to analyze it over KVM with a source level debugger :) ).
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 257 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Xenomai-help] Hang at glibc time() function call
2008-11-29 1:24 ` Jan Kiszka
@ 2008-12-01 10:28 ` Petr Cervenka
0 siblings, 0 replies; 4+ messages in thread
From: Petr Cervenka @ 2008-12-01 10:28 UTC (permalink / raw)
To: jan.kiszka; +Cc: xenomai
>Could not it be that the highest priority task is using all the CPU?
No, it's highly unprobable. The task runs at is should.
>Is the low priority task also mapped as Xenomai task? In that case
>calling standard Linux time services can be lethal:
Yes, the task is mapped as Xenomai task, because it waits on real-time queue with some timeout.
>
>If the Linux clocksource is TSC or HPET, glibc will use a syscall-less
>variant for time of day reading. That variant has two properties:
>
>A) It doesn't switch Xenomai task into secondary mode like ordinary
> syscalls do.
>
>B) It can deadlock with the Linux kernel, leaving the caller spinning
> forever so that Linux is no longer executed.
Hmm, probably my cause.
Meanwhile I replaced the glibc time() function call with rt_timer_read and it seems to work fine now (for 3 days).
Thank you for you support.
Petr
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-12-01 10:28 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <200811281535.7647@domain.hid>
[not found] ` <200811281536.819@domain.hid>
[not found] ` <200811281537.16959@domain.hid>
[not found] ` <200811281538.1680@domain.hid>
[not found] ` <200811281539.441@domain.hid>
[not found] ` <200811281540.19192@domain.hid>
[not found] ` <200811281541.22553@domain.hid>
[not found] ` <200811281542.10754@domain.hid>
2008-11-28 14:42 ` [Xenomai-help] Hang at glibc time() function call Petr Cervenka
2008-11-28 16:01 ` Gilles Chanteperdrix
2008-11-29 1:24 ` Jan Kiszka
2008-12-01 10:28 ` Petr Cervenka
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.