pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Zoltan Boszormenyi <zb@cybertec.at>
Cc: sfrost@snowman.net
Cc: pgsql-odbc@postgresql.org
Subject: Re: psqlODBC and IPv6
Date: Tue, 16 Sep 2008 08:35:55 -0400
Message-ID: <27301.1221568555@sss.pgh.pa.us> (raw)
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>

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



view thread (5+ messages)

Message-ID: <27301.1221568555@sss.pgh.pa.us>
Permalink:  ../27301.1221568555@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/27301.1221568555@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: tgl@sss.pgh.pa.us, zb@cybertec.at, sfrost@snowman.net
  Subject: Re: psqlODBC and IPv6
  In-Reply-To: <27301.1221568555@sss.pgh.pa.us>
  References: <48CF52F4.6040206@cybertec.at> <20080916112701.GZ16005@tamriel.snowman.net> <48CF9B3A.6040308@cybertec.at> <48CFA037.8020603@cybertec.at> <27301.1221568555@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox