Invalid reads in handling of accels

Waldo Bastian bastian at kde.org
Thu Jul 18 19:17:44 BST 2002


With the latest qt-copy (post Qt-3.05 development snapshot I believe?) 
valgrind reports invalid reads within Qt code (See backtrace below)
I have not tested other Qt versions.

The problem is that Qt expects the parent of the QAccel to be a widget, but in 
the case of KDE it is usually a KActionCollection

Running a KDE application with the attached patch to qaccel.cpp highlights the 
problem. (Just press a few keys)

Cheers,
Waldo

==18914== Invalid read of size 4
==18914==    at 0x40FEC3FC: ??? (.moc/debug-mt/../../kernel/qwidget.h:674)
==18914==    by 0x40C1F4DA: QAccel::eventFilter(QObject *, QEvent *) 
(kernel/qaccel.cpp:493)
==18914==    by 0x40C69F1E: QObject::activate_filters(QEvent *) 
(kernel/qobject.cpp:779)
==18914==    by 0x40C69D35: QObject::event(QEvent *) (kernel/qobject.cpp:655)
==18914==    by 0x40C9AD55: QWidget::event(QEvent *) (kernel/qwidget.cpp:4220)
==18914==    by 0x40D31FE4: QMainWindow::event(QEvent *) 
(widgets/qmainwindow.cpp:1609)
==18914==    by 0x40C23979: QApplication::internalNotify(QObject *, QEvent *) 
(kernel/qapplication.cpp:2209)
==18914==    by 0x40C236D8: QApplication::notify(QObject *, QEvent *) 
(kernel/qapplication.cpp:2157)
==18914==    by 0x408B08B5: KApplication::notify(QObject *, QEvent *) 
(kapplication.cpp:556)
==18914==    by 0x40FE9D24: ??? 
(.moc/debug-mt/../../kernel/qapplication.h:444)
==18914==    by 0x40BCFDF9: QETWidget::translateKeyEvent(_XEvent const *, 
bool) (kernel/qapplication_x11.cpp:5419)
==18914==    by 0x40BCB78B: QApplication::x11ProcessEvent(_XEvent *) 
(kernel/qapplication_x11.cpp:3613)
==18914==    by 0x40BCA019: QApplication::processNextEvent(bool) 
(kernel/qapplication_x11.cpp:3090)
==18914==    by 0x40C25614: QApplication::enter_loop(void) 
(kernel/qapplication.cpp:3089)
==18914==    by 0x40BC9F1B: QApplication::exec(void) 
(kernel/qapplication_x11.cpp:3045)
==18914==    by 0x402754E4: main (konq_main.cc:136)
==18914==    by 0x4132C7EE: __libc_start_main (in /lib/libc.so.6)
==18914==    by 0x80485E1: __libc_start_main@@GLIBC_2.0 (in 
/ext/kde-head/bin/konqueror)
==18914==    Address 0x47F88EC8 is not stack'd, malloc'd or free'd


-- 
bastian at kde.org  |   SuSE Labs KDE Developer  |  bastian at suse.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: qaccel.patch
Type: text/x-diff
Size: 687 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20020718/9b4c5ac8/attachment.patch>


More information about the kde-core-devel mailing list