[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Retry ServerSocket.accept (java-net.c _accept) on EINTR
From: |
Archie Cobbs |
Subject: |
Re: Retry ServerSocket.accept (java-net.c _accept) on EINTR |
Date: |
Sun, 25 Apr 2004 13:34:01 -0500 (CDT) |
Mark Wielaard wrote:
> This fixes a long standing bug were accept() would throw a IOException
> when the system call got interrupted. This happens for example with VMs
> like jamvm which uses signals to tell all threads to suspend or sablevm
> which you can send SIGQUIT to get a stacktrace of the current thread.
>
> 2004-04-25 Mark Wielaard <address@hidden>
>
> * native/jni/java-net/javanet.c (_javanet_accept): Retry when we get
> EINTR.
Hmm.. I wonder how many other instances of this bug there are.
E.g., connect(2), read(2), write(2), open(2), close(2), etc... can
all return EINTR if interrupted by a signal (often depends on the
situation of course).
For system calls that don't normally block (like read(2) from a
normal file), this would be very unlikely but in theory there's
nothing preventing a well-timed signal from causing EINR, though
in practice it probably depends on the O/S whether this can actually
happen.
If some O/S does allow this, then we possibly have lots of very
rare race condition bugs of this form...
-Archie
__________________________________________________________________________
Archie Cobbs * CTO, Awarix * http://www.awarix.com