Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Jul 2008 08:40:04 GMT
From:      "Kian Mohageri" <kian.mohageri@gmail.com>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: kern/125940: connect(2) returning -1, errno unset
Message-ID:  <200807250840.m6P8e44o071034@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/125940; it has been noted by GNATS.

From: "Kian Mohageri" <kian.mohageri@gmail.com>
To: "Garrett Cooper" <yanefbsd@gmail.com>
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: kern/125940: connect(2) returning -1, errno unset
Date: Fri, 25 Jul 2008 01:09:17 -0700

 On Thu, Jul 24, 2008 at 9:32 PM, Garrett Cooper <yanefbsd@gmail.com> wrote:
 > On Thu, Jul 24, 2008 at 2:03 PM, Kian Mohageri <kian.mohageri@gmail.com> wrote:
 >>
 >>>Description:
 >>
 >> Using FreeTDS 0.82 I ran into this issue.  For some reason, the connection is failing (not sure why still).  connect(2) is returning -1 to indicate failure, but errno is unset.
 >>
 >> The relevant code from freetds-0.82 follows:
 >>
 >>    retval = connect(tds->s, (struct sockaddr *) &sin, sizeof(sin));
 >>    if (retval == 0) {
 >>        tdsdump_log(TDS_DBG_INFO2, "connection established\n");
 >>    } else {
 >>        tdsdump_log(TDS_DBG_ERROR, "tds_open_socket: connect(2) returned \"%s\"\n",        strerror(sock_errno));
 >>
 >> Debugging this further shows that retval is -1, but sock_errno (errno) is set to 0.  Setting it to an arbitrary value prior to connect(2) reveals that it isn't touched at all after the failed connect(2).
 >>
 >>>How-To-Repeat:
 >>
 >> Not entirely sure how to repeat it in a more generic environment.  This specific case is happening with php5-pdo_dblib, freetds-0.64 or freetds-0.82, and PHP via the command line.
 >
 > Could you please provide these steps for us?
 
 I apologize.  I still don't know what was going on and why connect(2)
 wasn't setting errno, but it appears the underlying problem has to do
 with an (unknown?) conflict between php5-pdo_oci/php5_oci and
 php5-pdo_dblib.  I'm looking into this further.
 
 Sorry for the noise, please close this.
 
 -Kian



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200807250840.m6P8e44o071034>