Skip to Content.
Sympa Menu

freetds - Re: [freetds] 0.62.4 - got core in tds_free_socket

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "V.Kukushkin" <kvd AT internet2.ru>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] 0.62.4 - got core in tds_free_socket
  • Date: Thu, 2 Dec 2004 18:54:07 +0300

Frediano ,
it is a critical problem for me. In fact, I'm using simple query, but very
many times, very often.
And reliable connection is very important for me. Unfortunately I have no so
much time to test tds that is a part of big system.
And i feel that a logical problem in reconnection. So I think at that time I
need your advice in strategy sence.
Could you recommend the way - patch to 0.62 or new 0.63 or 0.64 where the
problem is fixed ? What to do now ?
Thanks in advance
---
Best regards,
Vladimir

----- Original Message -----
From: ZIGLIO, Frediano, VF-IT
To: FreeTDS Development Group
Sent: Thursday, December 02, 2004 5:40 PM
Subject: RE: [freetds] 0.62.4 - got core in tds_free_socket


>
> Hi all,
> I have encountered the problem with connection to sql server
> in 0.62.4 (cvs)
> To test connection function listed below I did following steps:
> 1) Start program (cable connected to network)
> 2) Make sql query and get positive result (means that tds
> socket is good)
> 3) Disconnect host cable from network
> 4) Got program aborted with core file
>
> Debugger said:
> #0 tds_free_results (res_info=0xffffffff) at mem.c:491
> 491 if (res_info->num_cols && res_info->columns) {
> (gdb) bt
> #0 tds_free_results (res_info=0xffffffff) at mem.c:491
> #1 0x0805aa43 in tds_free_all_results (tds=0x81c3840) at mem.c:514
> #2 0x0805b0c1 in tds_free_socket (tds=0x81c3840) at mem.c:767
> #3 0x08054fcd in MSQLconn::Connect() (this=0x8173a14) at
> ../MSQLconn.cc:129
> #4 0x0804a591 in PMstatThread_srv(void*) (arg=0x8174640)
> at test_dispatcher.cc:507
> #5 0x080bed51 in pthread_start_thread ()
>
> Who can say what's wrong here ? How to fix the problem ?
> Thanks in advance
> Vladimir
> ===================================================================
> int MSQLconn::Connect()
> {
> int errcode = 0;
> _sqlerror[0] = 0;
> if(!_tds_context || !_connect_info)
> {
> CDEBUG << "SQL: connection not initialized (host="<<_server<<"
> login="<<_login<<")\n";
> return 1;
> }
> if(_tds )
> tds_free_socket(_tds);
> _tds = tds_alloc_socket(_tds_context, 512);
> if( !_tds )
> {
> CDEBUG << "SQL: socket allocation failed (host="<<_server<<"
> login="<<_login<<")\n";
> return 1;
> }
> if(tds_connect(_tds, _connect_info) == TDS_FAIL)
> {
> CDEBUG << "SQL: connection failed (host="<<_server<<"
> login="<<_login<<")\n";
> return 1;
> }
> if(_sqlerror[0])
> errcode = 1;
> return errcode;
> }
>

This should be a partial program. Well you call MSQLconn::Connect, issue
a query and get a results. Then you unplug the cable. Now I don't
understand which code call MSQLconn::Connect again... also in 0.62/0.63
(not in 0.64) if tds_connect return failure TDSSOCKET it's no more
valid. You should then set _tds to NULL.
Can you post FreeTDS dump ?

freddy77
_______________________________________________
FreeTDS mailing list
FreeTDS AT lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds





Archive powered by MHonArc 2.6.24.

Top of Page