gdb:
.
.
#0 0x401e293d in SWIG_GetPtr (c=0x0, ptr=0xbfffe610, t=0x4029a0ff
"_wxEvtHandler_p")
at src/libpy.c:319
319 if (*c != '_') {
(gdb)
Hi Robin
Maybe this can give you a clue to what the trouble is.
I printed c in libpy.c;SWIG_MakePtr and str in libpy.c;SWIG_GetPtrObj.
In the gdb output above it try to get a pointer of type _wxEvtHandler_p,
but there is no _wxEvtHandler_p in the printout below.
In the last print from SWIG_GetPtrObj str=(null).
SWIGSTATICRUNTIME(void)
SWIG_MakePtr(char *c, const void *ptr, char *type) {
static char hex[17] = "0123456789abcdef";
unsigned long p, s;
char result[24], *r;
char *tmp = c; /* TEST */
r = result;
p = (unsigned long) ptr;
if (p > 0) {
while (p > 0) {
s = p & 0xf;
*(r++) = hex[s];
p = p >> 4;
}
*r = '_';
while (r >= result)
*(c++) = *(r--);
strcpy (c, type);
} else {
strcpy (c, "NULL");
}
printf("SWIG_MakePtr: c=%s\n", tmp); /* TEST */
}
SWIGSTATICRUNTIME(char *)
SWIG_GetPtrObj(PyObject *obj, void **ptr, char *type) {
PyObject *sobj = obj;
char *str;
if (!PyString_Check(obj)) {
if (!PyInstance_Check(obj) || !(sobj =
PyObject_GetAttrString(obj,"this")))
return "";
// PyObject_GetAttrString increases sobj refcout !
Py_DECREF(sobj);
}
str = PyString_AsString(sobj);
/* + TEST */
/* printf("Len(str)=%d\n", strlen(str)); */
printf("SWIG_GetPtrObj: str=%s\n", str);
/* - TEST */
return SWIG_GetPtr(str,ptr,type);
}
$ ./demo.py
SWIG_MakePtr: c=_4084a5ac_wxAcceleratorTable_p
SWIG_MakePtr: c=_8151f60_wxFont_p
SWIG_MakePtr: c=_8152020_wxFont_p
SWIG_MakePtr: c=_81520a8_wxFont_p
SWIG_MakePtr: c=_8152130_wxFont_p
SWIG_MakePtr: c=_81521b8_wxPen_p
SWIG_MakePtr: c=_8152228_wxPen_p
SWIG_MakePtr: c=_8152298_wxPen_p
SWIG_MakePtr: c=_8152308_wxPen_p
SWIG_MakePtr: c=_8152378_wxPen_p
SWIG_MakePtr: c=_81523e8_wxPen_p
SWIG_MakePtr: c=_8152458_wxPen_p
SWIG_MakePtr: c=_81524c8_wxPen_p
SWIG_MakePtr: c=_8152538_wxPen_p
SWIG_MakePtr: c=_81525a8_wxPen_p
SWIG_MakePtr: c=_8152618_wxBrush_p
SWIG_MakePtr: c=_81526a0_wxBrush_p
SWIG_MakePtr: c=_8152728_wxBrush_p
SWIG_MakePtr: c=_81527b0_wxBrush_p
SWIG_MakePtr: c=_8152838_wxBrush_p
SWIG_MakePtr: c=_81528c0_wxBrush_p
SWIG_MakePtr: c=_8152948_wxBrush_p
SWIG_MakePtr: c=_81529d0_wxBrush_p
SWIG_MakePtr: c=_8152a58_wxBrush_p
SWIG_MakePtr: c=_8152ae0_wxBrush_p
SWIG_MakePtr: c=_8152b68_wxColour_p
SWIG_MakePtr: c=_8152b80_wxColour_p
SWIG_MakePtr: c=_8152b98_wxColour_p
SWIG_MakePtr: c=_8152bb0_wxColour_p
SWIG_MakePtr: c=_8152bc8_wxColour_p
SWIG_MakePtr: c=_8152be0_wxColour_p
SWIG_MakePtr: c=_8152bf8_wxColour_p
SWIG_MakePtr: c=_8150018_wxCursor_p
SWIG_MakePtr: c=_8152c30_wxCursor_p
SWIG_MakePtr: c=_8152c60_wxCursor_p
SWIG_MakePtr: c=_4084a59c_wxBitmap_p
SWIG_MakePtr: c=_4084a58c_wxIcon_p
SWIG_MakePtr: c=_4084a580_wxCursor_p
SWIG_MakePtr: c=_4084a570_wxPen_p
SWIG_MakePtr: c=_4084a560_wxBrush_p
SWIG_MakePtr: c=_4084a530_wxPalette_p
SWIG_MakePtr: c=_4084a550_wxFont_p
SWIG_MakePtr: c=_4084a540_wxColour_p
SWIG_MakePtr: c=_8151f10_wxFontList_p
SWIG_MakePtr: c=_8151ee8_wxPenList_p
SWIG_MakePtr: c=_814ffd0_wxColourDatabase_p
SWIG_MakePtr: c=_4034f544_wxDataFormat_p
SWIG_MakePtr: c=_81574a8_wxClipboard_p
SWIG_MakePtr: c=_40850140_wxValidator_p
SWIG_MakePtr: c=_4084e120_wxImage_p
SWIG_MakePtr: c=_4084a520_wxPoint_p
SWIG_MakePtr: c=_4084a528_wxSize_p
SWIG_MakePtr: c=_81075a0_wxPyApp_p
SWIG_MakePtr: c=_829aad0_wxImage_p
SWIG_GetPtrObj: str=_829aad0_wxImage_p
SWIG_MakePtr: c=_838e8c8_wxBitmap_p
SWIG_GetPtrObj: str=_829aad0_wxImage_p
SWIG_GetPtrObj: str=_838e8c8_wxBitmap_p
SWIG_GetPtrObj: str=_838e8c8_wxBitmap_p
SWIG_MakePtr: c=_83f9e08_wxFrame_p
SWIG_GetPtrObj: str=(null)
Segmenteringsfel (core dumped)
gdb backtrace:
(gdb) bt
#0 0x401e293d in SWIG_GetPtr (c=0x0, ptr=0xbfffe610, t=0x4029a0ff
"_wxEvtHandler_p")
at src/libpy.c:319
#1 0x401e2dfd in SWIG_GetPtrObj (obj=0x83f6f04, ptr=0xbfffe610,
type=0x4029a0ff "_wxEvtHandler_p") at src/libpy.c:418
#2 0x401eaccd in _wrap_wxEvtHandler_Connect (self=0x0, args=0x83fb3e4,
kwargs=0x83f71d4)
at src/gtk/windows.cpp:554
#3 0x80576b2 in call_builtin (func=0x8168fa8, arg=0x83fb3e4,
kw=0x83f71d4)
at ../../Python/ceval.c:2644
#4 0x8057608 in PyEval_CallObjectWithKeywords (func=0x8168fa8,
arg=0x83fb3e4, kw=0x83f71d4)
at ../../Python/ceval.c:2618
#5 0x80867a0 in builtin_apply (self=0x0, args=0x83f71ac) at
../../Python/bltinmodule.c:88
#6 0x80576ea in call_builtin (func=0x80c67e0, arg=0x83f71ac, kw=0x0) at
../../Python/ceval.c:2650
#7 0x8057608 in PyEval_CallObjectWithKeywords (func=0x80c67e0,
arg=0x83f71ac, kw=0x0)
at ../../Python/ceval.c:2618
#8 0x8056781 in eval_code2 (co=0x8215910, globals=0x8238e1c,
locals=0x0, args=0x8264be4,
argcount=5, kws=0x8264bf8, kwcount=0, defs=0x0, defcount=0,
owner=0x82598ec)
at ../../Python/ceval.c:1951
#9 0x80564d8 in eval_code2 (co=0x81ce9d0, globals=0x81ec07c,
locals=0x0, args=0x82a6bf8,
argcount=2, kws=0x82a6c00, kwcount=0, defs=0x0, defcount=0,
owner=0x0)
at ../../Python/ceval.c:1850
#10 0x80564d8 in eval_code2 (co=0x83987a0, globals=0x81e136c,
locals=0x0, args=0x83f6f88,
argcount=2, kws=0x83f6f98, kwcount=3, defs=0x81fe2b0, defcount=6,
owner=0x81e152c)
at ../../Python/ceval.c:1850
#11 0x80579ed in call_function (func=0x81dff94, arg=0x83f6ee4,
kw=0x83f6e7c)
at ../../Python/ceval.c:2772
#12 0x80575fe in PyEval_CallObjectWithKeywords (func=0x83f6f54,
arg=0x83f6ee4, kw=0x83f6e7c)
at ../../Python/ceval.c:2616
#13 0x806d843 in PyInstance_New (class=0x81e152c, arg=0x83f6ee4,
kw=0x83f6e7c)
at ../../Objects/classobject.c:463
#14 0x80576ff in call_builtin (func=0x81e152c, arg=0x83f6ee4,
kw=0x83f6e7c)
at ../../Python/ceval.c:2653
#15 0x8057608 in PyEval_CallObjectWithKeywords (func=0x81e152c,
arg=0x83f6ee4, kw=0x83f6e7c)
at ../../Python/ceval.c:2618
#16 0x8056781 in eval_code2 (co=0x8106d48, globals=0x80d33bc,
locals=0x0, args=0x80d84a8,
argcount=1, kws=0x0, kwcount=0, defs=0x0, defcount=0,
owner=0x83dc8ec)
at ../../Python/ceval.c:1951
#17 0x80579ed in call_function (func=0x83dc94c, arg=0x80c7b5c, kw=0x0)
at ../../Python/ceval.c:2772
#18 0x80575fe in PyEval_CallObjectWithKeywords (func=0x80ec91c,
arg=0x80c7b5c, kw=0x0)
at ../../Python/ceval.c:2616
#19 0x401dfabc in __wxStart (args=0x80d8104) at src/helpers.cpp:185
#20 0x80576b2 in call_builtin (func=0x810b950, arg=0x80d8104, kw=0x0) at
../../Python/ceval.c:2644
#21 0x8057608 in PyEval_CallObjectWithKeywords (func=0x810b950,
arg=0x80d8104, kw=0x0)
at ../../Python/ceval.c:2618
#22 0x8056781 in eval_code2 (co=0x81df2c8, globals=0x81ec07c,
locals=0x0, args=0x83f3800,
argcount=2, kws=0x0, kwcount=0, defs=0x8361368, defcount=2,
owner=0x8398054)
at ../../Python/ceval.c:1951
#23 0x80579ed in call_function (func=0x83980ec, arg=0x80d4d74, kw=0x0)
at ../../Python/ceval.c:2772
#24 0x80575fe in PyEval_CallObjectWithKeywords (func=0x80c82ec,
arg=0x80d4d74, kw=0x0)
at ../../Python/ceval.c:2616
#25 0x806d843 in PyInstance_New (class=0x83dc8ec, arg=0x80d4d74, kw=0x0)
at ../../Objects/classobject.c:463
#26 0x80576ff in call_builtin (func=0x83dc8ec, arg=0x80d4d74, kw=0x0) at
../../Python/ceval.c:2653
#27 0x8057608 in PyEval_CallObjectWithKeywords (func=0x83dc8ec,
arg=0x80d4d74, kw=0x0)
at ../../Python/ceval.c:2618
#28 0x8056781 in eval_code2 (co=0x81078b0, globals=0x80d33bc,
locals=0x0, args=0x80d51d0,
argcount=0, kws=0x80d51d0, kwcount=0, defs=0x0, defcount=0,
owner=0x0)
at ../../Python/ceval.c:1951
#29 0x80564d8 in eval_code2 (co=0x80c7bd0, globals=0x80ca184,
locals=0x80ca184, args=0x0,
argcount=0, kws=0x0, kwcount=0, defs=0x0, defcount=0, owner=0x0) at
../../Python/ceval.c:1850
#30 0x8054537 in PyEval_EvalCode (co=0x80c7bd0, globals=0x80ca184,
locals=0x80ca184)
at ../../Python/ceval.c:319
#31 0x8065af4 in run_node (n=0x80d31c8, filename=0xbffff268 "./demo.py",
globals=0x80ca184,
locals=0x80ca184) at ../../Python/pythonrun.c:886
#32 0x8065abd in run_err_node (n=0x80d31c8, filename=0xbffff268
"./demo.py", globals=0x80ca184,
locals=0x80ca184) at ../../Python/pythonrun.c:874
#33 0x8065a9b in PyRun_FileEx (fp=0x80c6498, filename=0xbffff268
"./demo.py", start=257,
globals=0x80ca184, locals=0x80ca184, closeit=1) at
../../Python/pythonrun.c:866
#34 0x8065267 in PyRun_SimpleFileEx (fp=0x80c6498, filename=0xbffff268
"./demo.py", closeit=1)
at ../../Python/pythonrun.c:579
#35 0x8064f1c in PyRun_AnyFileEx (fp=0x80c6498, filename=0xbffff268
"./demo.py", closeit=1)
at ../../Python/pythonrun.c:459
#36 0x8051a10 in Py_Main (argc=1, argv=0xbffff0a4) at
../../Modules/main.c:289
#37 0x8051556 in main (argc=2, argv=0xbffff0a4) at
../../Modules/python.c:10
(gdb)
···
--
Med vänlig hälsning / Regards
Håkan Olsson, Suntron
suntron@algonet.se