[PyKDE] khtml/kparts segfault on keyPressEvent

Jim Bublitz jbublitz at nwinternet.com
Fri Dec 12 07:37:00 GMT 2003


On Monday December 8 2003 13:59, Troy Melhase wrote:

Sorry there hasn't been a response on this yet - I've had the 
message open on my desktop since it was posted, but haven't been 
able to get to it. Looks like it might be the weekend before I 
can really check it out.

In the meantime, one thing you can check is to see if 
"importTest.py" in the top level PyKDE directory runs without 
crashing.  It doesn't seem likely to be the problem (the program 
should crash on the PyKDE import stmts if it was), but it would 
be worth a try. A bug in a dependent module (dcop, kdecore, 
kdeui, kio) would cause khtml or kparts to crash too. That it 
requires a key press (if I read correctly) seems to indicate 
some other kind of problem.

I'll get to this - just hasn't been much time this week.

Jim


> Hi Folks:
>
> The test script below works for me as expected.  If khtml or
> kparts is imported as part of the script, python segfaults
> when a key is pressed in the window.
>
> I'm running:
> 	python 2.3.2
> 	sip 3.8 (build 109)
> 	qt 3.1.2 (196866)
> 	pyqt 3.8.1 (198657)
> 	pykde 3.8.0
> 	kde 3.1.4
>
> When building PyKDE, I edited sip/kaccelmanager.sip and
> commented out each of the 'manage' definitions -- I got
> segfaults importing pykde modules otherwise.
>
> My obvious question is:  could the undefined kaccelmanager
> functions be part of this problem, and if so, what's the
> proper definition to include in kaccelmanager.sip to have it
> compile correctly for my env?
>
> My other obvious questions are:  Have I done something wrong? 
> What do I do from here?   Any help is greatly appreciated.

> The backtrace follows the script, but I've compiled without
> symbols, so it's of little help I think.
>
> Script:
> import sys
> #import khtml
> #import kparts
> from qt import *
>
> class Test(QTextEdit):
>     def keyPressEvent(self, e):
>         text, key, ascii, state = e.text(), e.key(),
> e.ascii(), e.state() print text, key, ascii, state
>         e.ignore()
>
> if __name__ == '__main__':
>     app = QApplication(sys.argv)
>     shell = Test(None)
>     app.setMainWidget(shell)
>     shell.show()
>     app.exec_loop()
>
> Backtrace:
> #0  0x00000000 in ?? ()
> No symbol table info available.
> #1  0x42c872d5 in sipSubClass_khtml_MouseEvent(QEvent const*)
> () from /usr/lib/python2.3/site-packages/libkhtmlcmodule.so No
> symbol table info available.
> #2  0x404f13bc in convertSubClass ()
>    from /usr/lib/python2.3/site-packages/libsip.so
> No symbol table info available.
> #3  0x404f1009 in sipMapCppToSelfSubClass ()
>    from /usr/lib/python2.3/site-packages/libsip.so
> No symbol table info available.
> #4  0x414827fb in
> sipQWidget::sipVH_keyPressEvent(sipMethodCache const*, _sipThi
> sType*, QKeyEvent*) () from
> /usr/lib/python2.3/site-packages/libqtcmodule.so No symbol
> table info available.
> #5  0x41279574 in sipQTextEdit::keyPressEvent(QKeyEvent*) ()
>    from /usr/lib/python2.3/site-packages/libqtcmodule.so
> No symbol table info available.
> #6  0x4077e57c in QWidget::event(QEvent*) () from
> /usr/qt/3/lib/libqt-mt.so.3 No symbol table info available.
> #7  0x408837dd in QTextEdit::event(QEvent*) () from
> /usr/qt/3/lib/libqt-mt.so.3
> No symbol table info available.
> #8  0x41278133 in sipQTextEdit::event(QEvent*) ()
>    from /usr/lib/python2.3/site-packages/libqtcmodule.so
> No symbol table info available.
> #9  0x406ec4c4 in QApplication::internalNotify(QObject*,
> QEvent*) () from /usr/qt/3/lib/libqt-mt.so.3
> No symbol table info available.
> #10 0x406ebe3c in QApplication::notify(QObject*, QEvent*) ()
>    from /usr/qt/3/lib/libqt-mt.so.3
> No symbol table info available.
> #11 0x4149d6db in sipQApplication::notify(QObject*, QEvent*)
> () from /usr/lib/python2.3/site-packages/libqtcmodule.so No
> symbol table info available.
> #12 0x4069399e in QETWidget::translateKeyEvent(_XEvent const*,
> bool) () from /usr/qt/3/lib/libqt-mt.so.3
> No symbol table info available.
> #13 0x4068f68d in QApplication::x11ProcessEvent(_XEvent*) ()
>    from /usr/qt/3/lib/libqt-mt.so.3
> No symbol table info available.
> #14 0x406a4bc1 in QEventLoop::processEvents(unsigned) ()
>    from /usr/qt/3/lib/libqt-mt.so.3
> No symbol table info available.
> #15 0x407002c6 in QEventLoop::enterLoop() () from
> /usr/qt/3/lib/libqt-mt.so.3 No symbol table info available.
> #16 0x40700168 in QEventLoop::exec() () from
> /usr/qt/3/lib/libqt-mt.so.3 No symbol table info available.
> #17 0x406ec6f1 in QApplication::exec() () from
> /usr/qt/3/lib/libqt-mt.so.3 No symbol table info available.
> #18 0x4149fa9b in sipDo_QApplication_exec_loop(_object*,
> _object*) () from
> /usr/lib/python2.3/site-packages/libqtcmodule.so No symbol
> table info available.




More information about the PyQt mailing list