Message4442

Author amak
Recipients amak, billiejoex, irmen, zyasoft
Date 2009-04-05.13:32:36
SpamBayes Score 7.2434835e-07
Marked as misclassified No
Message-id <1238938357.36.0.386570785685.issue1291@psf.upfronthosting.co.za>
In-reply-to
Content
Using the attached pure java server and client, I can reliably reproduce
the bug on JDK 1.5.0_17, on my Windows Server 2003 box.

After approx 8000 iterations of the client, the server crashes with the
following exception.

Exception in thread "main" java.io.IOException: Unable to establish
loopback connection
        at sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:106)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.nio.ch.PipeImpl.<init>(PipeImpl.java:122)
        at
sun.nio.ch.SelectorProviderImpl.openPipe(SelectorProviderImpl.java:27)
        at java.nio.channels.Pipe.open(Pipe.java:133)
        at
sun.nio.ch.WindowsSelectorImpl.<init>(WindowsSelectorImpl.java:106)
        at
sun.nio.ch.WindowsSelectorProvider.openSelector(WindowsSelectorProvider.java:26)
        at java.nio.channels.Selector.open(Selector.java:209)
        at server$handler.process(server.java:42)
        at server.main(server.java:91)
Caused by: java.net.BindException: Address already in use: connect
        at sun.nio.ch.Net.connect(Native Method)
        at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:464)
        at java.nio.channels.SocketChannel.open(SocketChannel.java:146)
        at sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:78)
        ... 9 more

After the crash, when I issue the command "netstat -ano", I get
thousands of sockets, in the state "TIME_WAIT", and pid of 0:

  Proto  Local Address          Foreign Address        State           PID
  TCP    127.0.0.1:1040         127.0.0.1:1052         TIME_WAIT       0
  TCP    127.0.0.1:1042         127.0.0.1:1044         TIME_WAIT       0
  TCP    127.0.0.1:1044         127.0.0.1:1050         TIME_WAIT       0
  TCP    127.0.0.1:1047         127.0.0.1:1050         TIME_WAIT       0
  TCP    127.0.0.1:1048         127.0.0.1:1050         TIME_WAIT       0
  TCP    127.0.0.1:1050         127.0.0.1:1052         TIME_WAIT       0
  TCP    127.0.0.1:1051         127.0.0.1:1052         TIME_WAIT       0
  TCP    127.0.0.1:1052         127.0.0.1:1076         TIME_WAIT       0
  TCP    127.0.0.1:1055         127.0.0.1:1059         TIME_WAIT       0
  TCP    127.0.0.1:1057         127.0.0.1:1059         TIME_WAIT       0
History
Date User Action Args
2009-04-05 13:32:37amaksetmessageid: <1238938357.36.0.386570785685.issue1291@psf.upfronthosting.co.za>
2009-04-05 13:32:37amaksetrecipients: + amak, irmen, billiejoex, zyasoft
2009-04-05 13:32:37amaklinkissue1291 messages
2009-04-05 13:32:36amakcreate