lkml.org 
[lkml]   [2004]   [Mar]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [2.6.2] Badness in futex_wait revisited
Jamie Lokier wrote:

>If you have a small test program (or pair of programs) that
>consistently triggers this message on any machine running 2.6.4, that
>would be very helpful indeed.
>
>
Here ya go. :)

* $Id: foo.c,v 1.00 2004/03/31 10:51:19 dmorris Exp $ */
/* gcc foo.c -o foo -pthread */
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <pthread.h>
#include <semaphore.h>

sem_t sem;

void* make_system_call (void* arg)
{
while(1) {
sleep(1);
system("/bin/true");
}
return NULL;
}

int main(void)
{
pthread_t id;
sem_init(&sem,0,0);
pthread_create(&id,NULL,make_system_call,NULL);
while (sem_wait(&sem)<0)
perror("sem_wait");
return 0;
}



Output for me is :
~ # uname
-a
[dmorris @ gobbles]
Linux gobbles 2.6.4 #2 SMP Mon Mar 29 17:15:08 PST 2004 i686 GNU/Linux
~ #
./foo
[dmorris @ gobbles]
sem_wait: Interrupted system call
sem_wait: Interrupted system call
sem_wait: Interrupted system call
sem_wait: Interrupted system call
...


meanwhile kern.log spits out:
Mar 30 16:40:23 gobbles kernel: Badness in futex_wait at kernel/futex.c:508
Mar 30 16:40:23 gobbles kernel: Call Trace:
Mar 30 16:40:23 gobbles kernel: [<c0139a28>] futex_wait+0x1a8/0x1c0
Mar 30 16:40:23 gobbles kernel: [<c011efc0>] default_wake_function+0x0/0x20
Mar 30 16:40:23 gobbles kernel: [<c011efc0>] default_wake_function+0x0/0x20
Mar 30 16:40:23 gobbles kernel: [<c012d020>] do_timer+0xc0/0xd0
Mar 30 16:40:23 gobbles kernel: [<c0139d30>] do_futex+0x70/0x80
Mar 30 16:40:23 gobbles kernel: [<c0139e64>] sys_futex+0x124/0x140
Mar 30 16:40:23 gobbles kernel: [<c015ef11>] sys_write+0x61/0x70
Mar 30 16:40:23 gobbles kernel: [<c01095db>] syscall_call+0x7/0xb
Mar 30 16:40:23 gobbles kernel:


I can do this on multiple machines, so I won't include all the box info.
If you need it let me know.

Thanks! :)
-Dirk



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:02    [W:2.014 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site