beta2 no longer builds with MSVC?

Started by Magnus Haganderover 20 years ago2 messages
#1Magnus Hagander
mha@sollentuna.net

Has anybody tried building beta2 or later with MSVC? It doesn'ät work for me - it builds fine, but whenever I run with it I get a coredump from it whenever I try to connect.

If I revert it to the 8.0 version of port/getaddrinfo.c, things work again.

The problem shows itself in that conn->addr_cur->ai_addr is NULL when it reaches the "CONNECTION_NEEDED" branch in PQconnectPoll().

Compiling with MingW appears to work fine.

//Magnus

#2Bruce Momjian
pgman@candle.pha.pa.us
In reply to: Magnus Hagander (#1)
1 attachment(s)
Re: beta2 no longer builds with MSVC?

Magnus Hagander wrote:

Has anybody tried building beta2 or later with MSVC? It doesn'?t work
for me - it builds fine, but whenever I run with it I get a coredump
from it whenever I try to connect.

If I revert it to the 8.0 version of port/getaddrinfo.c, things work
again.

The problem shows itself in that conn->addr_cur->ai_addr is NULL when
it reaches the "CONNECTION_NEEDED" branch in PQconnectPoll().

Compiling with MingW appears to work fine.

Strange. Would you try this patch and see if it helps? It disables the
lookups to call the Win32-native getaddrinfo routines.

(I know you are busy so maybe someone else can test MSVC.)

Another posssible fix would be to do a 'continue' in the loop if
conn->addr_cur->ai_addr is NULL, and see if that works.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Attachments:

/rtmp/difftext/plainDownload
Index: src/port/getaddrinfo.c
===================================================================
RCS file: /cvsroot/pgsql/src/port/getaddrinfo.c,v
retrieving revision 1.20
diff -c -c -r1.20 getaddrinfo.c
*** src/port/getaddrinfo.c	13 Oct 2005 23:22:11 -0000	1.20
--- src/port/getaddrinfo.c	13 Oct 2005 23:24:56 -0000
***************
*** 70,75 ****
--- 70,77 ----
  	void	   *hLibrary = NULL;
  	static bool alreadyLookedForIpv6routines = false;
  
+ return false;
+ 
  	if (alreadyLookedForIpv6routines)
  		return (getaddrinfo_ptr != NULL);