All of lore.kernel.org
 help / color / mirror / Atom feed
* linux rt priority  thread corrupt  global variable?
@ 2003-05-08  9:03 Ming Lei
  2003-05-08  9:43 ` Jörn Engel
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Ming Lei @ 2003-05-08  9:03 UTC (permalink / raw)
  To: linux-kernel

Platform:
Intel Pentium II; RedHat 7.2 with kernel version 2.4.7-10, libc 2.2.4-13 and
gcc 2.96.

Problem description:

a program has 3 threads of priority 12, 10, 6 respectively, and the main
process at priority 0. All the threads except main process is created with
pthread_create, and defined SCHED_FIFO as real time scheduler policy.

There is a global variable I define with 'int cpl'. All the threads and main
process may alter cpl at any time. cpl may have one of these values {0,
0xf000006e, 0xf0000068, 0xe0000000, 0xe0000060}. cpl is protected by mutex
for any access.

<Problem=> at some point of execution which cpl should be a value say
e0000060, but the actual value retained at cpl is another say e0000000; that
is, the value is changed without the program actually done anything on it.
The retained value I observed is kind of historic value(one of these value
in the above set), not the arbituary value. The problem had occured just
after context switch, also occured during a thread execution.

<Confirm> I used Intel debug register to track any writing to the cpl memory
address globally, which is the way GDB use for x86 hardware watchpoint
implementation. I could see all the writing from my program to change cpl,
but failed to see the source from which the problem occured. So I dont know
what cause the problem.

Can anyone listening give me a direction or hint on this annoying situation?

PS. please cc to this email address.
-Ming


Related questions:

Is linux kernel 2.4.10 considered strictly preemptive such as VxWorks or
other RTOS? I guess 2.4.10 may simulate preemptive with running scheduler on
every syscall or interrupt returns. Am I right?

Is printf() real-time priority thread safe?


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2003-05-08 20:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-08  9:03 linux rt priority thread corrupt global variable? Ming Lei
2003-05-08  9:43 ` Jörn Engel
2003-05-08 16:59   ` Ming Lei
2003-05-08  9:51 ` Arjan van de Ven
2003-05-08  9:52 ` Bill Huey
2003-05-08  9:59   ` Bill Huey
2003-05-08 10:42     ` Bill Huey
2003-05-08 20:45 ` Roger Larsson

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.