Message128505
[clip]
> This is a different issue.
It is the issue relevant for this discussion. As written in my comment: "So, `bf_releasebuffer` cannot rely on (i) the data in Py_buffer being what `bf_getbuffer` put there, and (ii) getting the same Py_buffer data only once."
> PyObject_GetBuffer() is called twice too: once when creating the
> memoryview, once when calling memory_getbuf.
> So again, bf_getbuffer is called the same number of times as
> bf_releasebuffer.
Yes, it is called twice, but with exactly the same data in Py_buffer.
So I would rather say that bf_releasebuffer is called twice on the Py_buffer returned by the first Getbuffer, and zero times for the buffer returned by the second one.
> > Note that the view.internal pointer is also clobbered above.
>
> Are you sure? memoryobject.c doesn't touch that pointer at all.
dup_buffer does *dst = *src, which overwrites the view.internal pointer obtained from one GetBuffer call with a pointer obtained from a previous one. |
|
Date |
User |
Action |
Args |
2011-02-13 15:09:38 | pv | set | recipients:
+ pv, loewis, teoliphant, mark.dickinson, ncoghlan, rupole, kermode, pitrou |
2011-02-13 15:09:38 | pv | set | messageid: <1297609778.0.0.955684185325.issue10181@psf.upfronthosting.co.za> |
2011-02-13 15:09:37 | pv | link | issue10181 messages |
2011-02-13 15:09:37 | pv | create | |
|