I first experienced a similar problem with the Internet Connection
Sharing as described here:
Microsoft issued a hotfix to fix that issue, and my web crawler worked
fine for some time. However, sometime late 2008, I started seeing the
same symptoms again. I think some update from Windows Update has
brought the problem back, but I have no idea which one. Anyway, the
test script still causes networking failures, but this time Internet
Connection Sharing doesn't seem to be part of it.
To reproduce the problem, you can run the Perl script attached at the
end of this post (to run Perl scripts, please download the Perl
runtime from http://www.activestate.com/activeperl/
first). The script
is very simple, it reads the same page repeatedly. You can substitute
a real web page for http://127.0.0.1/test.htm
. I used a test.htm file
that consisted of a linefeed only (2 bytes). Obviously, Vista IIS 7 is
serving the page from localhost.
The test script runs fine for about 9000 fetches after which all
network connectivity is lost. My computer can no longer connect to any
other computer. The problem applies to all software (and all users),
and none of them can open new connections. Existing connections work
After the problem appears, the only way to get rid of it is to reboot
my computer. Waiting with no activity doesn't help. I have tried
waiting several hours, once even close to 12 hours.
Before Vista SP2 "netstat -s" showed a large number of Current
Connections, and "netstat -n" a large number of ESTABLISHED
connections. After Vista SP2, however, current connections drop
quickly after running the test script, and open connections vanish,
but the problem still persists.
I have tested the script on the following systems, and the problem has
appeared on all of them:
- Windows Vista Business 32-bit with SP1
- Windows Vista Home 64-bit with SP1
- Windows Vista Ultimate 64-bit with SP1
- Windows Vista Ultimate 64-bit with SP2
The problem does not appear on Windows XP (tested with a 32-bit
version). I am currently running my web crawlers on virtual machines
with Windows XP. If I run them on my Vista computer, they corrupt the
network connectivity in less than 4 hours of runtime.
The problem is probably related to the way Perl opens sockets. The
problem seems to happen with Perl only; if I create a similar test
script with MSXML, no problems occur. Also, if I specify the
keep_alive option to LWP::UserAgent->new, the problem doesn't occur so
quickly. I can run my crawlers for several days with this option, but
eventually the problem happens.
It seems that Perl opens sockets and does not close them properly. I
think the fact that those sockets affect network connectivity long
after the Perl.exe process has exited is a bug in Windows Vista.
If Perl were to fix this issue somehow, I still think there whould be
a bug left in Windows Vista. It would resurface with some other
software, including malicious ones that may want to do so on purpose.
Also note that the test script runs without administrative access, and
it causes a system-wide problem.
If anyone can reproduce the problem, please post here.