Re: psqlODBC and IPv6

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: psqlODBC and IPv6
Дата
Msg-id 27301.1221568555@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: psqlODBC and IPv6  (Zoltan Boszormenyi <zb@cybertec.at>)
Список pgsql-odbc
Zoltan Boszormenyi <zb@cybertec.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

В списке pgsql-odbc по дате отправления:

Предыдущее
От: Zoltan Boszormenyi
Дата:
Сообщение: Re: psqlODBC and IPv6
Следующее
От: Tom Lane
Дата:
Сообщение: Compiler warnings in psqloodbc 08.03.0200