RFR 8003833: Spurious NPE from Socket.getIn/OutputStream

Alan Bateman Alan.Bateman at oracle.com
Tue Nov 27 04:02:00 PST 2012


On 27/11/2012 11:44, Chris Hegarty wrote:
> This is a longstanding bug in the Socket code that was only noticed 
> recently as a result of some test changes that Daniel pushed in the 
> nio area.
>
> There is a very small window in 
> AbstractPlainSocketImpl.getIn/OutputStream where isClosedOrPending() 
> grabs the fdLock to check if the socket is closed, or not, and the 
> construction of the in/output stream, where another thread may 
> asynchronously close the socket.
>
> http://cr.openjdk.java.net/~chegar/8003833/webrev.00/webrev/
>
> -Chris.
This looks good to me.

-Alan



More information about the net-dev mailing list