[Numpy-discussion] numpy segfaults with ctypes
Fri Aug 19 15:11:40 CDT 2011
On Fri, Aug 19, 2011 at 1:04 PM, Angus McMorland <email@example.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):
>> 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:
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.
More information about the NumPy-Discussion