This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author martin.panter
Recipients JakeMont, jnoller, martin.panter, r.david.murray, sbt, serhiy.storchaka, zach.ware
Date 2015-10-29.00:29:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1446078575.38.0.102714522293.issue25498@psf.upfronthosting.co.za>
In-reply-to
Content
I traced this down to part of revision 1da9630e9b7f (Issue #22896). If I revert the changes to CDataType_from_buffer() at <https://hg.python.org/cpython/rev/1da9630e9b7f/#l4.3>, the crash no longer happens. I suspect the offending code is this, that is trying to stash the original buffer protocol supporting object into a memory view:

mv = PyMemoryView_FromBuffer(&buffer);
if (mv == NULL) {
    PyBuffer_Release(&buffer);
    return NULL;
}
/* Hack the memoryview so that it will release the buffer. */
((PyMemoryViewObject *)mv)->mbuf->master.obj = buffer.obj;
((PyMemoryViewObject *)mv)->view.obj = buffer.obj;
//~ Py_INCREF(buffer.obj);
if (-1 == KeepRef((CDataObject *)result, -1, mv))
    result = NULL;

If I enable my INCREF() line it also stops the crash, but I guess at the expense of a memory leak.
History
Date User Action Args
2015-10-29 00:29:35martin.pantersetrecipients: + martin.panter, jnoller, r.david.murray, sbt, zach.ware, serhiy.storchaka, JakeMont
2015-10-29 00:29:35martin.pantersetmessageid: <1446078575.38.0.102714522293.issue25498@psf.upfronthosting.co.za>
2015-10-29 00:29:35martin.panterlinkissue25498 messages
2015-10-29 00:29:35martin.pantercreate