Game Development Community

Bugfix for $100 - Cryptainer resource

by Fyodor -bank- Osokin · in Torque Game Engine · 07/28/2007 (6:44 pm) · 7 replies

I'm ready to paypal $100 if someone can get the Cryptainer resource fixed.

There is something wrong with "memory allocation/deallocation" while writing into container. Reading works like-a-charm, but saving data leads to strange errors with memory afterwards.

I'm not good in anything memory-related stuff, so, this is why I'm asking for help / assistance here.

The original resource has been posted into GG back in early 2005 and since then it was "not supported" and some time ago it disappeared from GG resource listing. I had a local copy of it, merged it into TGE1.5, tried it for a minutes.. at that time (few months back) I haven't meet the problem just because I wasn't trying to more than 1 script line into container..

I've tried original resource with TGE1.3 - same problem there.

Enabling TORQUE_DEBUG_GUARD shows that errors appears (mostly) in
static void treeInsert(FreeHeader *fhdr)
{
#ifdef TORQUE_DEBUG_GUARD
   checkGuard((Header *) fhdr, true);
   setGuard((Header *) fhdr, false);
#endif
   ...
codeblock, right after the saving/flushing data is done in resContainer/resFiler.

Anyone? When this will be fixed, I'll update the resource and may be 'll release "Torque File Manager" for handling archives made with this resource.

I'm at just.bank@gmail.com for emails and for GoogleTalk chats.

#1
07/30/2007 (12:04 pm)
I don't really have time to look into it, but just look for all allocations, and make sure that the resources are freed again. Sysinternal's Process Explorer may help you find something.
Also there's one open source static analysis tool that's meant to be good enough to find most memory leaks. I can't remember the exact name, but if you check out coverity you should watch their video on the bug spray to use. It's mentioned in there.

Hope this helps you or who has the time and wants to grab the 100 bucks ;)
#2
07/30/2007 (1:35 pm)
Does it make use of any tVector allocations? I can probably fix it, but I've never used the resource before and someone else should be a faster bet.
#3
07/30/2007 (1:46 pm)
Hi Stefan.
Yeah, there are two VECTOR_SET_ASSOCIATION.
Vector<FileInfo> files;		///< Vector of FileInfo - Simple, and to the point
and
 	Vector<DirectoryEntry*> directorys;	///< List of Directory's which contain file information.
Are you talking about this? :)
I can send you "compile-ready" SDK to test it if you wish.
#4
07/30/2007 (1:56 pm)
If it's 1.4.2 or earlier, then that would be nice. I don't have 1.5.

If it's 1.5 then I'll try it out with 1.4.2 and see how it works out. Should be mostly the same.
#5
07/30/2007 (2:04 pm)
Stefan, i'm on MSN as just.bank@gmail.com - we can discuss it over there. I have 1.3 SDK with this resource integrated.
#6
10/09/2007 (8:14 pm)
Did this ever get fixed?
#7
10/17/2007 (10:28 am)
Hey Ron.
Nope. It's too complex to fix it.
I went with the solution of implementing password-protected "zips" from TGB into our project.