From: Andrew M. <an...@ob...> - 2006-10-20 20:22:17
|
>All of which is telling me something is corrupting heap memory. Some notes >in the 2.5 release notes indicate the memory mgmt for C extensions has been >altered but as far as I can see, the sybase module doesn't use tiehr the >PyMem_Malloc or PyObject_Malloc calls discussed there. What makes these failures difficult to debug is that the crash happens away from the source of the corruption, so anything that closes that gap will help isolate the source. In the past, I've used techniques such as a "canary" function that performs a series of randomly sized allocations and then frees them, in the hope that this will trip up on the corruption. I then strategically litter the code with calls to this function. It might also help if the canary function writes a "hard to swallow" pattern, such as 0xA5A5A5A5, to the memory it allocates prior to freeing it. -- Andrew McNamara, Senior Developer, Object Craft http://www.object-craft.com.au/ |