[PyQt] Eric4 issue with splitted views

Hans-Peter Jansen hpj at urpla.net
Mon Mar 24 15:43:35 GMT 2014


On Montag, 24. März 2014 15:07:07 Rohan Garg wrote:
> On Mon, Mar 24, 2014 at 3:01 PM, Hans-Peter Jansen <hpj at urpla.net> wrote:
> > Dear Phil,
> > 
> > I suffer from a long term Eric 4 problem, where eric crashes consistently
> > on exit, when I split just one view.
> > 
> > Prerequisites:
> > Running on KDE4 with PyQt4 available
> > Using tabbed view in Viewmanager
> > 
> > Reproduce:
> > Just running eric with a single file argument, right click into editor,
> > choose "New view (with new split)" and exit reproduces this for me.
> > 
> > Results in:
> > Thread 1 (Thread 0x7fc162564700 (LWP 4712)):
> > [KCrash Handler]
> > #6  0x00007fc15d707aca in QWidgetPrivate::deleteTLSysExtra
> > (this=this at entry=0x44e45f0) at kernel/qwidget_x11.cpp:2885 #7 
> > 0x00007fc15d6bea85 in QWidgetPrivate::deleteExtra
> > (this=this at entry=0x44e45f0) at kernel/qwidget.cpp:1832 #8 
> > 0x00007fc15d6becad in QWidgetPrivate::~QWidgetPrivate (this=0x44e45f0,
> > __in_chrg=<optimized out>) at kernel/qwidget.cpp:365 #9 
> > 0x00007fc15daa8e75 in ~QMenuPrivate (this=0x44e45f0, __in_chrg=<optimized
> > out>) at widgets/qmenu_p.h:171 #10 QMenuPrivate::~QMenuPrivate
> > (this=0x44e45f0, __in_chrg=<optimized out>) at widgets/qmenu_p.h:183 #11
> > 0x00007fc15fc68c35 in cleanup (pointer=<optimized out>) at
> > ../../src/corelib/tools/qscopedpointer.h:62 #12 ~QScopedPointer
> > (this=0x44e4588, __in_chrg=<optimized out>) at
> > ../../src/corelib/tools/qscopedpointer.h:100 #13 QObject::~QObject
> > (this=0x44e4580, __in_chrg=<optimized out>) at kernel/qobject.cpp:816 #14
> > 0x00007fc15d6c76ac in QWidget::~QWidget (this=0x44e4580,
> > __in_chrg=<optimized out>) at kernel/qwidget.cpp:1554 #15
> > 0x00007fc15e5bd989 in sipQMenu::~sipQMenu (this=0x44e4580,
> > __in_chrg=<optimized out>) at sipQtGuiQMenu.cpp:316 #16
> > 0x00007fc15e5bd9fe in release_QMenu (sipCppV=0x44e4580) at
> > sipQtGuiQMenu.cpp:2785 #17 0x00007fc1604ba476 in forgetObject
> > (sw=sw at entry=0x422c2b0) at siplib.c:10891 #18 0x00007fc1604bb599 in
> > sipWrapper_dealloc (self=0x422c2b0) at siplib.c:10443 #19
> > 0x00007fc16209aefa in subtype_dealloc (self=0x422c2b0) at
> > Objects/typeobject.c:1030 #20 0x00007fc1620937e0 in dict_dealloc
> > (mp=0x44f9d50) at Objects/dictobject.c:1010 #21 0x00007fc1620937b9 in
> > dict_dealloc (mp=0x3d30f20) at Objects/dictobject.c:1010 #22
> > 0x00007fc1604b86a7 in sipSimpleWrapper_clear (self=self at entry=0x3c11b00)
> > at siplib.c:10016 #23 0x00007fc1604bb4c4 in sipWrapper_clear
> > (self=0x3c11b00) at siplib.c:10402 #24 0x00007fc16207b232 in
> > delete_garbage (old=0x7fc162370260 <generations+96>,
> > collectable=0x7fff271e2780) at Modules/gcmodule.c:820 #25 collect
> > (generation=2) at Modules/gcmodule.c:984
> > #26 0x00007fc16207b710 in PyGC_Collect () at Modules/gcmodule.c:1440
> > #27 0x00007fc1620727b9 in Py_Finalize () at Python/pythonrun.c:449
> > #28 0x00007fc162072255 in Py_Exit (sts=0) at Python/pythonrun.c:1777
> > #29 0x00007fc1620723a4 in handle_system_exit () at Python/pythonrun.c:1151
> > #30 0x00007fc1620723d1 in PyErr_PrintEx
> > (set_sys_last_vars=set_sys_last_vars at entry=1) at Python/pythonrun.c:1161
> > #31 0x00007fc162072691 in PyErr_Print () at Python/pythonrun.c:1064 #32
> > 0x00007fc162072bf9 in PyRun_SimpleFileExFlags (fp=fp at entry=0x83e4e0,
> > filename=<optimized out>, filename at entry=0x7fff271e4f42
> > "/usr/lib64/python2.7/site-packages/eric4/eric4.py",
> > closeit=closeit at entry=1, flags=flags at entry=0x7fff271e29e0) at
> > Python/pythonrun.c:952 #33 0x00007fc16207312c in PyRun_AnyFileExFlags
> > (fp=fp at entry=0x83e4e0, filename=filename at entry=0x7fff271e4f42
> > "/usr/lib64/python2.7/site-packages/eric4/eric4.py",
> > closeit=closeit at entry=1, flags=flags at entry=0x7fff271e29e0) at
> > Python/pythonrun.c:752 #34 0x00007fc16207a81e in Py_Main (argc=<optimized
> > out>, argv=0x7fff271e2b98) at Modules/main.c:640 #35 0x00007fc161a31be5
> > in __libc_start_main () from /lib64/libc.so.6 #36 0x0000000000400791 in
> > _start ()
> > 
> > 
> > As you can see, this crash is a typical case of "dtor called" after python
> > exited. Of course, there isn't much, you can do about this. You even
> > provide sip.setdestroyonexit() for such issues. But that's exactly my
> > problem here.
> > 
> > With this patch applied, shouldn't such an issue not happen anymore:
> > 
> > --- eric4.py.orig       2014-01-07 07:46:19.000000000 +0100
> > +++ eric4.py    2014-03-24 10:07:04.223139840 +0100
> > @@ -17,6 +17,7 @@ import traceback
> > 
> >  import cStringIO
> >  import time
> >  import logging
> > 
> > +import sip
> > 
> >  from PyQt4.QtCore import QTextCodec, SIGNAL, SLOT, qWarning, \
> >  
> >      QLibraryInfo, QTimer
> > 
> > @@ -162,7 +163,12 @@ def main():
> >      global args, mainWindow, splash, restartArgs
> >      
> >      sys.excepthook = excepthook
> > 
> > -
> > +
> > +    try:
> > +        sip.setdestroyonexit(True)
> > +    except AttributeError:
> > +        pass
> > +
> > 
> >      options = [\
> >      
> >          ("--config=configDir",
> >          
> >           "use the given directory as the one containing the config
> >           files"),
> > 
> > I checked it also without exception handling, just in case, but problem
> > persists. Since I always use splitted views, and don't want to miss eric's
> > KDE integration, I would like to see this fixed.
> > 
> > I've checked eric's source for suspect operations during the split, but
> > couldn't spot any fishy operations. (ViewManager/ViewManager.py,
> > Plugins/ViewManagerPlugins/Tabview/Tabview.py).
> > 
> > Given the environmental conditions, I suspect some timing related issue,
> > which might explain, why Detlev cannot reproduce it.
> > 
> > Is there something wrong with my understanding of sip.setdestroyonexit, or
> > do you have an idea, what could lead to this issue?
> > 
> > Thanks in advance,
> > Pete
> > 
> > System:
> > openSUSE 13.1/x86_64
> > Qt: 4.8.5
> > KDE: 4.11.5
> > Python: 2.7.6
> > sip: 4.15.1
> > PyQt4: 4.10.2
> > eric4: 4.5.20
> > _______________________________________________
> > PyQt mailing list    PyQt at riverbankcomputing.com
> > http://www.riverbankcomputing.com/mailman/listinfo/pyqt
> 
> Looks like we're suffering from the same issue, I posted this [1]
> moments before you.

Hehe, good to know, I'm not alone ;)

You might want to try to solve it similar to the supplied patch..
In theory, it should prevent this class of errors to occur.

Pete


More information about the PyQt mailing list