dbTalk Databases Forums  

[BUGS] BUG #1545: LIBPQ Windows Version not calling WSACleanup for every WSAStartup

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] BUG #1545: LIBPQ Windows Version not calling WSACleanup for every WSAStartup in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jason Erickson
 
Posts: n/a

Default [BUGS] BUG #1545: LIBPQ Windows Version not calling WSACleanup for every WSAStartup - 03-17-2005 , 11:24 PM







The following bug has been logged online:

Bug reference: 1545
Logged by: Jason Erickson
Email address: jerickso (AT) indian (DOT) com
PostgreSQL version: 8.0.1,7.4.7
Operating system: Windows
Description: LIBPQ Windows Version not calling WSACleanup for every
WSAStartup
Details:

Taken from microsoft at:
http://msdn.microsoft.com/library/de...us/winsock/win
sock/wsastartup_2.asp
-------------------------------------------------------
An application must call one WSACleanup call for every successful WSAStartup
call to allow third-party DLLs to make use of a WS2_32.DLL on behalf of an
application. This means, for example, that if an application calls
WSAStartup three times, it must call WSACleanup three times. The first two
calls to WSACleanup do nothing except decrement an internal counter; the
final WSACleanup call for the task does all necessary resource deallocation
for the task.
------------------------------------------------------------------

The only place WSACleanup is being called is libpqdll when the process
detaches the DLL (if the libpq is not staticly linked in), which matches up
with the WSAStartup when the process attaches to the DLL.

The WSAStartup in the fe-connect.c->makeEmptyPGconn() does not have a
matching WSACleanup. WSACleanup could possibly be placed in freePGconn(),
but unsure if all possible error cases will go through this function.

This problem exists in both 8.0.1 and 7.4.7 of the libpq interface for
Windows.

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.