[egenix-users] Windows debug builds (again)

M.-A. Lemburg mal at lemburg.com
Tue Dec 10 22:11:15 CET 2002


howard at eegsoftware.com wrote:
> 
> 
>  > After running the above build command both with and without the --debug
>  > flag, then "python setup.py install" installed both the release _and_ 
> debug
>  > .pyd's to the correct destination. There's no problem of overwriting the
>  > installation with a debug build because the filenames are different;
>  > mxDateTime_d.pyd gets used if you're running python_d.exe and 
> mxDateTime.pyd
>  > gets used if you're running python.exe. They live happily side by side.
> I followed this logic (from the August archives) but I get a page fault 
> when trying to import mx.DateTime from python_d. The problem reports as
> an access violation on the line marked below:
> 
> static
> void mxDateTime_Free(mxDateTimeObject *datetime)
> {
> Py_XDECREF(datetime->argument);
> #ifdef MXDATETIME_FREELIST
> /* Append mxDateTime objects to free list */
> # ifdef WANT_SUBCLASSABLE_TYPES
> if (!_mxDateTime_CheckExact(datetime))
> PyObject_Del(datetime);
> else
> # endif {
> *(mxDateTimeObject **)datetime = mxDateTime_FreeList;
> mxDateTime_FreeList = datetime; <=========access violation
> _Py_ForgetReference(datetime);

   ^^^^ this call has to be removed to fix the problem (the same
needs to be done for mxDateTimeDelta_Free()).

> }
> #else PyObject_Del(datetime);
> #endif
> }
> 
> So, what am I doing wrong ?? This is 2.0.4 and python2.2.2

That's a know bug which will get fixed in 2.1.0. For 2.0.4
you have to disable the free lists:

Edit the mxDateTime.c and comment out the two lines

/* Define these to have the module use free lists (saves malloc calls) */
#define MXDATETIME_FREELIST
#define MXDATETIMEDELTA_FREELIST

This should fix the problem for 2.0.4 as well (free lists are
a performance improvement which is normally not needed for
debugging).

-- 
Marc-Andre Lemburg
CEO eGenix.com Software GmbH
_______________________________________________________________________
eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,...
Python Consulting:                               http://www.egenix.com/
Python Software:                    http://www.egenix.com/files/python/




More information about the egenix-users mailing list