freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
- From: James Cameron <james.cameron AT compaq.com>
- To: TDS Development Group <freetds AT franklin.metalab.unc.edu>
- Subject: Re: Segmentation fault
- Date: 11 Apr 2002 09:34:54 +1000
On Thu, 2002-04-11 at 01:38, The Guyver wrote:
> connect: Connection refused
> DB-Library: Login incorrect.
> [Wed Apr 10 17:14:42 2002] [notice] child pid 17393 exit signal Segmentation
> fault (11)
Usually caused by incorrect database name in the PHP script, or
incorrect or missing information for that database in either the
freetds.conf or interfaces file. Can also be caused by no SQL server
running, but you say you've checked that.
To diagnose further, either use tcpdump to look for outgoing
connections, or adopt the patch I made to src/tds/login.c a few days
ago. This will enhance the error report for the connection refusal so
that you can see the IP address and port number it is trying. Then you
should find that you can't make the same connection yourself manually.
The segmentation fault after failure to connect is known on 0.53, and I
think it has been fixed in CVS since then.
--
James Cameron (james.cameron AT compaq.com)
http://quozl.linux.org.au/ (or) http://quozl.netrek.org/
Index: login.c =================================================================== RCS file: /cvsroot/freetds/freetds/src/tds/login.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- login.c 8 Apr 2002 02:49:48 -0000 1.17 +++ login.c 8 Apr 2002 08:18:01 -0000 1.18 @@ -27,7 +27,7 @@ #define IOCTL(a,b,c) ioctl(a, b, c) #endif -static char software_version[] = "$Id: login.c,v 1.17 2002/04/08 02:49:48 quozl Exp $"; +static char software_version[] = "$Id: login.c,v 1.18 2002/04/08 08:18:01 quozl Exp $"; static void *no_unused_var_warn[] = {software_version, no_unused_var_warn}; @@ -218,7 +218,7 @@ retval = connect(tds->s, (struct sockaddr *) &sin, sizeof(sin)); if (retval < 0 && errno == EINPROGRESS) retval = 0; if (retval < 0) { - perror("src/tds/login.c: tds_connect"); + perror("src/tds/login.c: tds_connect (timed)"); tds_free_config(config); tds_free_socket(tds); return NULL; @@ -252,7 +252,11 @@ } } else { if (connect(tds->s, (struct sockaddr *) &sin, sizeof(sin)) <0) { - perror("src/tds/login.c: tds_connect"); + char *message = malloc(128); + sprintf(message, "src/tds/login.c: tds_connect: %s:%d", + inet_ntoa(sin.sin_addr), ntohs(sin.sin_port)); + perror(message); + free(message); tds_free_config(config); tds_free_socket(tds); return NULL;
Attachment:
signature.asc
Description: This is a digitally signed message part
-
Segmentation fault,
The Guyver, 04/10/2002
- <Possible follow-up(s)>
- Re: Segmentation fault, Pletyak Attila, 04/10/2002
- Re: Segmentation fault, James Cameron, 04/10/2002
Archive powered by MHonArc 2.6.24.