All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dirk Morris <dmorris@metaloft.com>
To: linux-kernel@vger.kernel.org
Subject: miscellaneous interrupted system call.
Date: Tue, 28 Sep 2004 11:28:30 -0700	[thread overview]
Message-ID: <4159AD4E.7020402@metaloft.com> (raw)

I'm getting random threads woken up when other threads make a 
system("foo") call.

I've been having the sympton since the 2.5 series.
It does not happen in the 2.4 series.
I thought it was somehow related to the futex_badness, but now I think 
it may be some libc NPTL issue.

Any ideas?

Sample program:
/* $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:
~/misc # ./foo 
                                                                                

sem_wait: Interrupted system call
sem_wait: Interrupted system call
...

Machine info:
It happens on all my 2.5/2.6 machines, all running debian 
testing/unstable in some flavor.
Here's one example:

~/misc # uname 
-a                                                                                     

Linux bebe 2.6.8.1 #2 SMP Fri Aug 20 13:32:31 PDT 2004 i686 GNU/Linux
~/misc # gcc 
-v                                                                                     

Reading specs from /usr/lib/gcc-lib/i486-linux/3.3.4/specs
Configured with: ../src/configure -v 
--enable-languages=c,c++,java,f77,pascal,objc,ada,treelang --prefix=/usr 
--mandir=/usr/share/man --infodir=/usr/share/info 
--with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared 
--with-system-zlib --enable-nls --without-included-gettext 
--enable-__cxa_atexit --enable-clocale=gnu --enable-debug 
--enable-java-gc=boehm --enable-java-awt=xlib --enable-objc-gc i486-linux
Thread model: posix
gcc version 3.3.4 (Debian 1:3.3.4-6sarge1)


Thanks,

-Dirk



                 reply	other threads:[~2004-09-28 18:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4159AD4E.7020402@metaloft.com \
    --to=dmorris@metaloft.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.