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: liam AT inodes.org
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] tdsdump SIGSEGV with mt apps
  • Date: Tue, 17 May 2005 13:12:13 +1000

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.

>From memory, I saw crashes and corruption mostly during things like
closing and opening dblib connections while other threads process
queries on other untouched dblib connections. Obviously, each connection
is protected by an application mutex. The underlying dblib routines
modify connection_list and this will not work well with other threads
access it without mutual exclusion.

I don't think it's necessary to discuss this matter any further. I
think we all agree that we need mutual exclusion and thread safety measures
of one form of another in dblib. Let's concentrate on the solution.

> your application hang inside dblib? I think that a solution is to use a
> reference counter for tds_ctx. Increment while creating TDSSOCKET or
> dbinit and decrement while destroying TDSSOCKET or dbexit.

I disagree, I would say the right solution is a tds_ctx per DBPROCESS.
That way, almost all the thread safety and mutual exclusion problems
go away.

Thanks.




Archive powered by MHonArc 2.6.24.

Top of Page