➜

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.

作者 serhiy.storchaka
收信人 JakeMont, jnoller, martin.panter, r.david.murray, sbt, serhiy.storchaka, skrah, zach.ware
日期 2015-10-30.17:39:58
SpamBayes Score -1.0
Marked as misclassified 是
Message-id <1446226799.25.0.257074326061.issue25498@psf.upfronthosting.co.za>
In-reply-to
内容
Before committing any solution we first should have understood the cause of the crash. The peculiarity of example ctypes_crash.py is that the argument of ctypes.c_char.from_buffer is a memoryview. With current code we have following chain (the list creates a reference loop with itself):

    list->memoryview->ManagedBuffer->memoryview->ManagedBuffer->bytearray

Using PyMemoryView_FromObject or hypothetical PyMemoryView_FromObjectEx we could get shorter chain:

    list->memoryview->ManagedBuffer->bytearray

May be the cause not in current hack, but in memoryview that can't survive with breaking long chain? Or may be we just are lucky in latter case?

I share Martin's doubts about writability in Eryksun’s patch.
历史
日期 用户 动作 参数
2015-10-30 17:39:59serhiy.storchaka修改recipients: + serhiy.storchaka, jnoller, r.david.murray, skrah, sbt, martin.panter, zach.ware, JakeMont
2015-10-30 17:39:59serhiy.storchaka修改messageid: <1446226799.25.0.257074326061.issue25498@psf.upfronthosting.co.za>
2015-10-30 17:39:59serhiy.storchaka链接issue25498 messages
2015-10-30 17:39:58serhiy.storchaka创建