Jørgen P. Tjernø wrote:
> Dag Sverre Seljebotn wrote:
>> In general you should test with the latest released version before 
>> reporting problems. That way the Cython developers can be more sure to 
>> spend their Cython time focusing on real issues.
> Ah, I wasn't aware that 0.11 was released. Pi-day release and everything! ;)
> 
> I've upgraded now, and I experience the same problem.
> /* Generated by Cython 0.11 on Fri Mar 27 16:15:44 2009 */
> 

This also seems to affect the ordering of code in PyMODINIT_FUNC:
__pyx_vtable_7spytify_Album.__pyx_base = 
*__pyx_vtabptr_7spytify_SessionStruct

this line is before

__pyx_vtabptr_7spytify_SessionStruct = &__pyx_vtable_7spytify_SessionStruct;

So it dereferences a NULL-pointer and segfaults python on import of the 
extension.

If I reorder the type init code so that the code for SessionStruct is 
first, then it builds and imports fine. :)

I think it might be related to this structure:

cdef class Album

cdef class SessionStruct:
     cdef Album _create_album(self, album* album, bint take_owner=?)

cdef class Album(SessionStruct):
     pass

I declare the class before SessionStruct, but it also inherits from 
SessionStruct -- so I guess this is confusing Cython? Is there a 
workaround? Is this the "wrong" way to do it? :)

(Another class, which inherits from SessionStruct, but is not forward 
declared before SessionStruct, seems to have its code ordered properly, 
both type init code and "constructor" function)

-- 
Kindest regards, Jørgen P. Tjernø.
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to