This is the mail archive of the mailing list for the Cygwin 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]

_exit() missing WSACleanup() call?

Hash: SHA1

Hi developers,

I have serious trouble with a project which I'm trying to port to CYGWIN. This 
project makes heavy use of fork() (actually fork2() to detach from the init 
process) and child processes' file handles are almost always sockets.

Now I read that CYGWIN handles this case by silentrly calling WSAStartup() for 
every child that inherits a socket handle - but the CYGWIN libc 
implementation does not seem to call WSACleanup() during the _exit() function 
cleanup in that case?

The effect is that after a few minutes, after maybe 100 child processes were 
forked and exited again, Windows does something on a severity scale between 
displaying message boxes about a lack of resources to hard lockups with 
faults in 'kernel32.dll'. I'm lost.

I tried to WSACleanup() in my user osd_exit() function to no avail. My best 
guess is that there are other resources which I cannot give free this way?

The same project runs fine for days on various FreeBSD and GNU/Linux systems.

I also tried to find something related in the cygwin DLL source code and only 
saw that there is no obvious WSACleanup() call somewhere.

Juergen Buchmueller
Version: GnuPG v1.0.7 (FreeBSD)


Unsubscribe info:
Bug reporting:

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