[Qt-interest] glibc detected 'corrupted double-linked list' due toa static QCursor member variable in installed eventHandler?
Frank Hemer
frank at hemer.org
Mon May 25 13:42:54 CEST 2009
On Monday 25 May 2009 04:52:17 Tony Rietwyk wrote:
> Hi Frank,
>
> You are installing the event filter on itself? I doubt this action is
> supported, and am surprised that you don't get warnings from Qt about it!
> Why not just override QObject::event()? What do you actually want to
> achieve? What error occurs in the destructor?
Well, this is implemented according to the qt doc, see here:
http://doc.qtsoftware.com/4.4/qobject.html#eventFilter
I'm handling events on a QTableView - which is one of the widgets in MyClass.
It appears this has nothing to do with the application logic as the error also
happens if the view is not populated with data at all and the static variable
is the only action taken in the event handler.
The MyClass dialog is created, and on cancel (calling reject ()) deleteLater
is invoked.
Valgrind does not show any suspect output, the gdb core backtrace is as
follows:
#0 0x00002af69489ab45 in raise () from /lib64/libc.so.6
#1 0x00002af69489c0e0 in abort () from /lib64/libc.so.6
#2 0x00002af6948d2fbb in ?? () from /lib64/libc.so.6
#3 0x00002af6948d821d in ?? () from /lib64/libc.so.6
#4 0x00002af6948d9c55 in ?? () from /lib64/libc.so.6
#5 0x00002af6948d9f76 in free () from /lib64/libc.so.6
#6 0x00002af69303c451 in ~QThreadData (this=0x7a5260) at
thread/qthread.cpp:83
#7 0x00002af69303c558 in QThreadData::deref (this=0x5222) at
thread/qthread.cpp:103
#8 0x00002af69303c597 in ~QThreadPrivate (this=0x7a6b60) at
thread/qthread.cpp:133
#9 0x00002af6931355c9 in ~QObject (this=0x7a51a0) at kernel/qobject.cpp:887
#10 0x00002af69310123b in ~QProcessManager (this=0x7a51a0) at
io/qprocess_unix.cpp:269
#11 0x00002af6930ffdb9 in __tcf_0 ()
at ../../include/QtCore/../../src/corelib/global/qglobal.h:1541
#12 0x00002af69489d37e in exit () from /lib64/libc.so.6
#13 0x00002af694887b5b in __libc_start_main () from /lib64/libc.so.6
#14 0x000000000044ce49 in _start ()
The error appears when the application is exited (on user action clicking a
close button), I can see following backtrace on the console:
*** glibc detected *** ./MyApplication: corrupted double-linked list:
0x00000000007a6390 ***
======= Backtrace: =========
/lib64/libc.so.6[0x2b94f09d821d]
/lib64/libc.so.6[0x2b94f09d9c55]
/lib64/libc.so.6(cfree+0x76)[0x2b94f09d9f76]
/usr/local/Trolltech/Qt-4.4.2/lib/libQtCore.so.4(_ZN11QThreadDataD1Ev+0x81)
[0x2b94ef13c451]
/usr/local/Trolltech/Qt-4.4.2/lib/libQtCore.so.4
(_ZN11QThreadData5derefEv+0x18)[0x2b94ef13c558]
/usr/local/Trolltech/Qt-4.4.2/lib/libQtCore.so.4[0x2b94ef13c597]
/usr/local/Trolltech/Qt-4.4.2/lib/libQtCore.so.4(_ZN7QObjectD2Ev+0x5a9)
[0x2b94ef2355c9]
/usr/local/Trolltech/Qt-4.4.2/lib/libQtCore.so.4[0x2b94ef20123b]
/usr/local/Trolltech/Qt-4.4.2/lib/libQtCore.so.4[0x2b94ef1ffdb9]
/lib64/libc.so.6(exit+0x7e)[0x2b94f099d37e]
/lib64/libc.so.6(__libc_start_main+0xfb)[0x2b94f0987b5b]
./MyApplication(_ZN10QTabWidget13keyPressEventEP9QKeyEvent+0xf9)[0x44ce49]
======= Memory map: ========
00400000-00590000 r-xp 00000000 08:05
1020288 /home/frank/work/projects/VMobile/VMobile-GUI/VMobile
(deleted)
0078f000-00790000 r--p 0018f000 08:05
1020288 /home/frank/work/projects/VMobile/VMobile-GUI/VMobile
(deleted)
00790000-00793000 rw-p 00190000 08:05
1020288 /home/frank/work/projects/VMobile/VMobile-GUI/VMobile
(deleted)
00793000-00d48000 rw-p 00793000 00:00 0
[heap]
40000000-40001000 ---p 40000000 00:00 0
40001000-40801000 rw-p 40001000 00:00 0
2aaaac000000-2aaaac058000 rw-p 2aaaac000000 00:00 0
2aaaac058000-2aaab0000000 ---p 2aaaac058000 00:00 0
2b94ec384000-2b94ec3a0000 r-xp 00000000 08:02
2595391 /lib64/ld-2.6.1.so
2b94ec3a0000-2b94ec3a2000 rw-p 2b94ec3a0000 00:00 0
2b94ec59f000-2b94ec5a1000 rw-p 0001b000 08:02
2595391 /lib64/ld-2.6.1.so
2b94ec5a1000-2b94ec60b000 r-xp 00000000 08:05
8487303 /home/frank/work/projects/VMobile/VMobile-GUI/lib/libVMWidgets.so.1.0.0
2b94ec60b000-2b94ec80a000 ---p 0006a000 08:05
8487303 /home/frank/work/projects/VMobile/VMobile-GUI/lib/libVMWidgets.so.1.0.0
2b94ec80a000-2b94ec80f000 r--p 00069000 08:05
8487303 /home/frank/work/projects/VMobile/VMobile-GUI/lib/libVMWidgets.so.1.0.0
2b94ec80f000-2b94ec811000 rw-p 0006e000 08:05
8487303 /home/frank/work/projects/VMobile/VMobile-GUI/lib/libVMWidgets.so.1.0.0
2b94ec811000-2b94ec96e000 r-xp 00000000 08:05
8487718 /home/frank/work/projects/VMobile/VMobile-GUI/lib/libVMobileScript.so.1.0.0
2b94ec96e000-2b94ecb6e000 ---p 0015d000 08:05
8487718 /home/frank/work/projects/VMobile/VMobile-GUI/lib/libVMobileScript.so.1.0.0
2b94ecb6e000-2b94ecb77000 r--p 0015d000 08:05
8487718 /home/frank/work/projects/VMobile/VMobile-GUI/lib/libVMobileScript.so.1.0.0
2b94ecb77000-2b94ecb7b000 rw-p 00166000 08:05
8487718 /home/frank/work/projects/VMobile/VMobile-GUI/lib/libVMobileScript.so.1.0.0
2b94ecb7b000-2b94eccd5000 r-xp 00000000 08:05
18022571 /home/frank/work/projects/VMobile/VMobile-GUI/lib/libVMobile.so.1.0.0
2b94eccd5000-2b94eced4000 ---p 0015a000 08:05
18022571 /home/frank/work/projects/VMobile/VMobile-GUI/lib/libVMobile.so.1.0.0
2b94eced4000-2b94ecedb000 r--p 00159000 08:05
18022571 /home/frank/work/projects/VMobile/VMobile-GUI/lib/libVMobile.so.1.0.0
2b94ecedb000-2b94ecedf000 rw-p 00160000 08:05
18022571 /home/frank/work/projects/VMobile/VMobile-GUI/lib/libVMobile.so.1.0.0
2b94ecedf000-2b94ecee0000 rw-p 2b94ecedf000 00:00 0
2b94ecee0000-2b94ed7f9000 r-xp 00000000 08:02
1881318 /usr/local/Trolltech/Qt-4.4.2/lib/libQtGui.so.4.4.2
2b94ed7f9000-2b94ed9f8000 ---p 00919000 08:02
1881318 /usr/local/Trolltech/Qt-4.4.2/lib/libQtGui.so.4.4.2
2b94ed9f8000-2b94eda2e000 r--p 00918000 08:02
1881318 /usr/local/Trolltech/Qt-4.4.2/lib/libQtGui.so.4.4.2
2b94eda2e000-2b94eda3f000 rw-p 0094e000 08:02 1881318 Aborted (core
dumped)
Interesting: There is no QTabWidget referenced anywhere in MyClass.
Since this is 100% reproducible and goes away when removing the line:
static QCursor defaultCursor (Qt::ArrowCursor);
and when looking into the QCursor class I saw some mapping of references into
an inner qt cursor map table, I doubt this has sth. to do with the way I use
the eventhandler.
Frank
More information about the Qt-interest-old
mailing list