Summary: | crashes whenever sending or queing mail | ||
---|---|---|---|
Product: | kab3 | Reporter: | John Firebaugh <jfirebaugh> |
Component: | general | Assignee: | Tobias Koenig <tokoe> |
Status: | RESOLVED UNMAINTAINED | ||
Severity: | critical | CC: | ismail |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: |
Description
John Firebaugh
2003-04-14 08:12:00 UTC
Subject: Re: New: crashes whenever sending or queing mail
On Monday 14 April 2003 08:12, John Firebaugh wrote:
> #5 0x081a004c in KabcBridge::expandDistributionLists(QString)
> (recipients= {static null = {static null = <same as static member of
> an already seen type>, d = 0x8321858, static shared_null =
> 0x8321858}, d = 0x8498948, static shared_null = 0x8321858}) at
> /home/john/src/kde/kdepim/kmail/kmaddrbook.cpp:101
Corresponding lines:
099 KABC::AddressBook *addressBook = KABC::StdAddressBook::self();
100 KABC::DistributionListManager manager( addressBook );
101 manager.load();
Do you get any useful debug messages (like missing symbols)?
As nothing changed in kmaddrbook.cpp since March 20 (and the changes
back then were completely unrelated) this is either a bug in
kdelibs/kdecore/kabc or an installation problem.
Debug output: kmail: -- /usr/local/kde/share/apps/kresources/contact/file.desktop kmail: -- /usr/local/kde/share/apps/kresources/contact/dir.desktop kmail: ResourceManagerImpl(): config: kabcrc kmail: ResourceManagerImpl::loadResource() e2ULqmjpJ kio (KDirWatch): WARNING: KDirWatch::removeDir can't handle '' kmail: ResourceManagerImpl::loadResource() DlEmFNQAa kio (KDirWatch): WARNING: KDirWatch::removeDir can't handle '' *** KMail got signal 11 (Crashing) Total: 1; NUL: 0; CTL: 0; CR: 0; LF: 1; CRLF: 0; lineMin: 0; lineMax: 0; printable: 0; eightBit: 0; trailing whitespace: no; leading 'From ': no; Total: 1; NUL: 0; CTL: 0; CR: 0; LF: 1; CRLF: 0; lineMin: 0; lineMax: 0; printable: 0; eightBit: 0; trailing whitespace: no; leading 'From ': no; appending message to ~/dead.letter.tmp GDB output: Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 16384 (LWP 23315)] 0x405d8cb5 in KABC::DistributionListManager::load() (this=0xbfffea40) at /home/john/src/kde/kdelibs/kabc/distributionlist.cpp:166 166 QMap<QString,QString> entryMap = cfg.entryMap( mAddressBook->identifier() ); (gdb) bt #0 0x405d8cb5 in KABC::DistributionListManager::load() (this=0xbfffea40) at /home/john/src/kde/kdelibs/kabc/distributionlist.cpp:166 #1 0x081a004c in KabcBridge::expandDistributionLists(QString) (recipients= {static null = {static null = <same as static member of an already seen type>, d = 0x8321858, static shared_null = 0x8321858}, d = 0x8487908, static shared_null = 0x8321858}) at /home/john/src/kde/kdepim/kmail/kmaddrbook.cpp:101 #2 0x08131d4a in KMComposeWin::doSend(int, bool) (this=0x83bc0e8, aSendNow=1, saveInDrafts=false) at /home/john/src/kde/kdepim/kmail/kmcomposewin.cpp:4697 valgrind output: ==3931== ==3931== Invalid read of size 4 ==3931== at 0x407C8CB5: KABC::DistributionListManager::load() (/home/john/src/kde/kdelibs/kabc/distributionlist.cpp:166) ==3931== by 0x81A004B: KabcBridge::expandDistributionLists(QString) (/home/john/src/kde/kdepim/kmail/kmaddrbook.cpp:101) ==3931== by 0x8131D49: KMComposeWin::doSend(int, bool) (/home/john/src/kde/kdepim/kmail/kmcomposewin.cpp:4697) ==3931== by 0x813264D: KMComposeWin::slotSendNow() (/home/john/src/kde/kdepim/kmail/kmcomposewin.cpp:4778) ==3931== Address 0x0 is not stack'd, malloc'd or free'd *** KMail got signal 11 (Crashing) I see this on cvs-head too. It was ok 1 day ago so it could be kabc to blame. Ok, this is really bizzare. The problem is kabc/stdaddressbook.cpp:63. Somehow the call to the overloaded template function KStaticDeleter::setObject is resolving to the two-argument version -- in other words, the result of 'new StdAddressBook' is being cast to a bool (!). We want the three-argument version of setObject with the default parameter for the last argument. Compiler bug, or weird template name lookup problem? Anyone familiar enough with the C++ lookup rules to know? To answer my own question: The static deleter is declared as: StdAddressBook *StdAddressBook::mSelf = 0; // ... static KStaticDeleter<AddressBook> addressBookDeleter; The problem is that StdAddressBook*& can be converted to AddressBook*, but not to AddressBook*&. (Exercise for the reader: why not? The answer is quite subtle.) Strange that StdAddressBook*& can be converted to bool though... Anyway the fix is to declare the static deleter as: static KStaticDeleter<StdAddressBook> addressBookDeleter; Subject: kdelibs/kabc CVS commit by firebaugh: Fix declaration of KStaticDeleter that led to wrong name lookup and hence crashes. Authors of KStatic deleter should look at this: KStaticDeleter::setObject() is overloaded in a dangerous way. CCMAIL:57205-done@bugs.kde.org M +1 -1 stdaddressbook.cpp 1.51 --- kdelibs/kabc/stdaddressbook.cpp #1.50:1.51 @@ -39,5 +39,5 @@ StdAddressBook *StdAddressBook::mSelf = bool StdAddressBook::mAutomaticSave = true; -static KStaticDeleter<AddressBook> addressBookDeleter; +static KStaticDeleter<StdAddressBook> addressBookDeleter; QString StdAddressBook::fileName() The development of the old KAddressBook will be discontinued for KDE 4.4. Since the new application has the same name, but a completly new code base we close all bug reports against the old version and ask the submitters to resend there reports against the new product. |