NA_updateDataPtr segmentation fault bug?

M

Marco Bubke

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top