freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
- From: Eric Deutsch <edeutsch AT systemsbiology.org>
- To: TDS Development Group <freetds AT franklin.oit.unc.edu>
- Cc: Eric Deutsch <edeutsch AT systemsbiology.org>
- Subject: Re: CORE DUMP - Linux - TDSVER=7.0
- Date: Fri, 10 Aug 2001 11:49:55 -0700 (PDT)
I recently downloaded the latest CVS version of FreeTDS in order to try to
compile for Solaris, and find that it works for TDS 4.2 but not TDS 7.0,
in fact it seg faults. Compiling it under Linux causes the same problem,
whereas under FreeTDS 0.51, I can successfully use either 4.2 and 7.0 on
Linux, so it seems that TDS 7.0 broke since 0.51 (at least when accessing
SQL Server 2000 via Perl + Sybase.pm + FreeTDS). I know there has been
lots of added code in this area to add features.
I found the problems which caused the seg faults in login.c and applied
the following hacks to prevent the seg faults. This is not a proper fix,
but more or a hack. I hope the principle authors of FreeTDS can figure
out where the REAL problem lies and fix it there. In poking around, it
seemed a little like the pooling code already does a similar hack? so
maybe these problems don't occur for those using pooled connections? In
any case, once the seg faults are prevented, the end result is:
Unknown marker: 0!!
and a graceful termination of the program. So, this patch doesn't cause
the login and query to work, but at least there's no seg fault. I'm out
of time for now. Does anyone have any ideas why the above error?
thanks,
Eric
*** login.c:orig Sat Jul 28 08:45:45 2001
--- login.c Fri Aug 10 11:26:32 2001
***************
*** 121,128 ****
--- 121,131 ----
/* 13 + max string of 32bit int, 30 should cover it */
char query[30];
+ char *host_name; /* Deutsch*/
FD_ZERO (&fds);
/* end */
+ host_name = strdup("gremlin");
+ tds_set_host(login,host_name);
config = tds_get_config(tds, login);
***************
*** 226,230 ****
/* get_incoming(tds->s); */
if (!tds_process_login_tokens(tds)) {
! tds_free_config(config);
tds_free_socket(tds);
tds = NULL;
--- 229,233 ----
/* get_incoming(tds->s); */
if (!tds_process_login_tokens(tds)) {
! /*tds_free_config(config);*/
tds_free_socket(tds);
tds = NULL;
commentary: first seg fault is caused because config->host_name never
gets set, so when strlen() or any other function is called on it, seg
fault occurs. Where should login->host_name (and thus config->host_name
get originally set?). The second seg fault occurs when the login fails
and the tds_free_config() can be called twice, the second time causing a
seg fault. I commented out the above tds_free_config() because it appears
to be guaranteed that it will be called again a few lines later. An
alternate fix might be to "return NULL" at the end of this if block..
On Fri, 10 Aug 2001, Lance wrote:
>
> I am receiving a core dump.
>
> In my freetds.conf file the tds version = 7.0 (both global section
> and the section specific to my connection). The ms sql server is
> 7.0. I am using redhat with kernel 2.4.3.
>
> I am testing using the unittests in the dblib directory and get the dump.
>
> I can test the unittests in the tds directory without any problem!
>
> It also seg faults (core dumps) when I try to connect via PHP.
>
> I have tried both the .52 tarball and the latest CVS with the same results.
>
> HELP!!!!
>
> Lance
>
> ___________________________________________________________________
> To get your own FREE ZDNet Onebox - FREE voicemail, email, and fax,
> all in one place - sign up today at http://www.zdnetonebox.com
>
>
> ---
> You are currently subscribed to freetds as: [edeutsch AT systemsbiology.org]
> To unsubscribe, forward this message to $subst('Email.Unsub')
>
--
----------------------------------------------------------------------
Eric Deutsch email: edeutsch AT systemsbiology.org
Institute for Systems Biology Voice: (206) 732-1397
4225 Roosevelt Way NE, Suite 200 FAX: (206) 732-1260
Seattle, WA 98105-6099 TJ's Location
http://www.systemsbiology.org/
-
CORE DUMP - Linux - TDSVER=7.0,
Lance, 08/10/2001
- <Possible follow-up(s)>
- Re: CORE DUMP - Linux - TDSVER=7.0, Eric Deutsch, 08/10/2001
- Re: CORE DUMP - Linux - TDSVER=7.0, Mark J. Lilback, 08/10/2001
Archive powered by MHonArc 2.6.24.