[Numpy-discussion] NA_updateDataPtr segmentation fault bug?

Marco Bubke marco at bubke.de
Tue Feb 24 13:39:00 CST 2004


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?

thanks and regards

Marco




More information about the Numpy-discussion mailing list