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 pv
Recipients pitrou, pv
Date 2009-12-04.14:24:50
SpamBayes Score 4.7322505e-08
Marked as misclassified No
Message-id <1259936691.96.0.0163827438802.issue7433@psf.upfronthosting.co.za>
In-reply-to
Content
I think this is an implementation issue in MemoryView rather than an
issue with the buffer interface. PEP 3118 states, "This same bufferinfo
structure must be passed to bf_releasebuffer (if available) when the
consumer is done with the memory." -- this is not guaranteed by the
current MemoryView implementation.

The calls are not paired: the *_getbuf calls fill in structures with
data "view1", and "view2". The *_releasebuf calls receive structures
with data "view1", and "view1". The data filled in the second getbuf
call ("view2") is never passed back to *_releasebuf, as it is
overwritten with "view1" data by dup_buffer.

To work around this, *_releasebuf must be written so that it does not
use the "view" pointer passed to it -- the data structure may have been
shallow copied and any memory pointers in it may have already been freed.

I can try to cook up a patch fixing this.
History
Date User Action Args
2009-12-04 14:24:52pvsetrecipients: + pv, pitrou
2009-12-04 14:24:51pvsetmessageid: <1259936691.96.0.0163827438802.issue7433@psf.upfronthosting.co.za>
2009-12-04 14:24:50pvlinkissue7433 messages
2009-12-04 14:24:50pvcreate