Bug 325590

Summary: Kmail Crashes at exit
Product: [Applications] kmail2 Reporter: Oleg <prcoder>
Component: generalAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED UNMAINTAINED    
Severity: crash CC: dvratil, eikelmt, prcoder
Priority: NOR Keywords: drkonqi
Version: 4.11.2   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: New crash information added by DrKonqi
New crash information added by DrKonqi

Description Oleg 2013-10-03 16:45:21 UTC
Application: kmail (4.11.2)
KDE Platform Version: 4.11.2
Qt Version: 4.8.5
Operating System: Linux 3.11.2-301.fc20.i686+PAE i686
Distribution: "Fedora release 20 (Heisenbug)"

-- Information about the crash:
Kmail always Crashes at exit

The crash can be reproduced every time.

-- Backtrace:
Application: KMail (kmail), signal: Aborted
Using host libthread_db library "/lib/libthread_db.so.1".
[Current thread is 1 (Thread 0xb7742800 (LWP 2366))]

Thread 5 (Thread 0xb3e25b40 (LWP 2378)):
#0  0xb77aa424 in __kernel_vsyscall ()
#1  0x47feb7ac in pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:187
#2  0x45ee2c64 in WTF::TCMalloc_PageHeap::scavengerThread (this=this@entry=0x466bbbe0 <WTF::pageheap_memory>) at /usr/src/debug/webkit-qtwebkit-23/Source/WTF/wtf/FastMalloc.cpp:2571
#3  0x45ee2cb0 in WTF::TCMalloc_PageHeap::runScavengerThread (context=0x466bbbe0 <WTF::pageheap_memory>) at /usr/src/debug/webkit-qtwebkit-23/Source/WTF/wtf/FastMalloc.cpp:1767
#4  0x48cbef41 in ?? () from /usr/lib/nvidia-304xx/libGL.so.1
Backtrace stopped: previous frame inner to this frame (corrupt stack?)

Thread 4 (Thread 0xb3458b40 (LWP 2379)):
#0  0xb77aa424 in __kernel_vsyscall ()
#1  0x47feb7ac in pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:187
#2  0x45f132a4 in WTF::ThreadCondition::wait (this=this@entry=0xb35657dc, mutex=...) at /usr/src/debug/webkit-qtwebkit-23/Source/WTF/wtf/ThreadingPthreads.cpp:379
#3  0x45be253c in JSC::BlockAllocator::blockFreeingThreadMain (this=0xb3565750) at /usr/src/debug/webkit-qtwebkit-23/Source/JavaScriptCore/heap/BlockAllocator.cpp:128
#4  0x45ef8ef9 in WTF::threadEntryPoint (contextData=0xb3518be0) at /usr/src/debug/webkit-qtwebkit-23/Source/WTF/wtf/Threading.cpp:69
#5  0x45f12baa in WTF::wtfThreadEntryPoint (param=0x9a359d0) at /usr/src/debug/webkit-qtwebkit-23/Source/WTF/wtf/ThreadingPthreads.cpp:196
#6  0x48cbef41 in ?? () from /usr/lib/nvidia-304xx/libGL.so.1
Backtrace stopped: previous frame inner to this frame (corrupt stack?)

Thread 3 (Thread 0xb2636b40 (LWP 2380)):
#0  0xb77aa424 in __kernel_vsyscall ()
#1  0x47ebc3ab in poll () at ../sysdeps/unix/syscall-template.S:81
#2  0x4b9def8c in poll (__timeout=__timeout@entry=7759, __nfds=__nfds@entry=1, __fds=__fds@entry=0xb1d00df0) at /usr/include/bits/poll2.h:46
#3  g_poll (fds=fds@entry=0xb1d00df0, nfds=nfds@entry=1, timeout=timeout@entry=7759) at gpoll.c:132
#4  0x4b9cf890 in g_main_context_poll (priority=2147483647, n_fds=1, fds=0xb1d00df0, timeout=7759, context=0xb1d00500) at gmain.c:4006
#5  g_main_context_iterate (context=context@entry=0xb1d00500, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3707
#6  0x4b9cf9d9 in g_main_context_iteration (context=0xb1d00500, may_block=1) at gmain.c:3773
#7  0x4b50762f in QEventDispatcherGlib::processEvents (this=0xb1d00488, flags=...) at kernel/qeventdispatcher_glib.cpp:427
#8  0x4b4d43b0 in QEventLoop::processEvents (this=this@entry=0xb2636124, flags=...) at kernel/qeventloop.cpp:149
#9  0x4b4d4741 in QEventLoop::exec (this=this@entry=0xb2636124, flags=...) at kernel/qeventloop.cpp:204
#10 0x4b3b7d55 in QThread::exec (this=this@entry=0x9b60fb8) at thread/qthread.cpp:536
#11 0x4b3b7ebc in QThread::run (this=0x9b60fb8) at thread/qthread.cpp:603
#12 0x4b3ba81b in QThreadPrivate::start (arg=0x9b60fb8) at thread/qthread_unix.cpp:338
#13 0x48cbef41 in ?? () from /usr/lib/nvidia-304xx/libGL.so.1
Backtrace stopped: previous frame inner to this frame (corrupt stack?)

Thread 2 (Thread 0xad68bb40 (LWP 2383)):
#0  0xb77aa424 in __kernel_vsyscall ()
#1  0x47feb7ac in pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:187
#2  0x4e5ed922 in QTWTF::TCMalloc_PageHeap::scavengerThread (this=this@entry=0x4e6ec500 <QTWTF::pageheap_memory>) at ../3rdparty/javascriptcore/JavaScriptCore/wtf/FastMalloc.cpp:2359
#3  0x4e5ed970 in QTWTF::TCMalloc_PageHeap::runScavengerThread (context=0x4e6ec500 <QTWTF::pageheap_memory>) at ../3rdparty/javascriptcore/JavaScriptCore/wtf/FastMalloc.cpp:1464
#4  0x48cbef41 in ?? () from /usr/lib/nvidia-304xx/libGL.so.1
Backtrace stopped: previous frame inner to this frame (corrupt stack?)

Thread 1 (Thread 0xb7742800 (LWP 2366)):
[KCrash Handler]
#7  0xb77aa424 in __kernel_vsyscall ()
#8  0x47dffba6 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#9  0x47e013e3 in __GI_abort () at abort.c:89
#10 0x4b3af45a in qt_message_output (msgType=QtFatalMsg, buf=0x9dcc5a8 "Fatal Error: Accessed global static 'Internal::StaticControl *s_instance()' after destruction. Defined at /builddir/build/BUILD/kdepimlibs-4.11.2/akonadi/control.cpp:74") at global/qglobal.cpp:2323
#11 0x4b3af62a in qt_message (msgType=msgType@entry=QtFatalMsg, msg=msg@entry=0x4fbe242c "Fatal Error: Accessed global static '%s *%s()' after destruction. Defined at %s:%d", ap=ap@entry=0xbfc52384 "\205\247\276Oz\247\276O\210\246\276OJ") at global/qglobal.cpp:2369
#12 0x4b3afbe9 in qFatal (msg=msg@entry=0x4fbe242c "Fatal Error: Accessed global static '%s *%s()' after destruction. Defined at %s:%d") at global/qglobal.cpp:2552
#13 0x4fadcc04 in operator-> (this=<optimized out>) at /usr/src/debug/kdepimlibs-4.11.2/akonadi/control.cpp:74
#14 Akonadi::Control::widgetNeedsAkonadi (widget=widget@entry=0x9c00e08) at /usr/src/debug/kdepimlibs-4.11.2/akonadi/control.cpp:263
#15 0x4311a8d7 in KMMainWidget::KMMainWidget (this=0x9c00e08, parent=0xa248f00, aGUIClient=0xa248f34, actionCollection=0x91cfa38, config=...) at /usr/src/debug/kdepim-4.11.2/kmail/kmmainwidget.cpp:250
#16 0x430653e1 in KMMainWin::KMMainWin (this=0xa248f00, __in_chrg=<optimized out>, __vtt_parm=<optimized out>) at /usr/src/debug/kdepim-4.11.2/kmail/kmmainwin.cpp:69
#17 0x430bcc6e in KMKernel::openReader (this=this@entry=0xbfc533b8, onlyCheck=onlyCheck@entry=false) at /usr/src/debug/kdepim-4.11.2/kmail/kmkernel.cpp:590
#18 0x430c38a8 in KMKernel::action (this=0xbfc533b8, mailto=mailto@entry=false, check=false, to=..., cc=..., bcc=..., subj=..., body=..., messageFile=..., attachURLs=..., customHeaders=..., replyTo=..., inReplyTo=...) at /usr/src/debug/kdepim-4.11.2/kmail/kmkernel.cpp:1401
#19 0x430c4387 in KMKernel::handleCommandLine (this=0xbfc533b8, noArgsOpensReader=noArgsOpensReader@entry=true) at /usr/src/debug/kdepim-4.11.2/kmail/kmkernel.cpp:506
#20 0x0804ad39 in KMailApplication::newInstance (this=0xbfc533a0) at /usr/src/debug/kdepim-4.11.2/kmail/main.cpp:87
#21 0x41df2250 in KUniqueApplicationAdaptor::newInstance (this=this@entry=0x94de760, asn_id=..., args=...) at /usr/src/debug/kdelibs-4.11.2/kdeui/kernel/kuniqueapplication.cpp:442
#22 0x41df2316 in KUniqueApplicationAdaptor::qt_static_metacall (_o=_o@entry=0x94de760, _id=_id@entry=0, _a=_a@entry=0xbfc52a0c, _c=QMetaObject::InvokeMetaMethod) at /usr/src/debug/kdelibs-4.11.2/i686-redhat-linux-gnu/kdeui/kuniqueapplication_p.moc:57
#23 0x41df25a4 in qt_static_metacall (_a=0xbfc52a0c, _id=0, _c=QMetaObject::InvokeMetaMethod, _o=0x94de760) at /usr/src/debug/kdelibs-4.11.2/i686-redhat-linux-gnu/kdeui/kuniqueapplication_p.moc:100
#24 KUniqueApplicationAdaptor::qt_metacall (this=0x94de760, _c=QMetaObject::InvokeMetaMethod, _id=0, _a=0xbfc52a0c) at /usr/src/debug/kdelibs-4.11.2/i686-redhat-linux-gnu/kdeui/kuniqueapplication_p.moc:101
#25 0x4af9e41e in QDBusConnectionPrivate::deliverCall (this=this@entry=0x9335c00, object=object@entry=0x94de760, msg=..., metaTypes=..., slotIdx=4) at qdbusintegrator.cpp:951
#26 0x4af9f84a in QDBusConnectionPrivate::activateCall (this=0x9335c00, object=0x94de760, flags=337, msg=...) at qdbusintegrator.cpp:863
#27 0x4af9fef1 in QDBusConnectionPrivate::activateObject (this=0x9335c00, node=..., msg=..., pathStartPos=22) at qdbusintegrator.cpp:1427
#28 0x4afa02f9 in QDBusActivateObjectEvent::placeMetaCall (this=0xa791c38) at qdbusintegrator.cpp:1541
#29 0x4b4f001b in QObject::event (this=this@entry=0xbfc533a0, e=e@entry=0xa791c38) at kernel/qobject.cpp:1194
#30 0x4b4da5bb in QCoreApplication::event (this=0xbfc533a0, e=0xa791c38) at kernel/qcoreapplication.cpp:1761
#31 0x4115a834 in QApplication::event (this=0xbfc533a0, e=0xa791c38) at kernel/qapplication.cpp:2544
#32 0x41155054 in QApplicationPrivate::notify_helper (this=0x9373e30, receiver=0xbfc533a0, e=0xa791c38) at kernel/qapplication.cpp:4562
#33 0x4115bfac in QApplication::notify (this=0xbfc533a0, receiver=0xbfc533a0, e=e@entry=0xa791c38) at kernel/qapplication.cpp:4348
#34 0x41de9d30 in KApplication::notify (this=0xbfc533a0, receiver=0xbfc533a0, event=0xa791c38) at /usr/src/debug/kdelibs-4.11.2/kdeui/kernel/kapplication.cpp:311
#35 0x4b4d5a76 in QCoreApplication::notifyInternal (this=0xbfc533a0, receiver=receiver@entry=0xbfc533a0, event=event@entry=0xa791c38) at kernel/qcoreapplication.cpp:949
#36 0x4b4d8eea in sendEvent (event=0xa791c38, receiver=0xbfc533a0) at kernel/qcoreapplication.h:231
#37 QCoreApplicationPrivate::sendPostedEvents (receiver=receiver@entry=0x0, event_type=event_type@entry=0, data=0x92851a0) at kernel/qcoreapplication.cpp:1573
#38 0x4b4d93ed in QCoreApplication::sendPostedEvents (receiver=receiver@entry=0x0, event_type=event_type@entry=0) at kernel/qcoreapplication.cpp:1466
#39 0x4b507e7f in sendPostedEvents () at kernel/qcoreapplication.h:236
#40 postEventSourceDispatch (s=s@entry=0x9374090) at kernel/qeventdispatcher_glib.cpp:280
#41 0x4b9cf546 in g_main_dispatch (context=0x9373fc0) at gmain.c:3065
#42 g_main_context_dispatch (context=context@entry=0x9373fc0) at gmain.c:3641
#43 0x4b9cf910 in g_main_context_iterate (context=context@entry=0x9373fc0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3712
#44 0x4b9cf9d9 in g_main_context_iteration (context=0x9373fc0, may_block=1) at gmain.c:3773
#45 0x4b507610 in QEventDispatcherGlib::processEvents (this=this@entry=0x9285f30, flags=...) at kernel/qeventdispatcher_glib.cpp:425
#46 0x4120b77c in QGuiEventDispatcherGlib::processEvents (this=0x9285f30, flags=...) at kernel/qguieventdispatcher_glib.cpp:207
#47 0x4b4d43b0 in QEventLoop::processEvents (this=this@entry=0xbfc53224, flags=...) at kernel/qeventloop.cpp:149
#48 0x4b4d4741 in QEventLoop::exec (this=0xbfc53224, flags=...) at kernel/qeventloop.cpp:204
#49 0x4ea12073 in KJob::exec (this=this@entry=0x9cac3d8) at /usr/src/debug/kdelibs-4.11.2/kdecore/jobs/kjob.cpp:210
#50 0x430bdd52 in KMKernel::cleanup (this=this@entry=0xbfc533b8) at /usr/src/debug/kdepim-4.11.2/kmail/kmkernel.cpp:1349
#51 0x0804a64c in main (argc=3, argv=0xbfc534f4) at /usr/src/debug/kdepim-4.11.2/kmail/main.cpp:148

The reporter indicates this bug may be a duplicate of or related to bug 303531.

Possible duplicates by query: bug 322491, bug 316179, bug 313684, bug 308545, bug 306435.

Reported using DrKonqi
Comment 1 Oleg 2013-10-03 19:04:07 UTC
Created attachment 82644 [details]
New crash information added by DrKonqi

kmail (4.11.2) on KDE Platform 4.11.2 using Qt 4.8.5

Kmail repeating crash at exitiing

-- Backtrace (Reduced):
#8  0x47dffba6 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#9  0x47e013e3 in __GI_abort () at abort.c:89
[...]
#13 0x4fadcc04 in operator-> (this=<optimized out>) at /usr/src/debug/kdepimlibs-4.11.2/akonadi/control.cpp:74
#14 Akonadi::Control::widgetNeedsAkonadi (widget=widget@entry=0xa1cd608) at /usr/src/debug/kdepimlibs-4.11.2/akonadi/control.cpp:263
#15 0x4311a8d7 in KMMainWidget::KMMainWidget (this=0xa1cd608, parent=0xb785590, aGUIClient=0xb7855c4, actionCollection=0xbfdcdb0, config=...) at /usr/src/debug/kdepim-4.11.2/kmail/kmmainwidget.cpp:250
Comment 2 Daniel Vrátil 2013-10-04 09:16:31 UTC
This is indeed a bug in KMail: it calls a code that depends on event loop from  KMKernel::cleanup(), which is invoked after the main event loop is destroyed (and QCoreApplication::aboutToQuit() is emitted). This hits an assert in KGlobalStatic in Akonadi::Control, but could trigger a bug anywhere. Starting a "nested" event loop after the main event loop is destroyed is IMO wrong - it should better be handled from KMailApplication destructor, or somewhere similar.
Comment 3 Oleg 2013-10-10 20:22:01 UTC
Created attachment 82776 [details]
New crash information added by DrKonqi

kmail (4.11.2) on KDE Platform 4.11.2 using Qt 4.8.5

Every time after KMail crashes and I tyr to restart it i got same error:
Fatal Error: Accessed global static '%s *%s()' after destruction. Defined at %s:%d

#12 0xb6fe9689 in qFatal (msg=msg@entry=0x42c8a42c "Fatal Error: Accessed global static '%s *%s()' after destruction. Defined at %s:%d") at global/qglobal.cpp:2552
#13 0x42b84c04 in operator-> (this=<optimized out>) at /usr/src/debug/kdepimlibs-4.11.2/akonadi/control.cpp:74
#14 Akonadi::Control::widgetNeedsAkonadi (widget=widget@entry=0x9b71068) at /usr/src/debug/kdepimlibs-4.11.2/akonadi/control.cpp:263

-- Backtrace (Reduced):
#8  0x48be4ba6 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#9  0x48be63e3 in __GI_abort () at abort.c:89
[...]
#13 0x42b84c04 in operator-> (this=<optimized out>) at /usr/src/debug/kdepimlibs-4.11.2/akonadi/control.cpp:74
#14 Akonadi::Control::widgetNeedsAkonadi (widget=widget@entry=0x9b71068) at /usr/src/debug/kdepimlibs-4.11.2/akonadi/control.cpp:263
#15 0x443098d7 in KMMainWidget::KMMainWidget (this=0x9b71068, parent=0xa0ecae8, aGUIClient=0xa0ecb1c, actionCollection=0xa380eb8, config=...) at /usr/src/debug/kdepim-4.11.2/kmail/kmmainwidget.cpp:250
Comment 4 Daniel Vrátil 2013-10-24 13:15:21 UTC
*** Bug 326562 has been marked as a duplicate of this bug. ***
Comment 5 Denis Kurz 2016-09-24 18:22:55 UTC
This bug has only been reported for versions before 4.14, which have been unsupported for at least two years now. Can anyone tell if this bug still present?

If noone confirms this bug for a Framework-based version of kmail2 (version 5.0 or later, as part of KDE Applications 15.12 or later), it gets closed in about three months.
Comment 6 Denis Kurz 2017-01-07 21:57:31 UTC
Just as announced in my last comment, I close this bug. If you encounter it again in a recent version (at least 5.0 aka 15.08), please open a new one unless it already exists. Thank you for all your input.