Re: [tcljava-dev] bug 2866640, tclblend - potential memory leak
Brought to you by:
mdejong
From: Anthony B. <Ant...@ev...> - 2010-04-07 12:49:33
|
Hi Mo, Thanks, I thought it wouldn't be easy. I will get it tested today. cheers Tony -----Original Message----- From: Mo DeJong [mailto:mo...@mo...] Sent: 06 April 2010 09:16 To: discuss implementaition and patches here Subject: Re: [tcljava-dev] bug 2866640, tclblend - potential memory leak Hi Anthony Wow, that was a tricky bug to figure out the proper fix for. Please try out Patch 2982514, it should address the leak you were seeing, but verification of the fix is needed. I will append it to this email since it is very small. Mo DeJong RCS file: /cvsroot/tcljava/tcljava/src/native/javaObj.c,v retrieving revision 1.17 diff -u -r1.17 javaObj.c --- src/native/javaObj.c 31 Dec 2002 20:16:27 -0000 1.17 +++ src/native/javaObj.c 6 Apr 2010 08:00:36 -0000 @@ -233,6 +233,13 @@ jobject exception; /* + * If object was freed already, or if the ptr2 field was + * explicitly set to NULL, then do nothing. + */ + if (object == NULL) + return; + + /* * Clear pending Java exception. */ @@ -969,8 +976,8 @@ if (objPtr->bytes == NULL) { UpdateTclObject(objPtr); } - objPtr->typePtr = NULL; ptr2 = objPtr->internalRep.twoPtrValue.ptr2; + objPtr->internalRep.twoPtrValue.ptr2 = NULL; result = (oldCmdType.setFromAnyProc)(interp, objPtr); objPtr->internalRep.twoPtrValue.ptr2 = ptr2; } else { Anthony Borthwick wrote: > Hi, > > I added some test code to the bug report which demonstrates this issue. > Is there any news? > > Tony > > -----Original Message----- > From: Mo DeJong [mailto:mo...@mo...] > Sent: 04 February 2010 19:33 > To: discuss implementaition and patches here > Subject: Re: [tcljava-dev] bug 2866640, tclblend - potential memory leak > > Anthony Borthwick wrote: > >> Hi, >> >> >> >> Just wondering if anything is being done with this issue >> >> >> >> >> > http://sourceforge.net/tracker/?func=detail&aid=2866640&group_id=13005&a > tid=113005 > > <http://sourceforge.net/tracker/?func=detail&aid=2866640&group_id=13005& > atid=113005> > >> >> >> Tony >> >> >> > Memory leak? Well, I am willing to take a look at it today. But, could > you provide a small script example that demonstrates how this bug can be > > reproduced? Often, it is very difficult to figure out how to reproduce > the problem without an example of how to generate the bug. You could > post it here or append it to the bug report. > > Mo > ------------------------------------------------------------------------ ------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ tcljava-dev mailing list tcl...@li... https://lists.sourceforge.net/lists/listinfo/tcljava-dev This e-mail and any attachments may be confidential and/or legally privileged. If you have received this e-mail and you are not a named addressee, please inform Evolving Systems TIS at ti...@ev... and then delete the e-mail from your system. If you are not a named addressee you must not use, disclose, distribute, copy, print or rely on this e-mail. To ensure regulatory compliance and for the protection of our clients and business, Evolving Systems may monitor and read e-mails sent to and from its servers. Although Evolving Systems routinely screens for viruses, addressees should scan this e-mail and any attachments for viruses. Evolving Systems makes no representation or warranty as to the absence of viruses in this e-mail or any attachments. Registered Office: One Angel Square, Torrens Street, London. EC1V 1PL. Registered number 2325854 |