Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#38 python 2.5: free(): invalid pointer

closed-fixed
None
5
2006-11-15
2006-10-11
No

I encountered an error with a program developed under
python 2.4 which was tested with 2.5 - it actually did
everything it should but it complained about

free(): invalid pointer [some address]!

after its work has been done.

The fix to this error is simple: in
Modules/LDAPObject.c, line 55 one has to change
"PyMem_DEL(self)" to "PyObject_DEL(self)".

(a diff for the latest cvs-version is included)
The reason for this error is most probably this
development in python 2.5:

"Previously these different families all reduced to the
platform's malloc() and free() functions. This meant it
didn't matter if you got things wrong and allocated
memory with the PyMem function but freed it with the
PyObject function. With 2.5's changes to obmalloc,
these families now do different things and mismatches
will probably result in a segfault. You should
carefully test your C extension modules with Python 2.5."

(http://docs.python.org/whatsnew/ports.html)

Discussion

  • Patch for the bug

     
    Attachments
    • status: open --> open-fixed
     
    • status: open-fixed --> open
     
  • Logged In: YES
    user_id=64920
    Originator: NO

    A fix has been applied and committed to the CVS repository.
    It will appear in the next release.
    Thanks.

     
    • assigned_to: nobody --> stroeder
    • status: open --> closed-fixed
     
  • Logged In: YES
    user_id=64920
    Originator: NO

    Thanks for pointing this out.