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.

Title: segfault when mutating memoryview to array.array when array is resized
Type: crash Stage: patch review
Components: Interpreter Core Versions: Python 3.0
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: gumpy, pitrou, teoliphant
Priority: critical Keywords: needs review, patch

Created on 2008-12-07 21:30 by gumpy, last changed 2022-04-11 14:56 by admin. This issue is now closed.

File name Uploaded Description Edit
arraybuf.patch pitrou, 2008-12-13 20:58
arraybuf2.patch pitrou, 2008-12-16 21:27
Messages (4)
msg77260 - (view) Author: (gumpy) Date: 2008-12-07 21:30
This is with r67651 and related to #4569, #4509 and possibly #4580.

>>> from array import array
>>> a = array('i', range(16))
>>> m = memoryview(a)
>>> a.extend(array('i', range(48)))
>>> m[:] = array('i', range(64))
Segmentation fault

>>> from array import array
>>> a = array('b', range(16))
>>> m = memoryview(a)
>>> a.extend(array('b', range(48)))
>>> m[:] = array('b', range(64))
Segmentation fault
msg77763 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2008-12-13 20:58
Here is a patch for the array module.
msg77934 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2008-12-16 21:27
Nothing new in this patch except that it fixes the bogus indentation of
the previous patch.
msg78032 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2008-12-18 17:11
Fixed in r67840. No need to backport to 2.x since the array object there
doesn't support the new buffer protocol.
Date User Action Args
2022-04-11 14:56:42adminsetgithub: 48833
2008-12-18 17:11:12pitrousetstatus: open -> closed
resolution: fixed
messages: + msg78032
2008-12-16 21:32:28pitrousetnosy: + teoliphant
2008-12-16 21:27:22pitrousetfiles: + arraybuf2.patch
messages: + msg77934
2008-12-13 20:58:40pitrousetfiles: + arraybuf.patch
nosy: + pitrou
messages: + msg77763
priority: critical
keywords: + patch, needs review
stage: patch review
2008-12-07 21:30:16gumpycreate