[Numpy-discussion] Segfault for np.lookfor

Ben Walsh ben_w_123@yahoo.co...
Sun Aug 21 03:53:05 CDT 2011


Hi

My bad. Very sorry about that, guys.

There's a patch for this here:

https://github.com/walshb/numpy/tree/fix_np_lookfor_segv

And I submitted a pull request. I'll add something to the tests too when I 
have a little more time.

Cheers

Ben

> ------------------------------
>
> Message: 3
> Date: Tue, 16 Aug 2011 12:15:22 -0700
> From: Matthew Brett <matthew.brett@gmail.com>
> Subject: Re: [Numpy-discussion] Segfault for np.lookfor
> To: Discussion of Numerical Python <numpy-discussion@scipy.org>
> Message-ID:
> 	<CAH6Pt5o3bGyJ=Xm1Hes0GMiNPkUYQG_87RAi3ipGAFaM_u69-w@mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
>>
>> I opened ticket #1937 for this
>
>> From git-bisect it looks like the culprit is:
>
> feb8079070b8a659d7eee1b4acbddf470fd8a81d is the first bad commit
> commit feb8079070b8a659d7eee1b4acbddf470fd8a81d
> Author: Ben Walsh <b@wumpster.com>
> Date:   Sun Jul 10 12:52:52 2011 +0100
>
>    BUT: Stop _array_find_type trying to make every list element a
> subtype of bool.
>
> Just to remind me, my procedure was:
>
> <~/tmp/testfor.py>
> #!/usr/bin/env python
> import sys
> from functools import partial
> from subprocess import check_call, Popen, PIPE, CalledProcessError
>
> caller = partial(check_call, shell=True)
> popener = partial(Popen, stdout=PIPE, stderr=PIPE, shell=True)
>
> try:
>    caller('git clean -fxd')
>    caller('python setup.py build_ext -i')
> except CalledProcessError:
>    sys.exit(125) # untestable
>
> proc = popener('python -c "%s"' %
> """import sys
> import numpy as np
> np.lookfor('cos', output=sys.stdout)
> """)
>
> stdout, stderr = proc.communicate()
> if 'Segmentation fault' in stderr:
>    sys.exit(1) # bad
> sys.exit(0) # good
> </~/tmp/testfor.py>
>
> Then, I established the v1.6.1 did not have the segfault, and (man git-bisect):
>
> git co main-master # current upstream master
> git bisect start HEAD v1.6.1 --
> git bisect run ~/tmp/testfor.py
>
> See y'all,
>
> Matthew
>


More information about the NumPy-Discussion mailing list