Skip to Content.
Sympa Menu

freetds - RE: tds_process_login_tokens()

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Lowden, James K" <LowdenJK AT bernstein.com>
  • To: "'TDS Development Group'" <freetds AT franklin.metalab.unc.edu>
  • Subject: RE: tds_process_login_tokens()
  • Date: Tue, 6 Aug 2002 16:41:38 -0400


> From: Coleman, Dave [mailto:DColeman AT US.TIAuto.com]
> Sent: August 5, 2002 4:23 PM
>
> Hello. For some time, I have been tracing a memory leak in
> my software. [...] I've been ignored, and I get the feeling no one
> believes me that you guys are leaking.

Dave,

AFAICT, Brian's last word on the subject was a query to you 6 weeks ago, Thu
7/4/2002 8:39 AM.:

"So dave, let me know if you are still having problems and if you are, how
you are gauging the memory leak."

Let me be the first to thank you for letting us know you're still seeing a
problem.

I don't know why you "get the feeling no one believes" you; I don't see any
evidence of that on the list. And do you really think a same-day question
from the fellow who originated the project constitutes being "ignored"?
Particularly when he went to the trouble of modifying the project to support
dmalloc, and tested it for you?

Refutation here is not disputation. FreeTDS lives in a complex environment
that yields lots of opportunities to look foolish or simply to talk past
each other. When someone says, "I don't see that", it's not an argument;
it's a statement of fact. The right response -- which you very helpfully
included -- is more detail.

This list isn't a wrestling match; it's a pursuit of truth. Truth is
elusive. It typically makes itself known by glimmers and whispers, and
tends not to be noticed amidst clamor and strife. That is, it's only
available to you if you're available to it.

So, please, next time you're feeling ignored and disbelieved (an unlikely
combination, by the way, don't you think?), check your facts. Anyone,
including you, is welcome to join, and no one, including you, wants the
unpleasantness and distraction of being snarled at.

Those are my "thoughts and suggestions" thus far. When I get a useful block
of time, I'll try to follow your instructions and let you know what I turn
up.

Regards,

--jkl

> This leak occurs when the TDS API is used to log in and out
> multiple times.
> I was informed some time ago that this leak was none of your
> concern and was
> an artifact of gethostbyname(), which is obviously outside of
> your pervue.
> I hate to inform you that this is not the case. If
> tds_process_login_tokens
> is commented out of the login sequence, then the leak will not occur.
> (obviously, no connection will be made properly either, this is the
> problem). I am implementing this library for data collection on
> manufacturing equipment. This requires a non-persistant
> connection as a
> result of this environment. I have attatched a dump file. I
> have also
> added a few messages in your code, just for my own debugging,
> they were
> memory allocation type messages, and I swear that I have not
> modified any
> functional code.
>
> I have broken my connection method into two functions so that
> it may be
> compatible with tds_connect when it is fixed.
> tdsDB::connectSock() is my
> function. tdsDB::openDB() is an attempt to create a clean version of
> tds_connect(). Here is where I have isolated the memory leak to
> tds_process_login_tokens(). I do not want to mess around
> with your code
> more than adding tdsdump_log calls for my own FYI. I would appreciate
> someone with intimate knowledge of the inner workings of this
> part of the
> API to attempt to prove or disprove this by making these
> modifications.
>
> 1) make t0001 in src/tds/unittests loop multiple times
> around the log
> in/out commands.
> 2) comment out the if( !tds_process_login_tokens) statement.
> 3) do whatever is needed for t0001 to successfully run
> even though the
> login tokens will not be processed and the connection will
> most likely not
> be actively established. (I'd imagine that at some point a
> TDS_FAIL will
> end up surfacing as a result of not processing tokens properly)
> 4) run the program, and watch it leak.
>
> I am aware that gethostbyname() does leak. My application
> leaks ~3.1K the
> first time the connectSock() method is called. This is avoided in the
> future, because the TDSSOCKET, TDSCONFIGINFO, and TDSLOGIN
> are cached w/in
> the class and re-used with new calls to socket() and connect().
>
> A bunch of the extra 'free' stuff at the end of openDB() is
> not necessary,
> it was just a vain attempt to chase the leak in places it did
> not exist.
>
> Please respond with your thoughts and suggestions.


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.






Archive powered by MHonArc 2.6.24.

Top of Page