Skip to Content.
Sympa Menu

freetds - RE: Help required

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: John Seers <John.Seers AT uk.lionbioscience.com>
  • To: TDS Development Group <freetds AT franklin.metalab.unc.edu>
  • Subject: RE: Help required
  • Date: Tue, 13 Aug 2002 19:08:24 +0100


Thanks for the welcome.

OK, sorry if I did not give enough information first time but I was
fairly certain I had hit the problem described and got excited. (I have
been fighting with it for a couple of days now).

A little more about what I have been doing. I downloaded 0.53 and this
was my first experience with freetds.

I am connecting to MS SQL Server 2000 from a Linux intel platform.

The server is Windows 2000.

I have built on two Linux platforms:

0.53
Linux braque.lionbio.co.uk 2.2.14-5.0 #2 SMP Thu Aug 31 15:21:20 BST
2000 i686 unknown

Snapshot
Linux pollock 2.4.17 #1 SMP Fri Jan 11 15:03:13 GMT 2002 i686 unknown

The first platform is the one I have been working on with 0.53. (I have
now downloaded the Snapshot and have built on the second platform. The
reason I switched was because I could not build the snapshot on the
first platform because of an internal compiler error - but that is
another story for now. My current snapshot build is going backwards at
the moment as I cannot run the unittests and I am investigating that at
the moment. Running the small C program I get the message "Unknown
marker: 0!!".)

So ignore that for now and back to the 0.53 build:

I built using TDSVER=7.0. Also I have not installed in the standard
libraries as I have to get Systems to install in the standard libraries
- I will do that later when I know more what I am doing.

Here is the output from the C program:

seers@braque> ./mytest
About to start at cs_ctx_alloc
At ct_init
At ct_con_alloc
At ct_con_props 1
At ct_con_props 2
At ct_connect
Connected successfully
Successful run command 1
Successful run command 2

OK, not very illuminating for you but it shows that the basic
environment is probably correct and I am getting some sort of a dialog
with the database server.

I ran the unittests successfully. I decided to use ctlib for now as that
seemed more modern than dblib and perhaps faster than odbc. I wrote some
C++ code which hit the problem. So I wrote a small C program (output
above) to prove I could connect etc and that apparently worked fine. I
have changed the C++ program to mimic the small C program as closely as
I can.

Stepping though using gdb showed the value of aStruct/tds becoming zero
at some stage. Here is some of the gdb output:


#0 0x00000010 in ?? ()
(gdb)
(gdb)
(gdb)
(gdb)
(gdb)
(gdb) up
#1 0x407339de in ctlib_handle_info_message (aStruct=0x889bc70) at
ctutil.c:38
38 return ctlib_handle_err_message(aStruct);
(gdb) up
#2 0x4073647b in tds_process_msg (tds=0x889bc70, marker=171) at
token.c:1214
1214 g_tds_msg_handler(tds);
(gdb) up
#3 0x40734ba9 in tds_process_default_tokens (tds=0x889bc70, marker=171)
at token.c:101
101 return tds_process_msg(tds,marker);
(gdb) p tds
$1 = (TDSSOCKET *) 0x889bc70
(gdb) down
#2 0x4073647b in tds_process_msg (tds=0x889bc70, marker=171) at
token.c:1214
1214 g_tds_msg_handler(tds);
(gdb) p tds
$2 = (TDSSOCKET *) 0x0
(gdb) up
#3 0x40734ba9 in tds_process_default_tokens (tds=0x889bc70, marker=171)
at token.c:101
101 return tds_process_msg(tds,marker);
(gdb) up
#4 0x40734d0a in tds_process_login_tokens (tds=0x889bc70) at
token.c:209
209 if
(tds_process_default_tokens(tds,marker)
==TDS_FAIL)
(gdb) up
#5 0x40737996 in tds_connect (login=0x889bad0, parent=0x889baa8) at
login.c:240
240 if (!tds_process_login_tokens(tds)) {
(gdb) up
#6 0x40731a73 in ct_connect (con=0x889baa8, servername=0xbfffe954
"MyServer70",
snamelen=2) at ct.c:303
303 if (!(con->tds_socket = (void *)
tds_connect(con->tds_login, (void
*) con))) {
(gdb) up
#7 0x4002c844 in RdbSqlTDS::initialise (this=0x889b8f0) at
RdbSqlTDS.cpp:129
129 ret=ct_connect((CS_CONNECTION*)tdsconn, SERVER,CS_NULLTERM);
Current language: auto; currently c++
(gdb)

I am very grateful for any help. Apologies in advance if it is a
beginner type problem.

Thanks.


John Seers



"Lowden, James K" wrote:
>
> > From: John Seers [mailto:John.Seers AT uk.lionbioscience.com]
> > Sent: August 13, 2002 11:30 AM
> >
> > Hello
>
> Welcome.
>
> > I have been working with 0.53, and connecting using ctlib. I
> > can connect
> > with a little C program but repeating the code in a rather
> > more complex
> > environment I get a segfault calling ct_connect. Tracing
> > through using gdb
> > (see a few line below) I get aStruct change to NULL which I think is
> > something to do with the ctx.
> >
> > The instructions below talk about adding the config.h line to
> > tsql.c but I
> > cannot find that in my set up. I notice a fix has been booked in.
>
> A lot of useful work has gone into the codebase since 0.53; tsql is part of
> it.
>
> Tell us a little more about your setup. Client OS and hardware
> architecture, and server vendor & version. I suspect you're bumping into a
> runtime configuration issue. FreeTDS isn't flawless, but lots of code that
> relies on ct-lib gets further than just connecting.
>
> The standard advice is to install sqsh (which uses ct-lib). If sqsh works,
> you have to reexamine your code; if not, it's almost always a runtime
> environment problem.
>
> > Should I
> > download the "Snapshot" to pick this up? I would prefer to work with a
> > release rather than being too leading edge at the moment and
> > I assume the Snapshot is right at the edge.
>
> I would normally recommend using the snapshot, but several basic conversion
> errors have been reported with it that haven't been fixed yet, so I can't
> recommend the latest snapshot to you unless you're prepared to update it
> every few days.
>
> > Very grateful for help and advice to get me going again in the right
> > direction.
>
> HTH.
>
> --jkl
>
> The information contained in this transmission may contain privileged and
> confidential information and is intended only for the use of the person(s)
> named above. If you are not the intended recipient, or an employee or agent
> responsible for delivering this message to the intended recipient, any
> review, dissemination, distribution or duplication of this communication is
> strictly prohibited. If you are not the intended recipient, please contact
> the sender immediately by reply e-mail and destroy all copies of the
> original message. Please note that for certain accounts we do not accept
> orders and/or instructions by e-mail, and for those accounts we will not be
> responsible for carrying out such orders and/or instructions. Kindly refrain
> from sending orders or instructions by e-mail unless you have confirmed that
> we accept such communications for your account. Please also note that to
> satisfy regulatory requirements we review the outgoing and incoming e-mail
> correspondence of staff members serving certain functions.
>
> ---
> You are currently subscribed to freetds as:
> [John.Seers AT uk.lionbioscience.com]
> To unsubscribe, forward this message to $subst('Email.Unsub')
begin:vcard 
n:Seers;John
tel;cell:07900 498885
tel;fax:01223 224701
tel;home:01603 660746
tel;work:01223 224729
x-mozilla-html:FALSE
adr:;;;;;;
version:2.1
email;internet:John.Seers AT uk.lionbioscience.com
fn:John Seers
end:vcard



Archive powered by MHonArc 2.6.24.

Top of Page