[Pyrex] cdef object in cdef class: Segmentation fault

Simon Burton simon at arrowtheory.com
Wed Jan 14 00:51:37 CET 2004


So far I have had no luck wrapping structs with c extension classes :(

I have reduced it to the following code:

#BEGIN

cdef class Bomber:
  cdef object handle
  def __init__(self,name):
    self.handle = name

b = Bomber("some")

print "EOF"

#END

Which segfaults (depending on binary size!!) after the EOF.
I also tried using the __new__ method.

The workaround I use now is to use CObjects in a regular class,
but this involves a lot of PyCObject_FromVoidPtr, PyCObject_AsVoidPtr calls.

Does anyone know what i might be doing wrong?
I'm running pyrex0.9, python2.2.2, RH8.0.

Thanks,

Simon.

-- 
Simon Burton, B.Sc.
Licensed PO Box A66
ANU Canberra 2601
Australia
Ph. 02 6249 6940
http://arrowtheory.com 




More information about the Pyrex mailing list