Summary: | kmail crashes on startup with ASSERT: "s->parsed == false" in kdelibs4/kcmdlineargs.cpp | ||
---|---|---|---|
Product: | [Unmaintained] kmail | Reporter: | John Baldwin <jhb> |
Component: | general | Assignee: | kdepim bugs <kdepim-bugs> |
Status: | RESOLVED UNMAINTAINED | ||
Severity: | crash | CC: | brian.foster, broeksema, jtamate, kde, ruchir.brahmbhatt |
Priority: | NOR | Keywords: | triaged |
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | FreeBSD Ports | ||
OS: | FreeBSD | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
John Baldwin
2008-09-18 14:12:16 UTC
Looking at the kcmdlineargs.h header, it seems that kmail is following the documented procedure: * // Initialize command line args * KCmdLineArgs::init(argc, argv, appName, programName, version, description ); * * // Define the command line options using KCmdLineOptions * KCmdLineOptions options; * .... * * // Register the supported options * KCmdLineArgs::addCmdLineOptions( options ); * * // Add options from other components * KUniqueApplication::addCmdLineOptions(); main(): KCmdLineArgs::init(argc, argv, &about); KCmdLineArgs::addCmdLineOptions( kmail_options() ); // Add kmail options if (!KMailApplication::start()) return 0; and PimApplication::Start() trickles down to KUniqueApplication::Start() which calls KUniqueApplication::addCmdLineOptions(). The example in the header wouldn't set s->parsed = TRUE until later when KCmdLineArgs::parseAllArgs() is called, so I think the example code in the header would always trip this assert. I just realized that I had read the assertion backwards. The problem is that some code is forcing a parse of the command line options before KUniqueApplication::addCmdLineOptions() is called. I think this happens in PimApplication::start() where it fetches the program name (argv[0]) before calling KUniqueApplication::start(). So I set a few breakpoints and here is where the application arguments are parsed before KUniqueApplication::Start() is called: (gdb) where #0 KCmdLineArgsStatic::parseAllArgs () at /usr/ports/x11/kdelibs4/work/kdelibs-4.1.1/kdecore/kernel/kcmdlineargs.cpp:843 #1 0x2a04849b in KCmdLineArgs::saveAppArgs (ds=@0xbfbfe34c) at /usr/ports/x11/kdelibs4/work/kdelibs-4.1.1/kdecore/kernel/kcmdlineargs.cpp:533 #2 0x28c88369 in KPIM::PimApplication::start () at /usr/ports/deskutils/kdepim4/work/kdepim-4.1.1/libkdepim/pimapplication.cpp:73 #3 0x0804ab28 in main (argc=Error accessing memory address 0x0: Bad address. ) at /usr/ports/deskutils/kdepim4/work/kdepim-4.1.1/kmail/main.cpp:109 The problem with this bug is that it seem to occur when there is a dangling kmail dbus session. I think that is the *real* bug. The point is that I'm not able to reproduce that, although it just happened to me once also. What I had by then is still a kmail session registered to dbus. But when trying to browse the session using qdbusviewer it just froze qdbusviewer. However, when this does occur, the next thing happens when you try to start kmail (the problem is in libkdepim/pimapplication.cpp I think): Because their is a kmail session registered at dbus the test at line 70 will pass. Next the arguments are parsed at line 73, after this point it is not allowed to add more options to it. The problem starts when the test at line 93 fails and return KUniqueApplication::start(); gets called. Workarounds are: refuse to start when the test fails or call KUniqueApplication::addCmdLineOptions() before the saveAppArgs() call in line 73. But as said, these are just workarounds. Things were working just fine for me (using Kubuntu 8.10) and then all of a sudden I also got hit by this. At the moment, it's 100% reproducible simply by trying to run `kmail'. Some details.... Script started on Thu 19 Feb 2009 11:19:02 AM CET $ $ kmail --version Qt: 4.4.3 KDE: 4.1.4 (KDE 4.1.4) KMail: 1.10.4 $ $ gdb kmail GNU gdb 6.8-debian Copyright (C) 2008 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux-gnu"... (gdb) run Starting program: /usr/bin/kmail [Thread debugging using libthread_db enabled] [New Thread 0x7fa41531a6f0 (LWP 17746)] ASSERT: "s->parsed == false" in file /build/buildd/kde4libs-4.1.4/kdecore/kernel/kcmdlineargs.cpp, line 524 Program received signal SIGABRT, Aborted. [Switching to Thread 0x7fa41531a6f0 (LWP 17746)] 0x00007fa412218015 in raise () from /lib/libc.so.6 (gdb) where #0 0x00007fa412218015 in raise () from /lib/libc.so.6 #1 0x00007fa412219b83 in abort () from /lib/libc.so.6 #2 0x00007fa4136346b5 in qt_message_output () from /usr/lib/libQtCore.so.4 #3 0x00007fa4136347fd in qFatal () from /usr/lib/libQtCore.so.4 #4 0x00007fa413b17a3a in KCmdLineArgs::addCmdLineOptions (options=@0x7fff1d362720, name=@0x7fff1d3626e0, _id=<value optimized out>, _afterId=<value optimized out>) at /build/buildd/kde4libs-4.1.4/kdecore/kernel/kcmdlineargs.cpp:524 #5 0x00007fa414089bcf in KUniqueApplication::addCmdLineOptions () at /build/buildd/kde4libs-4.1.4/kdeui/kernel/kuniqueapplication.cpp:91 #6 0x00007fa414089e64 in KUniqueApplication::start (flags={i = 490089536}) at /build/buildd/kde4libs-4.1.4/kdeui/kernel/kuniqueapplication.cpp:118 #7 0x00007fa41408ad73 in KUniqueApplication::start () at /build/buildd/kde4libs-4.1.4/kdeui/kernel/kuniqueapplication.cpp:108 #8 0x00007fa414578087 in KPIM::PimApplication::start () at /build/buildd/kdepim-4.1.4/libkdepim/pimapplication.cpp:106 #9 0x0000000000402f25 in main (argc=<value optimized out>, argv=<value optimized out>) at /build/buildd/kdepim-4.1.4/kmail/main.cpp:109 (gdb) info proc process 17746 cmdline = '/usr/bin/kmail' cwd = '/home/bfoster' exe = '/usr/bin/kmail' (gdb) info thread * 1 Thread 0x7fa41531a6f0 (LWP 17746) 0x00007fa412218015 in raise () from /lib/libc.so.6 The program is running. Exit anyway? (y or n) y $ $ exit Script done on Thu 19 Feb 2009 11:20:35 AM CET I have the same error now (in linux). This is what I've done to get it hapen. I just created an imap account, and selected a message, I was waiting for the message to be displayed, while seeing thousands of lines: kmail(15778) KMFolderSearch::slotSearchExamineMsgDone: "inbox" : serNum 60274 matches? false Then I choosed Quit, and this is the console output. kmail(15778) KMail::ImapJob::slotGetMessageResult: Retrieved part "" kmail(15778) KMFolder::getMsg: getMsg idx 0 kmail(15778) KMail::MessageListView::Core::Model::viewItemJobStepInternal: FILLED THE VIEW AT 2.43125 MSG/SEC kmail(15778) KMail::ImapJob::slotGetMessageResult: Retrieved part "" kmail(15778) FolderStorage::headerOfMsgChanged: idx >=0 0 kmail(15778) FolderStorage::headerOfMsgChanged: emit msgHeaderChanged(folder(), idx) 0 kmail(15778) KMFolder::getMsg: getMsg idx 0 kmail(15778) KMail::MessageListView::Core::Model::viewItemJobStepInternal: FILLED THE VIEW AT 2.40833 MSG/SEC kmail(15778) KMKernel::getFolder: Folder not found: "/Local" kmail(15778) KMail::ImapJob::slotGetMessageResult: Retrieved part "" kmail(15778) KMFolder::getMsg: getMsg idx 0 kmail(15778) KMail::MessageListView::Core::Model::viewItemJobStepInternal: FILLED THE VIEW AT 2.3872 MSG/SEC kmail(15778) KMail::ImapJob::slotGetMessageResult: Retrieved part "" kmail(15778) FolderStorage::headerOfMsgChanged: idx >=0 0 kmail(15778) FolderStorage::headerOfMsgChanged: emit msgHeaderChanged(folder(), idx) 0 kmail(15778) KMFolder::getMsg: getMsg idx 0 kmail(15778) KMail::MessageListView::Core::Model::viewItemJobStepInternal: FILLED THE VIEW AT 2.36852 MSG/SEC kmail(15778) KMail::ImapJob::slotGetMessageResult: Retrieved part "" kmail(15778) FolderStorage::headerOfMsgChanged: idx >=0 0 kmail(15778) FolderStorage::headerOfMsgChanged: emit msgHeaderChanged(folder(), idx) 0 kmail(15778) KMFolder::getMsg: getMsg idx 0 kmail(15778) KMail::MessageListView::Core::Model::viewItemJobStepInternal: FILLED THE VIEW AT 2.34948 MSG/SEC kmail(15778) KMail::ImapJob::slotGetMessageResult: Retrieved part "" kmail(15778) FolderStorage::headerOfMsgChanged: idx >=0 0 kmail(15778) FolderStorage::headerOfMsgChanged: emit msgHeaderChanged(folder(), idx) 0 kmail(15778) KMFolder::getMsg: getMsg idx 0 kmail(15778) KMail::MessageListView::Core::Model::viewItemJobStepInternal: FILLED THE VIEW AT 2.33109 MSG/SEC kmail(15778) KMail::ImapJob::slotGetMessageResult: Retrieved part "" kmail(15778) FolderStorage::headerOfMsgChanged: idx >=0 0 kmail(15778) FolderStorage::headerOfMsgChanged: emit msgHeaderChanged(folder(), idx) 0 kmail(15778) KMFolder::getMsg: getMsg idx 0 kmail(15778) KMail::MessageListView::Core::Model::viewItemJobStepInternal: FILLED THE VIEW AT 2.31585 MSG/SEC kmail(15778) KMail::ImapJob::slotGetMessageResult: Retrieved part "" kmail(15778) FolderStorage::headerOfMsgChanged: idx >=0 0 kmail(15778) FolderStorage::headerOfMsgChanged: emit msgHeaderChanged(folder(), idx) 0 kmail(15778) KMFolder::getMsg: getMsg idx 0 kmail(15778) KMail::MessageListView::Core::Model::viewItemJobStepInternal: FILLED THE VIEW AT 2.3021 MSG/SEC kmail(15778) KMail::ImapJob::slotGetMessageResult: Retrieved part "" kmail(15778) KMFolder::getMsg: getMsg idx 0 kmail(15778) KMail::MessageListView::Core::Model::viewItemJobStepInternal: FILLED THE VIEW AT 2.28659 MSG/SEC kmail(15778) KMail::ImapJob::slotGetMessageResult: Retrieved part "" kmail(15778) KMFolder::getMsg: getMsg idx 0 kmail(15778) KMail::MessageListView::Core::Model::viewItemJobStepInternal: FILLED THE VIEW AT 2.27385 MSG/SEC kmail(15778) KMail::AccountManager::processNextCheck: processNextCheck, remaining 1 kmail(15778) KMail::NetworkAccount::mailCheckCanProceed: for host "imap.gmail.com" current connections= 0 and limit is 0 kmail(15778) KMail::NetworkAccount::mailCheckCanProceed: connection limit reached: false kmail(15778) KMail::AccountManager::processNextCheck: processing next mail check for "IMAP gmail" kmail(15778) KMail::NetworkAccount::setCheckingMail: check mail started - connections for host "imap.gmail.com" now is 1 kmail(15778) KMAcctImap::processNewMail: processNewMail true ,status= 1 kmail(15778) KMAcctImap::processNewMail: calling getFolder() when imapFolder->isSelected() kmail(15778) KMFolderImap::getFolder: 2 false 0 kmail(15778) KMFolderImap::checkValidity: Of: "/[Gmail]/Todos/" kmail(15778) KMail::MessageListView::StorageModel::releaseMessage: Trying to release a message at row 2723 that no longer exists in the folder kmail(15778) KMFolder::getMsg: getMsg idx 2723 kmail(15778)/kdeui (KIconEffect) KIconEffect::overlay: Image depth src ( 0 ) != overlay ( 32 )! kmail(15778)/kdeui (KIconEffect) KIconEffect::overlay: Image depth src ( 0 ) != overlay ( 32 )! kmail(15778)/kdeui (KIconEffect) KIconEffect::overlay: Image depth src ( 0 ) != overlay ( 32 )! kmail(15778)/kdeui (KIconEffect) KIconEffect::overlay: Image depth src ( 0 ) != overlay ( 32 )! kmail(15778)/kmail (storage internals) KMFolderIndex::writeIndex: KDE_fopen(tempName= "/home/jtorres/.kde/share/apps/kmail/imap/.529603476.directory/.INBOX.index.temp" , "w") == tmpIndexStream == 0x2e177f0 kmail(15778)/kmail (storage internals) KMFolderIndex::writeIndex: fclose(tmpIndexStream = 0x2e177f0 ) kmail(15778)/kmail (storage internals) KMFolderIndex::writeIndex: fclose(mIndexStream = 0xe4fd40 ) kmail(15778)/kmail (storage internals) KMFolderIndex::writeIndex: KDE_fopen(indexName= "/home/jtorres/.kde/share/apps/kmail/imap/.529603476.directory/.INBOX.index" , "r+") == mIndexStream == 0x100a4f0 kmail(15778) KMail::ImapJob::slotGetMessageResult: Retrieved part "" kmail(15778) KMFolder::getMsg: getMsg idx 0 kmail(15778) KMKernel::getFolder: Folder not found: "/Local" kmail(15778) KMKernel::getFolder: Folder not found: "/Local" kmail(15778) KMail::ImapJob::slotGetMessageResult: Retrieved part "" kmail(15778) FolderStorage::headerOfMsgChanged: idx >=0 0 kmail(15778) FolderStorage::headerOfMsgChanged: emit msgHeaderChanged(folder(), idx) 0 kmail(15778) KMFolder::getMsg: getMsg idx 0 kmail(15778) KMKernel::getFolder: Folder not found: "/Local" kmail(15778) KMail::ImapJob::slotGetMessageResult: Retrieved part "" kmail(15778) KMFolder::getMsg: getMsg idx 0 kmail(15778) KMail::ImapJob::slotGetMessageResult: Retrieved part "" kmail(15778) KMFolder::getMsg: getMsg idx 0 kmail(15778) KMail::ImapJob::slotGetMessageResult: Retrieved part "" kmail(15778) KMFolder::getMsg: getMsg idx 0 kmail(15778) KMail::ImapJob::slotGetMessageResult: Retrieved part "" kmail(15778) KMFolder::getMsg: getMsg idx 0 kmail(15778) KMail::ImapJob::slotGetMessageResult: Retrieved part "" kmail(15778) FolderStorage::headerOfMsgChanged: idx >=0 0 kmail(15778) FolderStorage::headerOfMsgChanged: emit msgHeaderChanged(folder(), idx) 0 kmail(15778) KMFolder::getMsg: getMsg idx 0 kmail(15778) KMail::ImapJob::slotGetMessageResult: Retrieved part "" kmail(15778) KMFolder::getMsg: getMsg idx 0 kmail(15778) KMKernel::getFolder: Folder not found: "/Local" kmail(15778) KMail::ImapJob::slotGetMessageResult: Retrieved part "" kmail(15778) FolderStorage::headerOfMsgChanged: idx >=0 0 kmail(15778) FolderStorage::headerOfMsgChanged: emit msgHeaderChanged(folder(), idx) 0 kmail(15778) KMFolder::getMsg: getMsg idx 0 kmail(15778) KMail::ImapJob::slotGetMessageResult: Retrieved part "" kmail(15778) FolderStorage::headerOfMsgChanged: idx >=0 0 kmail(15778) FolderStorage::headerOfMsgChanged: emit msgHeaderChanged(folder(), idx) 0 kmail(15778) KMFolder::getMsg: getMsg idx 0 kmail(15778) KMail::ImapJob::slotGetMessageResult: Retrieved part "" kmail(15778) FolderStorage::headerOfMsgChanged: idx >=0 0 kmail(15778) FolderStorage::headerOfMsgChanged: emit msgHeaderChanged(folder(), idx) 0 kmail(15778) KMFolder::getMsg: getMsg idx 0 kmail(15778) KMMainWin::~KMMainWin: Closing last KMMainWin: stopping mail check kmail(15778) KMAcctImap::killAllJobs: Resetting mail kmail(15778) KMAcctImap::killAllJobs: Resetting mail kmail(15778) KMAcctImap::killAllJobs: Resetting mail kmail(15778) KMAcctImap::killAllJobs: Resetting mail kmail(15778) KMAcctImap::killAllJobs: Resetting mail kmail(15778) KMAcctImap::killAllJobs: Resetting mail kmail(15778) KMAcctImap::killAllJobs: Resetting mail kmail(15778) KMAcctImap::killAllJobs: Resetting mail kmail(15778) KMAcctImap::killAllJobs: Resetting mail kmail(15778) KMAcctImap::killAllJobs: Resetting mail kmail(15778) KMAcctImap::killAllJobs: Resetting mail kmail(15778) KMAcctImap::killAllJobs: Resetting mail kmail(15778) KMAcctImap::killAllJobs: Resetting mail kmail(15778) KMAcctImap::killAllJobs: Resetting mail kmail(15778) KMAcctImap::killAllJobs: Resetting mail kmail(15778) KMAcctImap::killAllJobs: Resetting mail kmail(15778) KMAcctImap::killAllJobs: Resetting mail kmail(15778) KMAcctImap::killAllJobs: Resetting mail kmail(15778) KMAcctImap::killAllJobs: Resetting mail kmail(15778) KMAcctImap::killAllJobs: Resetting mail kmail(15778) KMAcctImap::killAllJobs: Resetting mail kmail(15778) KMAcctImap::killAllJobs: Resetting mail kmail(15778) KMAcctImap::killAllJobs: Resetting mail kmail(15778) KMAcctImap::killAllJobs: Resetting mail kmail(15778) KMAcctImap::killAllJobs: Resetting mail kmail(15778) KMAcctImap::killAllJobs: Resetting mail kmail(15778) KMAcctImap::killAllJobs: Resetting mail kmail(15778) KMAcctImap::killAllJobs: Resetting mail kmail(15778) KMAcctImap::killAllJobs: Resetting mail kmail(15778) KMAcctImap::killAllJobs: Resetting mail kmail(15778) KMAcctImap::killAllJobs: Resetting mail kmail(15778) KMAcctImap::killAllJobs: Resetting mail kmail(15778) KMAcctImap::killAllJobs: Resetting mail kmail(15778) KMAcctImap::killAllJobs: Resetting mail kmail(15778) KMAcctImap::killAllJobs: Resetting mail kmail(15778) KMAcctImap::killAllJobs: Resetting mail kmail(15778) KMAcctImap::killAllJobs: Resetting mail kmail(15778)/kio (Slave) KIO::Slave::kill: killing slave pid 16192 ( "imaps://imap.gmail.com" ) kmail(15778) KMFolderImap::slotCopyMsgResult: 1 kmail(15778) KMFolderImap::slotCopyMsgResult: 1 kmail(15778) KMFolderImap::slotCopyMsgResult: 1 kmail(15778) KMFolderImap::slotCopyMsgResult: 1 kmail(15778) KMFolderImap::slotCopyMsgResult: 1 kmail(15778) KMFolderImap::slotCopyMsgResult: 1 kmail(15778) KMFolderImap::slotCopyMsgResult: 1 kmail(15778) KMFolderImap::slotCopyMsgResult: 1 kmail(15778) KMFolderImap::slotCopyMsgResult: 1 kmail(15778) KMFolderImap::slotCopyMsgResult: 1 kmail(15778) KMFolderImap::slotCopyMsgResult: 1 kmail(15778) KMFolderImap::slotCopyMsgResult: 1 kmail(15778) KMFolderImap::slotCopyMsgResult: 1 kmail(15778) KMFolderImap::slotCopyMsgResult: 1 kmail(15778) KMFolderImap::slotCopyMsgResult: 1 kmail(15778) KMFolderImap::slotCopyMsgResult: 1 kmail(15778) KMFolderImap::slotCopyMsgResult: 1 kmail(15778) KMFolderImap::slotCopyMsgResult: 1 kmail(15778) KMFolderImap::slotCopyMsgResult: 1 kmail(15778) KMFolderImap::slotCopyMsgResult: 1 kmail(15778) KMFolderImap::slotCopyMsgResult: 1 kmail(15778) KMail::NetworkAccount::setCheckingMail: connections to server "imap.gmail.com" now 0 kmail(15778) KMail::AccountManager::processNextCheck: processNextCheck, remaining 0 kmail(15778) KMail::AccountManager::processNextCheck: account "IMAP gmail" finished check kmail(15778) KMail::AccountManager::processNextCheck: processNextCheck, remaining 1 kmail(15778) KMail::NetworkAccount::mailCheckCanProceed: for host "imap.gmail.com" current connections= 0 and limit is 0 kmail(15778) KMail::NetworkAccount::mailCheckCanProceed: connection limit reached: false kmail(15778) KMail::AccountManager::processNextCheck: processing next mail check for "IMAP gmail" kmail(15778) KMail::NetworkAccount::setCheckingMail: check mail started - connections for host "imap.gmail.com" now is 1 kmail(15778)/kio (Slave) KIO::Slave::createSlave: createSlave "imaps" for KUrl("imaps://jtamate%40gmail.com@imap.gmail.com:993") kmail(15778)/kio (KIOConnection) KIO::ConnectionServer::listenForRemote: Listening on "local:/tmp/ksocket-jtorres/kmailT15778.slave-socket" kmail(15778) KMAcctImap::processNewMail: processNewMail true ,status= 2 kmail(15778) KMAcctImap::processNewMail: calling getFolder() when imapFolder->isSelected() kmail(15778) KMFolderImap::getFolder: 2 false 3 kmail(15778) KMFolderImap::checkValidity: Of: "/[Gmail]/Destacados/" kmail(15778) KMFolderImap::checkValidity: Waiting for connection kmail(15778)/kparts KParts::Part::slotWidgetDestroyed: KPart::slotWidgetDestroyed(), deleting part "mViewer" kmail(15778)/khtml (part) KHTMLPart::~KHTMLPart: KHTMLPart(0x9965e0, name = "mViewer") kmail(15778) KMail::Vacation::~Vacation: ~Vacation() As kmail did not wanted to die.. kill it. jtorres@filemon:/g/kde4svn> jtorres@filemon:/g/kde4svn> jtorres@filemon:/g/kde4svn> jtorres@filemon:/g/kde4svn> ps PID TTY TIME CMD 4770 pts/7 00:00:00 bash 15778 pts/7 00:04:39 kmail 18204 pts/7 00:00:00 ps jtorres@filemon:/g/kde4svn> kill 15778 jtorres@filemon:/g/kde4svn> *** KMail got signal 15 (Exiting) jtorres@filemon:/g/kde4svn> jtorres@filemon:/g/kde4svn> jtorres@filemon:/g/kde4svn> jtorres@filemon:/g/kde4svn> jtorres@filemon:/g/kde4svn> /opt/kde4/bin/kmail ASSERT: "s->parsed == false" in file /g/kde4svn/kdelibs/kdecore/kernel/kcmdlineargs.cpp, line 528 Abortado jtorres@filemon:/g/kde4svn> jtorres@filemon:/g/kde4svn> /opt/kde4/bin/kmail ASSERT: "s->parsed == false" in file /g/kde4svn/kdelibs/kdecore/kernel/kcmdlineargs.cpp, line 528 Abortado Is it still reproducible? I can't reproduce bug on kmail 1.11.2 as mentioned by reporter or any other methods mentioned in comments > Is it still reproducible? I can't reproduce bug on kmail 1.11.2 as mentioned by reporter or any other methods mentioned in comments
Yes, it is a known race condition,
i still have this from time to time in kde 4.4.2 Thank you for your report. Kmail1 is currently unmaintained and the code has changed sufficiently in Kmail2 so the backtraces are not really useful anymore. Should you experience the same crash in Kmail 4.8.5 or later, please open a new report for Kmail2. Thank you for your understanding |