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 1152 - Segfault when emitting a signal with a None parameter from another thread
: Segfault when emitting a signal with a None parameter from another thread
Status: ASSIGNED
Product: PySide
Classification: Unclassified
Component: PySide
: 1.1.0
: PC All
: P2 normal
Assigned To: Hugo Parente Lima
:
:
:
  Show dependency treegraph
 
Reported: 2012-02-26 04:08 EET by Andy Kittner
Modified: 2012-03-08 16:57 EET (History)
8 users (show)

See Also:


Attachments
Sample to demonstrate the problem (694 bytes, text/x-python)
2012-02-26 04:08 EET, Andy Kittner
Details
Traceback from gdb (5.44 KB, text/plain)
2012-02-26 04:09 EET, Andy Kittner
Details
Patch that makes the segfault go away for me (835 bytes, patch)
2012-02-26 04:10 EET, Andy Kittner
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andy Kittner 2012-02-26 04:08:13 EET
Created attachment 492 [details]
Sample to demonstrate the problem

See the attached example for a demonstration of the problem.
I'll also attach the traceback I got from gdb.

Essentially what appears to happen is this:

1. PySide::MetaFunction::call converts the arguments to the signal to cpp
values
2. The shiboken converter to do that converts Py_None to a NULL-pointer
(pythonToCppPointer in libshiboken/sbkconvert.cpp)
3. The QMetaObject system tries to make a copy of the PyObject pointer using a
PySide::PyObjectWrapper which then goes boom when trying to INCREF its
underlying python object

I have attached a simple patch that uses Py_XINCREF/DECREF instead. With
this I no longer get a crash, but I don't know the pyside internals well
enough to know if this is a good solution or just masking the symptoms of the
real problem.



Versions used:

  apiextractor 0.10.10
  generatorrunner 0.6.16
  shiboken 1.1.0
  pyside 1.1.0
Comment 1 Andy Kittner 2012-02-26 04:09:13 EET
Created attachment 493 [details]
Traceback from gdb
Comment 2 Andy Kittner 2012-02-26 04:10:35 EET
Created attachment 494 [details]
Patch that makes the segfault go away for me
Comment 3 Hugo Parente Lima 2012-02-27 20:06:49 EET
Maybe would be nice to avoid create the PyObjectWrapper instance with a null
pointer instead of using X_INC/DECREF's
Comment 4 Matti Airas 2012-03-08 16:57:51 EET
PySide is now a Qt-addon and uses Qt Project's JIRA tool for tracking bugs.
Please verify that the bug is still valid and re-submit it in the address
below:

https://bugreports.qt-project.org/

Sorry for the inconvenience!