Hello,
Firstly, sorry about the HTML mail, but wrapping was making the pastes
unreadable.
I am getting a segfault when using wxFloatCanvas.
The backtrace looks something like this,
> (gdb) bt
> #0 _wrap_AlphaPixelData_Accessor_Get (args=0xb0b2670c) at
> src/gtk/_gdi_wrap.cpp:3191
> #1 0x0805c9e7 in PyObject_Call (func=0x978e560, arg=0xb0b5f5ec,
> kw=0xa1888ac) at ../Objects/abstract.c:1860
> #2 0x080c709f in PyEval_EvalFrameEx (f=0x95d2b9c, throwflag=0) at
> ../Python/ceval.c:3844
> #3 0x080ca115 in PyEval_EvalCodeEx (co=0x84a19b0, globals=0x84d2d74,
> locals=0x0, args=0x95da154, argcount=1, kws=0x95da158, kwcount=0, defs=0x0,
> defcount=0,
> closure=0x0) at ../Python/ceval.c:2831
> #4 0x080c85d9 in PyEval_EvalFrameEx (f=0x95da00c, throwflag=0) at
> ../Python/ceval.c:3660
> ...
If I go up a couple of frames and use the python gdb macros I can see
the following,
> (gdb) up
> #1 0x0805c9e7 in PyObject_Call (func=0x978e560, arg=0xb0b5f5ec,
> kw=0xa1888ac) at ../Objects/abstract.c:1860
> 1860 ../Objects/abstract.c: No such file or directory.
> in ../Objects/abstract.c
> Current language: auto; currently c
> (gdb) up
> #2 0x080c709f in PyEval_EvalFrameEx (f=0x95d2b9c, throwflag=0) at
> ../Python/ceval.c:3844
> 3844 ../Python/ceval.c: No such file or directory.
> in ../Python/ceval.c
> (gdb) pyframe
> /usr/lib/python2.5/site-packages/wx-2.8-gtk2-unicode/wx/_gdi.py (1082): Get
>
> (gdb) up
> #3 0x080ca115 in PyEval_EvalCodeEx (co=0x84a19b0, globals=0x84d2d74,
> locals=0x0, args=0x95da154, argcount=1, kws=0x95da158, kwcount=0, defs=0x0,
> defcount=0,
> closure=0x0) at ../Python/ceval.c:2831
> 2831 in ../Python/ceval.c
> (gdb) up
> #4 0x080c85d9 in PyEval_EvalFrameEx (f=0x95da00c, throwflag=0) at
> ../Python/ceval.c:3660
> 3660 in ../Python/ceval.c
> (gdb) pyframe
> ./extra/wxFloatCanvas/FloatCanvas.py (2342): GetHitTestColor
>
> (gdb) up
> #5 0x080ca115 in PyEval_EvalCodeEx (co=0x918c338, globals=0x917f604,
> locals=0x0, args=0x960d200, argcount=2, kws=0x960d208, kwcount=0, defs=0x0,
> defcount=0,
> closure=0x0) at ../Python/ceval.c:2831
> 2831 in ../Python/ceval.c
> (gdb) up
> #6 0x080c85d9 in PyEval_EvalFrameEx (f=0x960d0ac, throwflag=0) at
> ../Python/ceval.c:3660
> 3660 in ../Python/ceval.c
> (gdb) pyframe
> ./extra/wxFloatCanvas/FloatCanvas.py (2379): MouseOverTest
It appears that the code which is causing the segfault is in the HitTest
code (which I have included below),
> def GetHitTestColor(self, xy):
> if self._ForegroundHTBitmap:
> pdata = wx.AlphaPixelData(self._ForegroundHTBitmap)
> else:
> pdata = wx.AlphaPixelData(self._HTBitmap)
> if not pdata:
> raise RuntimeError("Trouble Accessing Hit Test
> bitmap")
> pacc = pdata.GetPixels()
> pacc.MoveTo(pdata, xy[0], xy[1])
> return pacc.Get()[:3]
>
The Get line is the one which fails (line number 2342 in
FloatCanvas.py). I think it may be related to something changing the
_HTBitmap while in the HitTest code (however I tried putting locks
around the _HTBitmap accesses and was still able to get a segfault).
If I change it to use the older hit test code which uses a DC,
everything works fine.
Any ideas how to work around this bug?
Tim 'Mithro' Ansell
_______________________________________________
FloatCanvas mailing list
[email protected]
http://mail.mithis.com/cgi-bin/mailman/listinfo/floatcanvas