[Numpy-discussion] NA_updateDataPtr segmentation fault bug?

Todd Miller jmiller at stsci.edu
Wed Feb 25 06:05:05 CST 2004


On Tue, 2004-02-24 at 16:37, Marco Bubke wrote:
> Hi
> 
> I have a little function in pyrex:
> 
> cdef NumArray array_to_float(NumArray array):
>   # maybe here is memoty leak!
>   cdef NumArray flat_array
>   cdef NumArray new_array
>   print 'mark 1'
>   new_array = array.astype('Float32')
>   print new_array
>   print 'mark 2'
>   NA_updateDataPtr(new_array)
>   print 'mark 3'   
>   NA_updateDataPtr(new_array)
>   print 'mark 4'  
>   flat_array = NA_InputArray(new_array, tFloat32, NUM_C_ARRAY)
>   print 'mark 5'  
>   return flat_array
> 
> After the second NA_updateDataPtr I get a segmentation fault> Otherwise I
> get it with the NA_InputArray. It goes down to getReadBufferDataPtr and
> than to 
> rval = buff2->ob_type->tp_as_buffer->bf_getreadbuffer(buff2, 0, buff);
> 
> I believe bf_getreadbuffer is memory_getbuf but I'm not sure. I don't the
> bug but its happen. 
> 
> Can somebody help me?

Maybe you could post the pyrex generated C-code and we could take a look
at that?

Regards,
Todd

> 
> thanks and regards
> 
> Marco
> 
> 
> -------------------------------------------------------
> SF.Net is sponsored by: Speed Start Your Linux Apps Now.
> Build and deploy apps & Web services for Linux with
> a free DVD software kit from IBM. Click Now!
> http://ads.osdn.com/?ad_id56&alloc_id438&op=click
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/numpy-discussion
-- 
Todd Miller <jmiller at stsci.edu>





More information about the Numpy-discussion mailing list