The following crashes:
>>> from wxPython.wx import wxSize
>>> print wxSize(6,6)==6
Segmentation fault
Obviously, you wouldn't write that kind of code directly, but as values
are flying around in arguments and such, it can happen:
print a==b
Can this be fixed?
Should I report it on the bug list?
Hello,
I investigated on it a little bit, and the results are *very* weird...
[alb@gandalf alb]$ cat tmp/bug.py
from wxPython import wx
wx.wxSize(2, 2) == 3
[alb@gandalf alb]$ gdb py23
GNU gdb 5.1.1
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-mandrake-linux"...
(gdb) run tmp/bug.py
Starting program: /usr/local/bin/py23 tmp/bug.py
[New Thread 1024 (LWP 7792)]
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1024 (LWP 7792)]
PyErr_SetObject (exception=0x4053432c, value=0x4057e430) at Python/errors.c:39
39 oldtype = tstate->curexc_type;
So, according to gdb, the segfault is in the interpreter....
After some more investigations on the call stack, it turns out that the
problematic line is wxPython/src/helpers.cpp:2092, inside the function
wxSize_helper
error:
PyErr_SetString(PyExc_TypeError, "Expected a 2-tuple of integers or a
wxSize object."); <-- this is the "bad" line
return FALSE;
So, I tried to comment it out, and the segfault disappears (at least in
the case above).
Now, to understand what's going on, well, is a totally different issue,
which I don't even want to start thinking of...
HTH,
Alberto