Hi, I tried to apply the rt patch, patch-2.6.31.12-rt21, to the 31 kernel. It successfully boots up with the patch, on ARM9 platform(Freescale's i.MX25 3Stack board). But it fails to run a simple application, which tests the A thread wakes up B thread using pthread_cond_signal(). The code is as follows. And I try to dump the log, it hangs in the futex() function while the console is still alive. Anyone can help ? The dump log is as follows. execve("./rt-mutex", ["./rt-mutex"], [/* 14 vars */]) = 0 brk(0) = 0x11000 uname({sys="Linux", node="(none)", ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4001c000 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) open("/etc/ld.so.cache", O_RDONLY) = -1 ENOENT (No such file or directory) open("/lib/tls/v5l/fast-mult/half/libpthread.so.0", O_RDONLY) = -1 ENOENT (No such file or directory) stat64("/lib/tls/v5l/fast-mult/half", 0xbe9ec318) = -1 ENOENT (No such file or directory) open("/lib/tls/v5l/fast-mult/libpthread.so.0", O_RDONLY) = -1 ENOENT (No such file or directory) stat64("/lib/tls/v5l/fast-mult", 0xbe9ec318) = -1 ENOENT (No such file or directory) open("/lib/tls/v5l/half/libpthread.so.0", O_RDONLY) = -1 ENOENT (No such file or directory) stat64("/lib/tls/v5l/half", 0xbe9ec318) = -1 ENOENT (No such file or directory) open("/lib/tls/v5l/libpthread.so.0", O_RDONLY) = -1 ENOENT (No such file or directory) stat64("/lib/tls/v5l", 0xbe9ec318) = -1 ENOENT (No such file or directory) open("/lib/tls/fast-mult/half/libpthread.so.0", O_RDONLY) = -1 ENOENT (No such file or directory) stat64("/lib/tls/fast-mult/half", 0xbe9ec318) = -1 ENOENT (No such file or directory) open("/lib/tls/fast-mult/libpthread.so.0", O_RDONLY) = -1 ENOENT (No such file or directory) stat64("/lib/tls/fast-mult", 0xbe9ec318) = -1 ENOENT (No such file or directory) open("/lib/tls/half/libpthread.so.0", O_RDONLY) = -1 ENOENT (No such file or directory) stat64("/lib/tls/half", 0xbe9ec318) = -1 ENOENT (No such file or directory) open("/lib/tls/libpthread.so.0", O_RDONLY) = -1 ENOENT (No such file or directory) stat64("/lib/tls", 0xbe9ec318) = -1 ENOENT (No such file or directory) open("/lib/v5l/fast-mult/half/libpthread.so.0", O_RDONLY) = -1 ENOENT (No such file or directory) stat64("/lib/v5l/fast-mult/half", 0xbe9ec318) = -1 ENOENT (No such file or directory) open("/lib/v5l/fast-mult/libpthread.so.0", O_RDONLY) = -1 ENOENT (No such file or directory) stat64("/lib/v5l/fast-mult", 0xbe9ec318) = -1 ENOENT (No such file or directory) open("/lib/v5l/half/libpthread.so.0", O_RDONLY) = -1 ENOENT (No such file or directory) stat64("/lib/v5l/half", 0xbe9ec318) = -1 ENOENT (No such file or directory) open("/lib/v5l/libpthread.so.0", O_RDONLY) = -1 ENOENT (No such file or directory) stat64("/lib/v5l", 0xbe9ec318) = -1 ENOENT (No such file or directory) open("/lib/fast-mult/half/libpthread.so.0", O_RDONLY) = -1 ENOENT (No such file or directory) stat64("/lib/fast-mult/half", 0xbe9ec318) = -1 ENOENT (No such file or directory) open("/lib/fast-mult/libpthread.so.0", O_RDONLY) = -1 ENOENT (No such file or directory) stat64("/lib/fast-mult", 0xbe9ec318) = -1 ENOENT (No such file or directory) open("/lib/half/libpthread.so.0", O_RDONLY) = -1 ENOENT (No such file or directory) stat64("/lib/half", 0xbe9ec318) = -1 ENOENT (No such file or directory) open("/lib/libpthread.so.0", O_RDONLY) = 3 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\220D\0\000"..., 512) = 512 fstat64(3, {st_mode=S_IFREG|0755, st_size=118596, ...}) = 0 mmap2(NULL, 115192, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x40025000 mprotect(0x40037000, 28672, PROT_NONE) = 0 mmap2(0x4003e000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x11) = 0x4003e000 mmap2(0x40040000, 4600, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x40040000 close(3) = 0 open("/lib/libc.so.6", O_RDONLY) = 3 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\10C\1\000"..., 512) = 512 fstat64(3, {st_mode=S_IFREG|0755, st_size=1352528, ...}) = 0 mmap2(NULL, 1139084, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x40042000 mprotect(0x4014b000, 32768, PROT_NONE) = 0 mmap2(0x40153000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x109) = 0x40153000 mmap2(0x40156000, 8588, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x40156000 close(3) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4001d000 syscall_983045(0x4001d3d0, 0x4001d3d0, 0x40024058, 0x4001daa8, 0x40, 0x40024058, 0, 0xf0005, 0x4002435c, 0x8034, 0x40024000, 0xbe9ecb3c, 0, 0xbe9ec8a8, 0x40014464, 0x40001fd8, 0x20000010, 0x4001d3d0, 0xc2cc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) = 0 mprotect(0x40153000, 8192, PROT_READ) = 0 mprotect(0x4003e000, 4096, PROT_READ) = 0 mprotect(0x40023000, 4096, PROT_READ) = 0 epoll_wait(0x4001cf78, 0xbe9ece04, 0x4001d3d0, 0x3b34) = 258 ipc_subcall(0x4001cf80, 0xc, 0x4001d3d0, 0xffffffec) = 0 rt_sigaction(SIGRTMIN, {0x4002907c, [], SA_SIGINFO|0x4000000}, NULL, 8) = 0 rt_sigaction(SIGRT_1, {0x40028f54, [], SA_RESTART|SA_SIGINFO|0x4000000}, NULL, 8) = 0 rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0 getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM_INFINITY}) = 0 futex(0xbe9ecc34, 0x7 /* FUTEX_??? */, 0) = -1 EPERM (Operation not permitted) mmap2(NULL, 8388608, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40159000 brk(0) = 0x11000 brk(0x32000) = 0x32000 mprotect(0x40159000, 4096, PROT_NONE) = 0 clone(decrement_count get count_lock decrement_count count == 0 decrement_count before cond_wait child_stack=0x40957fe8, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0x409584d8, tls=0x40958930, child_tidptr=0x409584d8) = 259 rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0 rt_sigaction(SIGCHLD, NULL, {SIG_DFL}, 8) = 0 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 nanosleep({2, 0}, {2, 0}) = 0 mmap2(NULL, 8388608, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40959000 mprotect(0x40959000, 4096, PROT_NONE) = 0 clone(increment_count get count_lock increment_count before cond_signal child_stack=0x41157fe8, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0x411584d8, tls=0x41158930, child_tidptr=0x411584d8) = 260 rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0 rt_sigaction(SIGCHLD, NULL, {SIG_DFL}, 8) = 0 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 nanosleep({10, 0}, {10, 0}) = 0 futex(0x409584d8, FUTEX_WAIT, 259, NULL Source code as follows. 25 #include <stdio.h> 26 #include <unistd.h> 27 #include <stdlib.h> 28 #include <fcntl.h> 29 #include <pthread.h> 30 31 pthread_mutex_t count_lock; 32 pthread_cond_t count_nonzero; 33 unsigned count = 0; 34 35 void * decrement_count(void *arg) 36 { 37 pthread_mutex_lock (&count_lock); 38 printf("decrement_count get count_lock\n"); 39 while(count==0) { 40 printf("decrement_count count == 0 \n"); 41 printf("decrement_count before cond_wait \n"); 42 pthread_cond_wait( &count_nonzero, &count_lock); 43 printf("decrement_count after cond_wait \n"); 44 } 45 count = count -1; 46 pthread_mutex_unlock (&count_lock); 47 } 48 49 void * increment_count(void *arg) 50 { 51 int ret; 52 pthread_mutex_lock(&count_lock); 53 printf("increment_count get count_lock\n"); 54 if(count==0) { 55 printf("increment_count before cond_signal\n"); 56 if (ret = pthread_cond_signal(&count_nonzero)) 57 printf("***********error codepthread_cond_signal %d******* \n", ret); 58 printf("increment_count after cond_signal\n"); 59 } 60 count=count+1; 61 pthread_mutex_unlock(&count_lock); 62 } 63 64 int main(void) 65 { 66 pthread_t tid1,tid2; 67 pthread_attr_t thread_attr1; 68 pthread_attr_t thread_attr2; 69 pthread_mutexattr_t mta; 70 pthread_mutexattr_init(&mta); 71 pthread_mutexattr_setprotocol(&mta, PTHREAD_PRIO_INHERIT); 72 73 pthread_attr_init(&thread_attr1); 74 pthread_attr_init(&thread_attr2); 75 76 pthread_mutex_init(&count_lock, &mta); 77 pthread_cond_init(&count_nonzero, NULL); 78 79 pthread_create(&tid1, &thread_attr1, decrement_count, NULL); 80 sleep(2); 81 pthread_create(&tid2, &thread_attr2, increment_count, NULL); 82 83 sleep(10); 84 pthread_join(tid1, NULL); 85 pthread_join(tid2, NULL); 86 //pthread_exit(0); 87 } Best Regards. William Lai -- To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html