Skip to Content.
Sympa Menu

freetds - RE: [freetds] tdsdump SIGSEGV with mt apps

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "ZIGLIO, Frediano, VF-IT" <Frediano.Ziglio AT vodafone.com>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: RE: [freetds] tdsdump SIGSEGV with mt apps
  • Date: Tue, 17 May 2005 11:23:23 +0200

>
> On Mon, May 09, 2005 at 02:05:17PM +0200, ZIGLIO, Frediano,
> VF-IT wrote:
>
> > Are you using current CVS? Do you call dbexit while other thread are
> > processing data? Try to remove dbexit call with current
> CVS. Where does
>
> Of course not! That would most certainly result in a
> disaster. The version
> of FreeTDS I use currently is a heavily patched 0.63.
>

Oh, I noted in your patch that in dbclose you call dblib_del_connection
after tds_free_socket, this can lead to possible problems, imagine:
- dbclose calls tds_free_socket
- another thread call dbopen, tds_alloc_socket return same pointer and
add to list with dblib_add_connection
- dbclose call dblib_del_connection with saved pointer removing a
correct connection

I wrote a small test to test current CVS. It works (attached). Sometimes
a connection fails (I think server don't accept all that connection so
faster). No leaks or memory detected on test (only small leaks removed
if connection fails, some error on pthread/glibc perhaps false errors).

freddy77

Attachment: thread.c.gz
Description: thread.c.gz




Archive powered by MHonArc 2.6.24.

Top of Page