PySide Bugzilla Closed for New Bugs

PySide is now a Qt Add-on and uses the Qt Project's JIRA Bug Tracker instead of this Bugzilla instance. This Bugzilla is left for reference purposes.

Bug 152 - QGraphicsRectItem(int, int, int, int) ctor segfaults
: QGraphicsRectItem(int, int, int, int) ctor segfaults
Status: CLOSED DUPLICATE of bug 151
Product: PySide
Classification: Unclassified
Component: PySide
: HEAD
: All All
: P5 normal
Assigned To: renato filho
:
:
:
  Show dependency treegraph
 
Reported: 2010-02-18 14:13 EET by Bruno Araujo
Modified: 2010-03-24 14:40 EET (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bruno Araujo 2010-02-18 14:13:55 EET
test case:

$ python -c 'PySide.QtGui import QGraphicsRectItem; q = QGraphicsRectItem(10,
10, 10, 10)'
Segmentation fault

GDB trace:

(gdb) run
Starting program: /usr/bin/python -c from\ PySide.QtGui\ import\
QGraphicsRectItem\;\ q\ =\ QGraphicsRectItem\(10,\ 10,\ 10,\ 10\)
[Thread debugging using libthread_db enabled]

Program received signal SIGSEGV, Segmentation fault.
0x00506025 in Shiboken::Converter<QRectF>::isConvertible (pyobj=0x827ed4c)
    at
/home/bruno/projects/git/open/baraujo-pyside-shiboken/build/PySide/QtCore/PySide/QtCore/qrectf_wrapper.cpp:1990
1990        return SbkQRect_Check(pyobj);
Current language:  auto
The current source language is "auto; currently c++".
(gdb) back
#0  0x00506025 in Shiboken::Converter<QRectF>::isConvertible (pyobj=0x827ed4c)
    at
/home/bruno/projects/git/open/baraujo-pyside-shiboken/build/PySide/QtCore/PySide/QtCore/qrectf_wrapper.cpp:1990
#1  0x01251acf in SbkQGraphicsRectItem_Init (self=0x849ce40, args=0xb7f92a54,
kwds=0x0)
    at
/home/bruno/projects/git/open/baraujo-pyside-shiboken/build/PySide/QtGui/PySide/QtGui/qgraphicsrectitem_wrapper.cpp:807
#2  0x080aa165 in type_call (type=0x18ff8c0, args=0xb7f92a54, kwds=0x0) at
../Objects/typeobject.c:747
#3  0x0806120a in PyObject_Call (func=0x18ff8c0, arg=0xb7f92a54, kw=0x0) at
../Objects/abstract.c:2492
#4  0x080dbc3c in do_call (f=0x828db74, throwflag=0) at ../Python/ceval.c:3924
#5  call_function (f=0x828db74, throwflag=0) at ../Python/ceval.c:3729
#6  PyEval_EvalFrameEx (f=0x828db74, throwflag=0) at ../Python/ceval.c:2389
#7  0x080dddf2 in PyEval_EvalCodeEx (co=0xb7fd6a88, globals=0xb7fd11c4,
locals=0xb7fd11c4, args=0x0, argcount=0, kws=0x0, kwcount=0, defs=0x0,
defcount=0, 
    closure=0x0) at ../Python/ceval.c:2968
#8  0x080ddef7 in PyEval_EvalCode (co=0xb7fd6a88, globals=0xb7fd11c4,
locals=0xb7fd11c4) at ../Python/ceval.c:522
#9  0x080fa4bf in run_mod (command=0x8273008 "from PySide.QtGui import
QGraphicsRectItem; q = QGraphicsRectItem(10, 10, 10, 10)\n", flags=0xbffff33c)
    at ../Python/pythonrun.c:1335
#10 PyRun_StringFlags (command=0x8273008 "from PySide.QtGui import
QGraphicsRectItem; q = QGraphicsRectItem(10, 10, 10, 10)\n", flags=0xbffff33c)
    at ../Python/pythonrun.c:1298
#11 PyRun_SimpleStringFlags (command=0x8273008 "from PySide.QtGui import
QGraphicsRectItem; q = QGraphicsRectItem(10, 10, 10, 10)\n", flags=0xbffff33c)
    at ../Python/pythonrun.c:957
#12 0x0805c278 in Py_Main (argc=3, argv=0xbffff424) at ../Modules/main.c:548
#13 0x0805baeb in main (argc=3, argv=0xbffff424) at ../Modules/python.c:23

If I import the offending class (QRectF) prior to running the testcase, it
appears to solve the problem:

$ python -c 'from PySide.QtCore import QRectF; from PySide.QtGui import
QGraphicsRectItem; q = QGraphicsRectItem(10, 10, 10, 10)'
Comment 1 Anderson Lizardo 2010-02-18 14:16:49 EET
Note that QGraphicsRectItem is not the only failing constructor. Here is the
backtrace for a segfault on QRadialGradient(int,int,int,int,int):

#0  0xb71459a1 in Shiboken::Converter<QPointF>::isConvertible (pyobj=0x816ef88)
    at
/home/andgomes/sbox_home/workspace/pyside/pyside-shiboken.git/build/PySide/QtCore/PySide/QtCore/qpointf_wrapper.cpp:732
#1  0xb77fe8c0 in SbkQRadialGradient_Init (self=0x83ca4c0, args=0x83b8f2c,
kwds=0x0)
    at
/home/andgomes/sbox_home/workspace/pyside/pyside-shiboken.git/build/PySide/QtGui/PySide/QtGui/qradialgradient_wrapper.cpp:65
#2  0x0809efc4 in type_call (type=0xb7d33b00, args=0x83b8f2c, kwds=0x0) at
../Objects/typeobject.c:436
#3  0x0805cb97 in PyObject_Call (func=0x2, arg=0x83b8f2c, kw=0x0) at
../Objects/abstract.c:1861
#4  0x080c7aa7 in PyEval_EvalFrameEx (f=0x817cd84, throwflag=0) at
../Python/ceval.c:3784
#5  0x080cb1f7 in PyEval_EvalCodeEx (co=0xb7db04e8, globals=0xb7e04acc,
locals=0xb7e04acc, args=0x0, argcount=0, kws=0x0, kwcount=0, defs=0x0,
defcount=0, closure=0x0)
    at ../Python/ceval.c:2836
#6  0x080cb347 in PyEval_EvalCode (co=0xb7db04e8, globals=0xb7e04acc,
locals=0xb7e04acc) at ../Python/ceval.c:494
#7  0x080eb5b5 in PyRun_StringFlags (str=0x816b008 "from PySide.QtGui import
QRadialGradient; x = QRadialGradient(1,2,3,4,5)\n", start=257,
globals=0xb7e04acc, 
    locals=0xb7e04acc, flags=0xbf807398) at ../Python/pythonrun.c:1273
#8  0x080eb675 in PyRun_SimpleStringFlags (command=0x816b008 "from PySide.QtGui
import QRadialGradient; x = QRadialGradient(1,2,3,4,5)\n", flags=0xbf807398)
    at ../Python/pythonrun.c:900
#9  0x08058c81 in Py_Main (argc=1, argv=0xbf807464) at ../Modules/main.c:512
#10 0x080587f2 in main (argc=Cannot access memory at address 0x2
Comment 2 Anderson Lizardo 2010-02-18 14:20:27 EET
(In reply to comment #1)
> Note that QGraphicsRectItem is not the only failing constructor. Here is the
> backtrace for a segfault on QRadialGradient(int,int,int,int,int):

Forgot the actual segfaulting command:

python -c "from PySide.QtGui import QRadialGradient; x =
QRadialGradient(1,2,3,4,5)"

And the context around the segfault line (qpointf_wrapper.cpp:732):

(gdb) list
727     {
728     // Copy C++ object implementation
729     // Converter implementations
730     bool Converter<QPointF >::isConvertible(PyObject* pyobj)
731     {
732         return SbkQPoint_Check(pyobj);
733     }
734
735     QPointF Converter<QPointF >::toCpp(PyObject* pyobj)
736     {
Comment 3 Bruno Araujo 2010-02-18 14:24:48 EET
Looks like the bug summary is too specific, targeting only one class, when the
problem seems to be in the converters inside wrappers like qrectf_wrapper.cpp
and qpointf_wrapper.cpp. I'm not sure about how to correctly name this bug,
though.
Comment 4 Hugo Parente Lima 2010-02-18 18:22:00 EET
This bug is a side effect of bug# 151.

*** This bug has been marked as a duplicate of bug 151 ***