[PyQt] Help understanding a backtrace
kovid at kovidgoyal.net
Mon Jan 30 12:13:30 GMT 2012
I was able to trace the python code that is triggering the assert.
Basically, it is the following sequence:
view = self.parent()
At this point view is a subclass of QMainWindow and view.parent() returns None
Calling view.size() causes the assert to be triggered. Interestingly the assert
is only triggered the second time this code is run, which tells me that
probably the underlying Qt object corresponding to view has been deleted. view
is the main window of the application, there is reference to it kept at the
Note that this is only one instance where the assert is triggered, I am fairly
certain that there will be several unrelated code paths throughout calibre that
will trigger it, given the various crashes I have experienced.
Reading the SIP changelog, one thing of note: The QMainWindow subclass has
multiple inheritance. It is defined as
class EbookViewer(MainWindow, Ui_EbookViewer):
where Ui_EbookViewer comes from a compiled .ui file and MainWindow is a simple
subclass of QMainWindow. The definition of EbookViewer is here: http://bazaar.launchpad.net/~kovid/calibre/trunk/view/head:/src/calibre/gui2/viewer/main.py#L171
and the MainWindow class is:
Let me know if there's anything else I can do.
On Sun, Jan 29, 2012 at 10:14:48PM +0000, Phil Thompson wrote:
> On Sun, 29 Jan 2012 22:20:26 +0530, Kovid Goyal <kovid at kovidgoyal.net>
> > Got another crash, with the addition of SIP_ALIAS. The backtrace is a
> > little
> > different, now the crash happens in PyObject__GcUntrack called from
> > removeParent (backtrace attached).
> > To be clear this is running off sip 4.13.1 release tarball with the
> > change you asked for (addition of SIP_ALIAS in object_add())
> > How would you like me to proceed?
> Backout that change and apply the second one.
Dr. Kovid Goyal
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 198 bytes
Desc: Digital signature
More information about the PyQt