This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libgcj/29604] Race condition in ServerSocket.accept()



------- Comment #2 from daney at gcc dot gnu dot org  2006-10-26 17:56 -------
This is trickier than I initially thought.

You cannot remained blocked in accept() while holding a lock that protects
closing the native_fd.  Otherwise you will be blocked until a connection
arrives (perhaps forever).  If we can shutdown the socket without holding the
lock, but not close it, there may be a path that will not deadlock.  Not
closing the native_fd is key as doing that allows the OS to open a new resource
with the same fd.  Which is the problem to be solved. 


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29604


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]