On 10/11/2003 7:52 PM, [EMAIL PROTECTED] wrote:

Hi,
a few days ago, I've got a great help on gtk<->pygtk objects wrapping. Thanks a lot.
Now, I have the library but the application crashes on segfault. I've been thinking it is problem of mine or problem of Python but PyGtk seems to have own part of this too.
My program looks like:
/* python setup */
...
Py_Initialize();
...
/* module setup */
initcavfs(); // init C extension - module cavfs
initpywrap(); // init C extension - module pywrap
/* While cavfs does just Py_InitModule("cavfs", cavfs_methods); */
Now, on init_gobject() or "import gtk" I get a segfault which ALWAYS leads to a stack trace similar to:
#0 0x4d8b07f3 in strrchr () from /lib/libc.so.6
#1 in cavfs_methods()
#2 in init_gobject()
loading /usr/lib/python2.2/site-packages/gtk-2.0/libgobject.so
...
Please, note that cavfs_methods is a variable of type PyMethodDef. There's no such method and it isn't referenced elsewhere! Compiled library contains cavfs_methods pointer in a data part not code part.
Does anyone faced the same problem? Or can you image where's the root of my problem? Why does cavfs_methods get called?
Thanks a lot, Tobbi

You didn't compile your cavfs module with debug info (or alternatively, you passed -export-symbols-regex to an unpatched libtool when linking your module). When this happens, gdb makes its best guess about what function the stack frame refers to based on what it finds in the dynamic symbol table. This often causes static functions to be mistaken for visible symbols defined near by.


Without the debug info, it is a lot more difficult to diagnose the problem.

James.

--
Email: [EMAIL PROTECTED]
WWW:   http://www.daa.com.au/~james/



_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to