Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 5FE9F65014C for ; Tue, 16 Sep 2008 09:41:10 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 27852-05 for ; Tue, 16 Sep 2008 09:41:01 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 66D5564FE0F for ; Tue, 16 Sep 2008 09:35:59 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id m8GCZt48027302; Tue, 16 Sep 2008 08:35:55 -0400 (EDT) To: Zoltan Boszormenyi cc: sfrost@snowman.net, pgsql-odbc@postgresql.org Subject: Re: psqlODBC and IPv6 In-reply-to: <48CFA037.8020603@cybertec.at> References: <48CF52F4.6040206@cybertec.at> <20080916112701.GZ16005@tamriel.snowman.net> <48CF9B3A.6040308@cybertec.at> <48CFA037.8020603@cybertec.at> Comments: In-reply-to Zoltan Boszormenyi message dated "Tue, 16 Sep 2008 14:01:59 +0200" Date: Tue, 16 Sep 2008 08:35:55 -0400 Message-ID: <27301.1221568555@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200809/13 X-Sequence-Number: 9606 Zoltan Boszormenyi 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