<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"><html><head><meta name="qrichtext" content="1" /><style type="text/css">p, li { white-space: pre-wrap; }</style></head><body style=" font-family:'Bitstream Vera Sans Mono'; font-size:8pt; font-weight:400; font-style:normal;">This is a problem since I started using pykde, it persists<br>
after updating from kubuntu intrepid to jaunty. See the example<br>
below.<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p>At program exit, I have a segfault. If I remove "def main"<br>
and execute its content directly, I have no segfault. But this<br>
is no real solution for me because in my full program the segfault<br>
happens in both cases.<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p>Is there something wrong in my python code?<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p>import sys<br>
from PyKDE4 import kdecore,  kdeui<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p>class MainWnd(kdeui.KXmlGuiWindow):<br>
    def __init__(self):<br>
        super(MainWnd, self).__init__()<br>
        kdeui.KStandardAction.quit(kdeui.KApplication.kApplication().quit, self.actionCollection())<br>
        self.setupGUI()<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p>def main():<br>
    about = kdecore.KAboutData ("bug", "", kdecore.ki18n("bug"), "0.1")<br>
    kdecore.KCmdLineArgs.init (sys.argv, about)<br>
    app = kdeui.KApplication()<br>
    mainWindow =  MainWnd()<br>
    mainWindow.show()<br>
    app.exec_()<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p>if __name__ == "__main__":<br>
    main()<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p>I have<br>
python-qt4 4.2.2<br>
python-kde4 4.2.2<br>
libqt4.5.0<br>
python 2.6.1<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p><p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p><p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p>this is what valgrind tells me:<br>
==12561== Invalid read of size 4                                                                                            <br>
==12561==    at 0x5D659B5: QWidget::~QWidget() (qwidget.cpp:1357)                                                           <br>
==12561==    by 0x6161920: QMainWindow::~QMainWindow() (qmainwindow.cpp:328)                                                <br>
==12561==    by 0x716E13A: KMainWindow::~KMainWindow() (kmainwindow.cpp:467)                                                <br>
==12561==    by 0x71B1266: KXmlGuiWindow::~KXmlGuiWindow() (kxmlguiwindow.cpp:127)                                          <br>
==12561==    by 0x6B0D377: sipKXmlGuiWindow::~sipKXmlGuiWindow() (sipkdeuipart0.cpp:8222)                                   <br>
==12561==    by 0x6AD327F: release_KXmlGuiWindow (sipkdeuipart0.cpp:12403)                                                  <br>
==12561==    by 0x6AD32D6: dealloc_KXmlGuiWindow (sipkdeuipart0.cpp:12417)                                                  <br>
==12561==    by 0x47D45A2: sipWrapper_dealloc (siplib.c:7543)                                                               <br>
==12561==    by 0x80A9104: subtype_dealloc (typeobject.c:1018)                                                              <br>
==12561==    by 0x816719E: frame_dealloc (frameobject.c:417)                                                                <br>
==12561==    by 0x80DF5B4: PyEval_EvalFrameEx (ceval.c:3794)                                                                <br>
==12561==    by 0x80E00C7: PyEval_EvalCodeEx (ceval.c:2968)                                                                 <br>
==12561==    by 0x80E0226: PyEval_EvalCode (ceval.c:522)                                                                    <br>
==12561==    by 0x80FE2E0: PyRun_FileExFlags (pythonrun.c:1334)                                                             <br>
==12561==    by 0x80FE631: PyRun_SimpleFileExFlags (pythonrun.c:930)                                                        <br>
==12561==    by 0x805C8B1: Py_Main (main.c:599)                                                                             <br>
==12561==    by 0x805B9A1: main (python.c:23)                                                                               <br>
==12561==  Address 0x4 is not stack'd, malloc'd or (recently) free'd                                                        <br>
==12561==                                                                                                                   <br>
==12561== Process terminating with default action of signal 11 (SIGSEGV)                                                    <br>
==12561==  Access not within mapped region at address 0x4                                                                   <br>
==12561==    at 0x5D659B5: QWidget::~QWidget() (qwidget.cpp:1357)                                                           <br>
==12561==    by 0x6161920: QMainWindow::~QMainWindow() (qmainwindow.cpp:328)                                                <br>
==12561==    by 0x716E13A: KMainWindow::~KMainWindow() (kmainwindow.cpp:467)                                                <br>
==12561==    by 0x71B1266: KXmlGuiWindow::~KXmlGuiWindow() (kxmlguiwindow.cpp:127)                                          <br>
==12561==    by 0x6B0D377: sipKXmlGuiWindow::~sipKXmlGuiWindow() (sipkdeuipart0.cpp:8222)                                   <br>
==12561==    by 0x6AD327F: release_KXmlGuiWindow (sipkdeuipart0.cpp:12403)                                                  <br>
==12561==    by 0x6AD32D6: dealloc_KXmlGuiWindow (sipkdeuipart0.cpp:12417)                                                  <br>
==12561==    by 0x47D45A2: sipWrapper_dealloc (siplib.c:7543)                                                               <br>
==12561==    by 0x80A9104: subtype_dealloc (typeobject.c:1018)                                                              <br>
==12561==    by 0x816719E: frame_dealloc (frameobject.c:417)                                                                <br>
==12561==    by 0x80DF5B4: PyEval_EvalFrameEx (ceval.c:3794)                                                                <br>
==12561==    by 0x80E00C7: PyEval_EvalCodeEx (ceval.c:2968)                                                                 <br>
==12561==    by 0x80E0226: PyEval_EvalCode (ceval.c:522)                                                                    <br>
==12561==    by 0x80FE2E0: PyRun_FileExFlags (pythonrun.c:1334)                                                             <br>
==12561==    by 0x80FE631: PyRun_SimpleFileExFlags (pythonrun.c:930)                                                        <br>
==12561==    by 0x805C8B1: Py_Main (main.c:599)                                                                             <br>
==12561==    by 0x805B9A1: main (python.c:23)         <br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p><p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p>-- <br>
Wolfgang</p></body></html>