Details
Description
Attached is a simple GUI that crashes when a random number of user actions takes place.
To run the attached examples:
0) Download all three of the attached files to the same directory.
1) Start pyside_startProgram.py with python2.
2) Press the "THING" button a few times to create a few QTreeWidgetItems in the QTreeWidget (a QDialog briefly appears since this sometimes causes a crash).
3) Drag a few of these to the QListWidget below (the crash/error may happen here).
4) Press the "TEST" button to automatically perform undo, redo, list copy, and THING creation.
On Windows, the program will become unresponsive and have to be killed. On Linux, the above procedure will either terminate with a SegFault after calling createNewThing(), or raise an exception:
Traceback (most recent call last): File "pyside_startProgram.py", line 86, in test self.functions[number](self) File "pyside_startProgram.py", line 67, in createNewThing self.undoStack.push(undoAction) AttributeError: 'PySide.QtGui.QListWidgetItem' object has no attribute 'redo'
undoAction is either type LoadThings or Add2List, both of which subclass QUndoCommand (see pyside_undoCommands.py). For some reason, undoAction is being identified as a QListWidgetItem as it is being passed to the undoStack (QUndoStack). Only slightly more use of the GUI soon leads to a SegFault, usually after further complaints about the QListWidgetItem in the QUndoStack.
As noted in step two above, this bug can also be triggered by dragging items from the QTreeWidget to the QListWidget (I didn't figure out how to automate this for the test() function).
PyQt does not crash or raise exceptions and can run indefinitely.
I have seen similar errors in other parts of my code where a QGraphics*Item and a QTransform is misidentified as a QListWidgetItem, leading to an eventual SegFault.
This bug seems similar to PYSIDE-119.
Attachments
Issue Links
- relates to
-
PYSIDE-217 Leak in getter function generated with CppGenerator::writeGetterFunction when `newWrapperSameObject` is true
- Closed
-
PYSIDE-154 Probable bug: two wrappers can have the same C pointer address
- Open