[PyQt] segfault with KXmlGuiWindow

Wolfgang Rohdewald wolfgang at rohdewald.de
Thu Apr 2 08:12:16 BST 2009


This is a problem since I started using pykde, it persists
after updating from kubuntu intrepid to jaunty. See the example
below.

At program exit, I have a segfault. If I remove "def main"
and execute its content directly, I have no segfault. But this
is no real solution for me because in my full program the segfault
happens in both cases.

Is there something wrong in my python code?

import sys
from PyKDE4 import kdecore,  kdeui

class MainWnd(kdeui.KXmlGuiWindow):
    def __init__(self):
        super(MainWnd, self).__init__()
        kdeui.KStandardAction.quit(kdeui.KApplication.kApplication().quit, self.actionCollection())
        self.setupGUI()

def main():
    about = kdecore.KAboutData ("bug", "", kdecore.ki18n("bug"), "0.1")
    kdecore.KCmdLineArgs.init (sys.argv, about)
    app = kdeui.KApplication()
    mainWindow =  MainWnd()
    mainWindow.show()
    app.exec_()

if __name__ == "__main__":
    main()

I have
python-qt4 4.2.2
python-kde4 4.2.2
libqt4.5.0
python 2.6.1



this is what valgrind tells me:
==12561== Invalid read of size 4                                                                                            
==12561==    at 0x5D659B5: QWidget::~QWidget() (qwidget.cpp:1357)                                                           
==12561==    by 0x6161920: QMainWindow::~QMainWindow() (qmainwindow.cpp:328)                                                
==12561==    by 0x716E13A: KMainWindow::~KMainWindow() (kmainwindow.cpp:467)                                                
==12561==    by 0x71B1266: KXmlGuiWindow::~KXmlGuiWindow() (kxmlguiwindow.cpp:127)                                          
==12561==    by 0x6B0D377: sipKXmlGuiWindow::~sipKXmlGuiWindow() (sipkdeuipart0.cpp:8222)                                   
==12561==    by 0x6AD327F: release_KXmlGuiWindow (sipkdeuipart0.cpp:12403)                                                  
==12561==    by 0x6AD32D6: dealloc_KXmlGuiWindow (sipkdeuipart0.cpp:12417)                                                  
==12561==    by 0x47D45A2: sipWrapper_dealloc (siplib.c:7543)                                                               
==12561==    by 0x80A9104: subtype_dealloc (typeobject.c:1018)                                                              
==12561==    by 0x816719E: frame_dealloc (frameobject.c:417)                                                                
==12561==    by 0x80DF5B4: PyEval_EvalFrameEx (ceval.c:3794)                                                                
==12561==    by 0x80E00C7: PyEval_EvalCodeEx (ceval.c:2968)                                                                 
==12561==    by 0x80E0226: PyEval_EvalCode (ceval.c:522)                                                                    
==12561==    by 0x80FE2E0: PyRun_FileExFlags (pythonrun.c:1334)                                                             
==12561==    by 0x80FE631: PyRun_SimpleFileExFlags (pythonrun.c:930)                                                        
==12561==    by 0x805C8B1: Py_Main (main.c:599)                                                                             
==12561==    by 0x805B9A1: main (python.c:23)                                                                               
==12561==  Address 0x4 is not stack'd, malloc'd or (recently) free'd                                                        
==12561==                                                                                                                   
==12561== Process terminating with default action of signal 11 (SIGSEGV)                                                    
==12561==  Access not within mapped region at address 0x4                                                                   
==12561==    at 0x5D659B5: QWidget::~QWidget() (qwidget.cpp:1357)                                                           
==12561==    by 0x6161920: QMainWindow::~QMainWindow() (qmainwindow.cpp:328)                                                
==12561==    by 0x716E13A: KMainWindow::~KMainWindow() (kmainwindow.cpp:467)                                                
==12561==    by 0x71B1266: KXmlGuiWindow::~KXmlGuiWindow() (kxmlguiwindow.cpp:127)                                          
==12561==    by 0x6B0D377: sipKXmlGuiWindow::~sipKXmlGuiWindow() (sipkdeuipart0.cpp:8222)                                   
==12561==    by 0x6AD327F: release_KXmlGuiWindow (sipkdeuipart0.cpp:12403)                                                  
==12561==    by 0x6AD32D6: dealloc_KXmlGuiWindow (sipkdeuipart0.cpp:12417)                                                  
==12561==    by 0x47D45A2: sipWrapper_dealloc (siplib.c:7543)                                                               
==12561==    by 0x80A9104: subtype_dealloc (typeobject.c:1018)                                                              
==12561==    by 0x816719E: frame_dealloc (frameobject.c:417)                                                                
==12561==    by 0x80DF5B4: PyEval_EvalFrameEx (ceval.c:3794)                                                                
==12561==    by 0x80E00C7: PyEval_EvalCodeEx (ceval.c:2968)                                                                 
==12561==    by 0x80E0226: PyEval_EvalCode (ceval.c:522)                                                                    
==12561==    by 0x80FE2E0: PyRun_FileExFlags (pythonrun.c:1334)                                                             
==12561==    by 0x80FE631: PyRun_SimpleFileExFlags (pythonrun.c:930)                                                        
==12561==    by 0x805C8B1: Py_Main (main.c:599)                                                                             
==12561==    by 0x805B9A1: main (python.c:23)         


-- 
Wolfgang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20090402/0de5b0dd/attachment.html


More information about the PyQt mailing list