argus 3.0.0 rc.28 memory leaks

Carter Bullard carter at qosient.com
Mon Sep 11 12:40:45 EDT 2006


Hey Gabriel,
So, ....,  I've added the concepts from your patch to argus, however,
there are a number of things that you are suggesting that are not
workable.   So, we'll need to test the new rc.29, which I should have
up on the server later today,  to see if it solves your memory
problem.

In particular, in your attempt to deallocate all dynamically allocated
memory in "ArgusCloseSource()", "ArgusCloseModeler()" and
"ArgusCloseOutput()", you delete some memory that is used later on in
the closing sequences.  I have moved these around, and it seems to be
working as you intended.

I did add an ArgusInitMallocList() and ArgusDeleteMallocList()  
method, in
place of your ArgusInitRecordAllocator(), not a big deal, and I added
object typing to ArgusDeleteList(), to clean up your suggestions for  
doing
the right thing based on what is in the list.

You had a /* FIXME: ... */  comment in ArgusCloseModeler(), where you
ask, "we're shutting down, so why push another record onto the list ?  
---".
This record is the ARGUS_STOP management record that will be written
to all the attached clients and/or written to the output files, and  
is the trigger
for closing all the output sockets that argus is maintaining.  So  
this is very
important.

Not sure what the type casting in Argus[MC]alloc() was doing, but I made
some of your suggested changes.

Ok, so when I get rc.29 up on the server, check it out to see if it  
breaks!!!!

Carter





On Aug 31, 2006, at 3:49 PM, Gabriel L. Somlo wrote:

> On Thu, Aug 31, 2006 at 03:19:28PM -0400, Carter Bullard wrote:
>> Well, lets see how it goes!!!!
>
> Carter,
>
> A large part of the patch is derived from the (lack of a good) fix
> to ArgusDeleteList() in argus/ArgusUtil.c (line 116 or thereabouts).
>
> The version included in rc.28 tries to delete a list by popping
> elements off the front of the list and droppping them on the floor.
>
> I've changed that to call ArgusFree on the result of the Pop(), except
> that's not a good solution, since the exact type of element being
> pointed at is unknown inside that function, so the things pointed at
> from within the structure won't get free() in turn.
>
> So, wherever you call ArgusDeleteList() and *do* know what type of
> elements the list is supposed to have, I add a while pop() delete the
> element's dynamic data first, then free the element. The subsequent
> call to ArgusDeleteList() then cleans up the rest of it.
>
> Again, I stand by pretty much the whole thing, but I guess one of the
> workarounds for ArgusDeleteList must have plugged the main leak I was
> seeing...
>
> Let me know how it goes :)
>
> Thanks,
> Gabriel
>
>





More information about the argus mailing list