Message253646
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. |
|
| Date |
User |
Action |
Args |
| 2015-10-29 00:29:35 | martin.panter | set | recipients:
+ martin.panter, jnoller, r.david.murray, sbt, zach.ware, serhiy.storchaka, JakeMont |
| 2015-10-29 00:29:35 | martin.panter | set | messageid: <[email protected]> |
| 2015-10-29 00:29:35 | martin.panter | link | issue25498 messages |
| 2015-10-29 00:29:35 | martin.panter | create | |
|