[SciPy-User] segfaults with weave.inline

Pauli Virtanen pav+sp@iki...
Wed Mar 3 09:36:59 CST 2010


Tue, 02 Mar 2010 20:08:08 -0800, pitam wrote:
> I did some more research on this.
> 
> My code uses blitz array, where the original array was a numeric array
> of numpy. This is where the fault is at. I need to convert the blitz
> array back to a numeric numpy array. How do I do this, any Ideas??

As said, to my understanding,

1. zone_vector is modified *in-place*, you don't need to convert it back.

2. Instead, you have to allocate the numpy array big enough to hold *all*
   of the data

3. Blitz does not check array bounds

4. Writing out of array bounds does not necessarily result to a
   segmentation fault immediately, it can manifest later.

So, you should replace

	zone_vector = array(())

with

	zone_vector = zeros((size_of_zone_vector,))

Did you try this? If yes, does it fix the problem?

Best regards,
-- 
Pauli Virtanen



More information about the SciPy-User mailing list