Le 28/01/2011 20:14, Robin Dunn a �crit :
The only thing I can think of is to ensure that you indeed have the assertions turned on by trying to trigger one. If that works then I guess for the challenge code is that there is some other problem that you are running into before it hits the assertion that I'm seeing when I run the sample. Here is a simple way to trigger a different assertion:
Python 2.6.4 (r264:75706, Feb 4 2010, 23:47:47)
[GCC 4.4.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import wx
>>> wx.version()
'2.8.11.0 (gtk2-unicode)'
>>> app = wx.App(False)
>>> w = wx.Window(None)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "wx/_core.py", line 8438, in __init__
_core_.Window_swiginit(self,_core_.new_Window(*args, **kwargs)) wx._core.PyAssertionError: C++ assertion "wxAssertFailure" failed at ../wx/src/gtk/window.cpp(2415) in Create(): wxWindowGTK creation failed
>>>
OK, I get this one:
/home/essais/Wx_Tk_Challenge_1$ python
Python 2.6.4 (r264:75706, Dec 5 2009, 21:18:28)
[GCC 4.3.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import wx
>>> wx.version()
'2.8.11.0 (gtk2-unicode)'
>>> app = wx.App(False)
>>> w = wx.Window(None)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/essais/wxPython-src-2.8.11.0/wxPython/wx/_core.py", line 8438, in __init__
_core_.Window_swiginit(self,_core_.new_Window(*args, **kwargs))
wx._core.PyAssertionError: C++ assertion "wxAssertFailure" failed at ../src/gtk/window.cpp(2415) in Create(): wxWindowGTK creation failed
>>>
I tried yesterday to build a small example (getassert.py) from the Wx_Tk challenge that triggers the same kind of segfault. It does produce a segfault but there is no assert error before:
/home/essais/Wx_Tk_Challenge_1$ python getassert.py
Erreur de segmentation
/home/essais/Wx_Tk_Challenge_1$ gdb python
GNU gdb (GDB) 7.1
[...]
(gdb) run getassert.py
Starting program: /usr/bin/python getassert.py
[Thread debugging using libthread_db enabled]
Traceback (most recent call last):
File "/usr/share/gdb/auto-load/usr/lib/libgobject-2.0.so.0.2200.5-gdb.py", line 9, in <module>
from gobject import register
File "/usr/share/glib-2.0/gdb/gobject.py", line 3, in <module>
import gdb.backtrace
ImportError: No module named backtrace
Program received signal SIGSEGV, Segmentation fault.
0xb72a7b51 in wxListMainWindow::InsertItem (this=0x83ea6f0, item=...)
at ../src/generic/listctrl.cpp:4766
4766 wxColWidthInfo *pWidthInfo = m_aColWidths.Item(item.GetColumn());
(gdb) bt
#0 0xb72a7b51 in wxListMainWindow::InsertItem (this=0x83ea6f0, item=...)
at ../src/generic/listctrl.cpp:4766
#1 0xb72aa1f0 in wxGenericListCtrl::InsertItem (this=0x83e98d8, info=...)
at ../src/generic/listctrl.cpp:5578
#2 0xb72aa377 in wxGenericListCtrl::InsertItem (this=0x83e98d8, index=0,
label=..., imageIndex=-1) at ../src/generic/listctrl.cpp:5607
#3 0xb5d55ad5 in _wrap_ListCtrl_InsertStringItem (args=0x82ee644, kwargs=
0xb7bcce84) at src/gtk/_controls_wrap.cpp:31618
#4 0xb7ec71ba in PyCFunction_Call () from /usr/lib/libpython2.6.so.1.0
[...]
I think I will have to live with that and continue to use gdb if I ever get a segfault without any assert.
Thanks for your time
getassert.py (423 Bytes)
···
--
jmp