[Numpy-discussion] numpy segfaults with ctypes

Matthew Brett matthew.brett at gmail.com
Fri Aug 19 16:11:40 EDT 2011


Hi,

On Fri, Aug 19, 2011 at 1:04 PM, Angus McMorland <amcmorl at gmail.com> wrote:
> Hi all,
>
> I'm giving this email a new subject, in case that helps it catch the
> attention of someone who can fix my problem. I currently cannot
> upgrade numpy from git to any date more recent than 10 July. Git
> commit feb8079070b8a659d7ee is the first that causes the problem
> (according to github, the commit was authored by walshb and committed
> by m-paradox, in case that jogs anyone's memory). I've tried taking a
> look at the code diff, but I'm afraid I'm just a user, rather than a
> developer, and it didn't make much sense.
>
> My problem is that python segfaults when I run it with the following code:
>
>> from ctypes import Structure, c_double
>>
>> #-- copied out of an xml2py generated file
>> class S(Structure):
>>    pass
>> S._pack_ = 4
>> S._fields_ = [
>>    ('field', c_double * 2),
>>   ]
>> #--
>>
>> import numpy as np
>> print np.version.version
>> s = S()
>> print "S", np.asarray(s.field)

Just to say, that that commit is also the commit that causes a
segfault for np.lookfor:

http://www.mail-archive.com/numpy-discussion@scipy.org/msg33114.html
http://projects.scipy.org/numpy/ticket/1937

The latter ticket is closed because Mark's missing-data development
branch does not have the segfault.

I guess you could try that branch and see whether it fixes the problem?

I guess also that means we'll have to merge in the missing data branch
in order to fix the problem.

See you,

matthew



More information about the NumPy-Discussion mailing list