Sorry, but your patch does not fix it for me. Have you
tested the patch, or is it only theoretically proved to be
correct? ;-)
I removed all my old gtk/pygtk/multiple-pythonX.Y just to be safe,
but using python 2.0 I still get a crash. Notice that the program
crashes when we try to use self.b that as not yet been initialized.
If we add
self.b = 4
to VClass.__init__, everything is ok.
(Let me know when I start being annoying...)
(from gobjectmodule.c:)
static PyObject *
check_bases(PyGObject *self, PyExtensionClass *class, char *attr)
{
PyObject *ret;
if (class->tp_getattr) {
// I did some printf debugging, and the program crashes the
// third time it reaches the following line.
ret = (* class->tp_getattr)((PyObject *)self, attr);
if (ret)
return ret;
else
PyErr_Clear();
}
import sys
sys.path.insert(0, "/home/tom/gtk2/lib/python2.0/site-packages")
import gtk
class VClass:
def __init__(self):
pass
class MWin(gtk.GtkWindow, VClass):
def __init__(self):
gtk.GtkWindow.__init__(self, gtk.WINDOW_TOPLEVEL)
VClass.__dict__['__init__'](self)
print "Prepare to segfault"
a = self.b
print "You'll never get here!"
w = MWin()
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1024 (LWP 24668)]
0x29 in ?? ()
(gdb) where
#0 0x29 in ?? ()
#1 0x4001b0f0 in check_bases (self=0x8059b50, class=0x805bf70,
attr=0x806a904 "b") at gobjectmodule.c:1091
#2 0x4001b156 in pygobject_getattro (self=0x8059b50, attro=0x806a8f0)
at gobjectmodule.c:1110
#3 0x4006579a in PyObject_GetAttr () from /usr/lib/libpython2.0.so.0.0
#4 0x4003c510 in PyEval_EvalCode () from /usr/lib/libpython2.0.so.0.0
#5 0x4003e52b in PyEval_CallObjectWithKeywords ()
from /usr/lib/libpython2.0.so.0.0
#6 0x4003e05e in PyEval_CallObjectWithKeywords ()
from /usr/lib/libpython2.0.so.0.0
#7 0x4021c219 in callMethodWithPossibleHook (inst=0x8059b50, meth=0x808a4cc,
args=0x8061d9c, kw=0x0) at ExtensionClass.c:755
#8 0x4021c4a7 in PMethod_call (self=0x8084a40, args=0x8061d9c, kw=0x0)
at ExtensionClass.c:825
#9 0x4003e038 in PyEval_CallObjectWithKeywords ()
from /usr/lib/libpython2.0.so.0.0
#10 0x4022017d in CCL_call (self=0x805bf70, arg=0x804af0c, kw=0x0)
at ExtensionClass.c:1994
#11 0x4003e038 in PyEval_CallObjectWithKeywords ()
from /usr/lib/libpython2.0.so.0.0
#12 0x4003cef2 in PyEval_EvalCode () from /usr/lib/libpython2.0.so.0.0
#13 0x4003a42e in PyEval_EvalCode () from /usr/lib/libpython2.0.so.0.0
#14 0x400725a1 in PyRun_FileEx () from /usr/lib/libpython2.0.so.0.0
#15 0x4007254d in PyRun_FileEx () from /usr/lib/libpython2.0.so.0.0
#16 0x4007251b in PyRun_FileEx () from /usr/lib/libpython2.0.so.0.0
#17 0x40071b00 in PyRun_SimpleFileEx () from /usr/lib/libpython2.0.so.0.0
#18 0x400716f6 in PyRun_AnyFileEx () from /usr/lib/libpython2.0.so.0.0
#19 0x400609ab in Py_Main () from /usr/lib/libpython2.0.so.0.0
#20 0x8048611 in main ()
#21 0x4011464f in __libc_start_main () from /lib/libc.so.6
--
Tom Cato Amundsen <[EMAIL PROTECTED]>
GNU Solfege - free eartraining, http://www.gnu.org/software/solfege/
_______________________________________________
pygtk mailing list [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk