[Python-Dev] Prevalence of low-level memory abuse?

Tim Peters tim.peters at gmail.com
Mon Mar 27 01:29:42 CEST 2006

[Tim, on PyMem vs PyObject memory mismatches]
> ... Alas, in a release(*) build, Python's test suite segfaulted all over the place.
> So far I found one smoking gun:  in _subprocess.c, ...

And Python's front end was chock full o' these, sometimes even getting
memory via PyMem and releasing it via PyObject.

I checked the change in, under the theory that there's never going to
be a better time to clean up this mess.  As the checkin comment says,

    If extension modules in real life prove as sloppy as Python's
    front end, we'll have to revert the objimpl.h + pymem.h part of this
    patch.  Note that no problems will show up in a debug build (all
    calls still go thru obmalloc then).  Problems will show up only in a
    release build, most likely segfaults.

More information about the Python-Dev mailing list