Zoltan Boszormenyi <zb(at)cybertec(dot)at> writes:
> I just tested 08.03.0100 compiled with the difference quoted
> in my original mail. That single change made it work reliably
> over IPv6. It must be a very subtle side-effect of that typo.
Huh ... the IPv6 interaction is still obscure, but the .0100 code is
indubitably broken here. Now that I look at it, there isn't any local
or global variable named "socket" in this function. The compiler must
have interpreted "socket" as being the address of the socket()
function! ... so who knows what that comes out as being? Proof is
found by noting the warning on that line:
[psqlodbc-08.03.0100]$ make socket.o
gcc -DHAVE_CONFIG_H -I. -I/usr/include -I/home/tgl/testversion/include -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c socket.c
socket.c:178: warning: initialization from incompatible pointer type
socket.c: In function 'format_sockerr':
socket.c:198: warning: cast to pointer from integer of different size
socket.c: In function 'SOCK_wait_for_ready':
socket.c:475: warning: cast from pointer to integer of different size
socket.c:455: warning: 'no_timeout' may be used uninitialized in this function
I guess one possible theory is that SOCK_wait_for_ready() is simply
broken in .0100, but the kernel happens not to return EWOULDBLOCK
for local IPv4 connections whereas it sometimes does for IPv6?
BTW, isn't anyone paying attention to compiler warnings in this code base?
It looks to me like at least two of the three other warnings in this
file are also evidence of genuine bugs. A look through the build log
shows an uncomfortably large number of nontrivial-looking warnings in
other files, too.
regards, tom lane
In response to
pgsql-odbc by date
|Next:||From: Tom Lane||Date: 2008-09-16 13:12:52|
|Subject: Compiler warnings in psqloodbc 08.03.0200|
|Previous:||From: Zoltan Boszormenyi||Date: 2008-09-16 12:01:59|
|Subject: Re: psqlODBC and IPv6|