Bug 113885 - Crash while imap search (with BT)
Summary: Crash while imap search (with BT)
Status: RESOLVED FIXED
Alias: None
Product: kmail
Classification: Applications
Component: IMAP (show other bugs)
Version: 1.8.92
Platform: unspecified Linux
: NOR crash
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
: 114313 115810 124321 127370 131285 132672 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-10-05 12:34 UTC by Rolf Offermanns
Modified: 2007-09-14 12:17 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Backtrace with full debug enabled (6.03 KB, text/plain)
2005-10-05 12:35 UTC, Rolf Offermanns
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rolf Offermanns 2005-10-05 12:34:37 UTC
Version:           1.8.92 (using KDE 3.4.91 (beta1, >= 20050910), compiled sources)
Compiler:          Target: i486-linux-gnu
OS:                Linux (i686) release 2.6.12-1-686-smp

I did an search for message on my IMAP inbox (incl. subfolders). Then kontact crashed.

I will attach the backtrace.
Comment 1 Rolf Offermanns 2005-10-05 12:35:22 UTC
Created attachment 12861 [details]
Backtrace with full debug enabled
Comment 2 Tommi Tervo 2005-10-13 11:22:28 UTC
*** Bug 114313 has been marked as a duplicate of this bug. ***
Comment 3 Tommi Tervo 2006-07-24 11:05:16 UTC
*** Bug 131285 has been marked as a duplicate of this bug. ***
Comment 4 Tommi Tervo 2006-08-20 10:11:18 UTC
*** Bug 132672 has been marked as a duplicate of this bug. ***
Comment 5 Philip Rodrigues 2006-09-18 13:25:43 UTC
Pasting the backtrace:

#6  0xb55561a2 in KMFolderSearch::addSerNum (this=0x8e73770, serNum=0)
    at /home/rolf/kdesvn/kdepim/kmail/kmfoldersearch.cpp:432
#7  0xb555852f in KMFolderSearch::qt_invoke (this=0x8e73770, _id=17, 
    _o=0xbf8d1968) at kmfoldersearch.moc:293
#8  0xb6521037 in QObject::activate_signal (this=0x8dd34a8, clist=0x9264958, 
    o=0xbf8d1968) at kernel/qobject.cpp:2356
#9  0xb5553599 in KMSearch::found (this=0x8dd34a8, t0=0)
    at kmfoldersearch.moc:114
#10 0xb555783f in KMSearch::slotSearchFolderResult (this=0x8dd34a8, 
    folder=0x84404a0, serNums=@0xbf8d1a28, pattern=0x93f7e18, complete=true)
    at /home/rolf/kdesvn/kdepim/kmail/kmfoldersearch.cpp:273
#11 0xb5557a79 in KMSearch::qt_invoke (this=0x8dd34a8, _id=4, _o=0xbf8d1aac)
    at kmfoldersearch.moc:128
#12 0xb6521037 in QObject::activate_signal (this=0x84405a8, clist=0x938deb0, 
    o=0xbf8d1aac) at kernel/qobject.cpp:2356
#13 0xb53e642e in FolderStorage::searchResult (this=0x84405a8, t0=0x84404a0, 
    t1=@0xbf8d1b4c, t2=0x93f7e18, t3=true) at folderstorage.moc:431
#14 0xb54769c9 in KMFolderImap::slotSearchDone (this=0x84405a8, 
    serNums=@0xbf8d1be8, pattern=0x93f7e18, complete=true)
    at /home/rolf/kdesvn/kdepim/kmail/kmfolderimap.cpp:2196
#15 0xb547eab3 in KMFolderImap::qt_invoke (this=0x84405a8, _id=19, 
    _o=0xbf8d1c70) at kmfolderimap.moc:312
#16 0xb6521037 in QObject::activate_signal (this=0x935e648, clist=0x946e180, 
    o=0xbf8d1c70) at kernel/qobject.cpp:2356
#17 0xb55e3025 in KMail::SearchJob::searchDone (this=0x935e648, 
    t0=@0xbf8d1d1c, t1=0x93f7e18, t2=true) at searchjob.moc:137
#18 0xb55e4ffa in KMail::SearchJob::slotSearchFolder (this=0x935e648)
    at /home/rolf/kdesvn/kdepim/kmail/searchjob.cpp:225
#19 0xb55e5708 in KMail::SearchJob::qt_invoke (this=0x935e648, _id=2, 
    _o=0xbf8d1e14) at searchjob.moc:158
#20 0xb6521173 in QObject::activate_signal (this=0x84405a8, clist=0x84408e0, 
    o=0xbf8d1e14) at kernel/qobject.cpp:2380
Comment 6 Tommi Tervo 2006-11-01 10:50:07 UTC
*** Bug 127370 has been marked as a duplicate of this bug. ***
Comment 7 Magnus Holmgren 2006-11-01 11:25:03 UTC
I'd call this bug confirmed by now. :-)
Comment 8 Michael Seiwert 2006-11-01 11:37:05 UTC
so do I :-)
Comment 9 Stephan Kulow 2007-03-22 10:50:26 UTC
Yep, reproducible here.

kmail: serNumForUID: unknown uid 103547
kmail: serNumForUID: unknown uid 103555
kmail: serNumForUID: unknown uid 103589
kmail: serNumForUID: unknown uid 103590
kmail: serNumForUID: unknown uid 103592
kmail: serNumForUID: unknown uid 103593
kmail: serNumForUID: unknown uid 103601
kmail: serNumForUID: unknown uid 103603
kmail: serNumForUID: unknown uid 103634
kmail: serNumForUID: unknown uid 103637
kmail: serNumForUID: unknown uid 103650
kmail: [void KMSearch::slotSearchFolderResult(KMFolder*, QValueList<unsigned int>, const KMSearchPattern*, bool)] autobuild found 58
kmail: /suse/coolo/prod/kdesvn/kdepim/kmail/kmfoldersearch.cpp:436: void KMFolderSearch::addSerNum(Q_UINT32): Zusicherung »aFolder && (idx != -1)« nicht erfüllt.
Comment 10 Will Stephenson 2007-03-22 13:54:37 UTC
SVN commit 645363 by wstephens:

The check for unmatched UIDs also needs to be carried out after all the folders have been fetched, to exclude the possiblity that the local folder contents changed while the imap search was working.  This weeds out unmatched UIDs before passing the search results upwards.
BUG: 113885


 M  +6 -1      searchjob.cpp  


--- branches/KDE/3.5/kdepim/kmail/searchjob.cpp #645362:645363
@@ -222,7 +222,12 @@
     for ( QStringList::Iterator it = mImapSearchHits.begin(); 
         it != mImapSearchHits.end(); ++it ) 
     {
-      serNums.append( mFolder->serNumForUID( (*it).toULong() ) );
+      ulong serNum = mFolder->serNumForUID( (*it).toULong() );
+      // we need to check that the local folder does contain a message for this UID. 
+      // scenario: server responds with a list of UIDs.  While the search was running, filtering or bad juju moved a message locally
+      // serNumForUID will happily return 0 for the missing message, and KMFolderSearch::addSerNum() will fail its assertion.
+      if ( serNum != 0 ) 
+        serNums.append( serNum );
     }
     emit searchDone( serNums, mSearchPattern, true );
   } else {
Comment 11 Will Stephenson 2007-03-22 17:55:41 UTC
*** Bug 115810 has been marked as a duplicate of this bug. ***
Comment 12 Will Stephenson 2007-03-23 18:59:58 UTC
*** Bug 124321 has been marked as a duplicate of this bug. ***