[PATCH] Re: [python-sybase] Coredumps with Python 2.5 / Solaris 10

Gregory Bond gnb at itga.com.au
Fri Oct 20 15:47:07 EST 2006




On 20/10/06 12:46 PM, "Gregory Bond" <gnb at itga.com.au> 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!

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Python25-diffs.bin
Type: application/octet-stream
Size: 4555 bytes
Desc: not available
Url : http://www.object-craft.com.au/pipermail/python-sybase/attachments/20061020/7de734c1/Python25-diffs.bin


More information about the Python-sybase mailing list