Ralf Schmitt added the comment: sorry, I somehow managed to introduce a segfault:
~/pydev/trunk/ cat t.py [EMAIL PROTECTED] ok from mmap import mmap class anon_mmap(mmap): def __new__(klass, *args, **kwargs): res = mmap.__new__(klass, -1, *args, **kwargs) print "NEW:", res return res anon_mmap(4096) ~/pydev/trunk/ ./python t.py [EMAIL PROTECTED] ok NEW: <__main__.anon_mmap object at 0x866b10> Debug memory block at address p=0x866b10: 18374686479671623679 bytes originally requested The 8 pad bytes at p-8 are not all FORBIDDENBYTE (0xfb): at p-8: 0xcb *** OUCH at p-7: 0xcb *** OUCH at p-6: 0xcb *** OUCH at p-5: 0xcb *** OUCH at p-4: 0xcb *** OUCH at p-3: 0xcb *** OUCH at p-2: 0xcb *** OUCH at p-1: 0xcb *** OUCH Because memory is corrupted at the start, the count of bytes requested may be bogus, and checking the trailing pad bytes may segfault. The 8 pad bytes at tail=0xff00000000866b0f are zsh: segmentation fault ./python t.py The following fixes it for me: ~/pydev/trunk/ cat patch [EMAIL PROTECTED] failed 139 diff --git a/Modules/mmapmodule.c b/Modules/mmapmodule.c --- a/Modules/mmapmodule.c +++ b/Modules/mmapmodule.c @@ -129,7 +129,7 @@ mmap_object_dealloc(mmap_object *m_obj) } #endif /* UNIX */ - PyObject_Del(m_obj); + m_obj->ob_type->tp_free((PyObject*)m_obj); } static PyObject * I'll write a test for this issue and will attach a complete patch. Sorry again. _____________________________________ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1087741> _____________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com