When I add the modules socket and close and use a simple program that only creates a socket and closes it I get the following error in gdb:
gdb: unknown target exception 0xc0000008 at 0x774d12f7
Program received signal ?, Unknown signal.
0x776815de in ntdll!LdrQueryProcessModuleInformation () from C:\Windows\system32\ntdll.dll
Single stepping until exit from function ntdll!LdrQueryProcessModuleInformation,
which has no line number information.
[New Thread 12024.0x27d0]
Apparently this happens during close() where in the file sockets.c it closes the socket handle using closesocket() and then the file descriptor using _close(). The call to _close() fails with this signal.