[New-bugs-announce] [issue25659] ctypes.Array.from_buffer segmentation fault when trying to create from array.array

Ely Spears report at bugs.python.org
Wed Nov 18 12:57:16 EST 2015


New submission from Ely Spears:

I'm trying to find a way to create a ctypes array from the underlying memory buffer exposed by an array.array object. The ctypes.Array.from_buffer function isn't documented, but I did find the source code in _ctypes.c around line 497. It's not clear to me where the problem might be.


Code to reproduce it below:

import array, ctypes
a1 = array.array('l')
a1.fromlist(range(10))
ctypes.Array.from_buffer(a1)
#Segfault

----------
components: ctypes
messages: 254851
nosy: spearsem at gmail.com
priority: normal
severity: normal
status: open
title: ctypes.Array.from_buffer segmentation fault when trying to create from array.array
type: crash
versions: Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25659>
_______________________________________


More information about the New-bugs-announce mailing list