[Orbit-python-list] Memory issues with Anys
Status: Inactive
Brought to you by:
tack
From: Brad C. <cha...@ar...> - 2001-09-04 09:03:03
|
Hello all; I've been plugging along quite nicely with ORBit-python on the IDL I'm implementing, but ran into some sort of memory issue with anys. In my actual code, I was getting messages like: python in free(): warning: chunk is already free. any then getting segfaults after too many of these messages. Basically, all I'm doing is extracting the typecode and value from the any. I was able to duplicate the error messages (without the segfaulting, though) in a small test server/client. To avoid sending tarballs to the list, I put the test scripts at: http://www.bioinformatics.org/bradstuff/bc/AnyTest.tar.gz Basically, this contains an IDL, client and server, that shows the problem. I dug into the code on this, and came up with a proposed patch. The patch seems to fix the problem (in both my test case and my real code), but I'm definately not a C expert so someone smarter than I will have to check it out to see if it causes memory leaks, etc. Basically, I Py_INCREF the tc and value before returning them, which I think accounts for the reference the calling code will get. But, than again, I'm no expert :-). Hope this helps. Brad |