This is the mail archive of the
java-prs@gcc.gnu.org
mailing list for the Java project.
[Bug libgcj/15430] Cannot interrupt blocking I/O calls with close()
- From: "guilhem at kaffe dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: java-prs at gcc dot gnu dot org
- Date: 25 Nov 2005 19:10:06 -0000
- Subject: [Bug libgcj/15430] Cannot interrupt blocking I/O calls with close()
- References: <bug-15430-6651@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #11 from guilhem at kaffe dot org 2005-11-25 19:10 -------
I feel a potential race condition in this patch. What happens in that case ?
thread 2:
=> PlainSocketImpl.accept
=> enters _Jv_select
thread 1:
=> shutdown socket
=> close socket
thread 3:
=> create another socket which occurs to have the same fd.
thread 2:
=> select wakes up
=> we call accept with the old fd
thread 1:
=> set native_fd to -1
I expect this scheme may be a flaw and it is not forbidden by the current code.
A simple fix would be to add a synchronization lock before accepting the
connection.
Wrong ?
--
guilhem at kaffe dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |guilhem at kaffe dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15430