From: Gregory B. <gn...@it...> - 2006-10-20 22:47:12
|
On 20/10/06 12:46 PM, "Gregory Bond" <gn...@it...> wrote: > I'm really struggling with making the 0.37 module work with Python 2.5. I'm > getting some SIGSEGVs buried deep in the Python core, usually in the > realloc/free calls, in all sorts of internal Python objects (e.g. > PyList_Append(), PyDict_SetItem() etc) that really orta be very well tested > and debugged! > > If I configure Python with either --with-pydebug or --without--pymalloc > options (i.e. Changing the way objects/mallocs work) then the resulting > Python version works fine with the Sybase module. SunPro or GCC compiled, > both fail. > > Python 2.4.4 works fine with no special config options. > > 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. Found it. (I think..... Still a bit new to the Python extending caper.) The varous *_dealloc() functions in sybasect were using PyMem_DEL() to release memory. Under 2.5, this needs to be PyObject_DEL() as the default 2.5 Python allocator keeps these in separate pools. Patch attached! |