[Kde-pim] Missing virtual destructor, and question about embedded message composition
Shaheed Haque
srhaque at theiet.org
Wed Jan 11 21:26:15 GMT 2012
Hi all,
I'm having a little trouble in trying to add support for embedded
message/rfc822 attachments in the playground Exchange resource. Basically, I
- start with a top level KMime::message
- create a second level KMime:Message
- secondLevel.assemble()
- topLevel.addContent(secondLevel)
- topLevel.assemble()
However, shortly afterwards, as Akonadi::ItemModifyJob is being destroyed,
the code craps out as per the stack trace below. Two points arise:
1. In looking at the code in GIT, I notice that KMime::Message::~Message is
not virtual, whereas KMime::~Content from which it derives is virtual.
Should that be fixed (or is there some BC implication?)
2. It is not clear to me if the above recipie is correct, or if I have
missed something. Can somebody point out how embedded messages are supposed
to work?
Thanks, Shaheed
#6 0x00007fd77f3b83a5 in __GI_raise (sig=6) at
../nptl/sysdeps/unix/sysv/linux/raise.c:64
#7 0x00007fd77f3bbb0b in __GI_abort () at abort.c:92
#8 0x00007fd77f3f0113 in __libc_message (do_abort=2, fmt=0x7fd77f4e10d8
"*** glibc detected *** %s: %s: 0x%s ***\n") at
../sysdeps/unix/sysv/linux/libc_fatal.c:189
#9 0x00007fd77f3faa96 in malloc_printerr (action=3, str=0x7fd77f4e1258
"double free or corruption (out)", ptr=<optimized out>) at malloc.c:6283
#10 0x00007fd77f3fed7c in __GI___libc_free (mem=<optimized out>) at
malloc.c:3738
#11 0x00007fd7821384fa in
qDeleteAll<QList<KMime::Content*>::const_iterator> (end=<optimized out>,
begin=<optimized out>) at /usr/include/qt4/QtCore/qalgorithms.h:322
#12 qDeleteAll<QList<KMime::Content*> > (c=...) at
/usr/include/qt4/QtCore/qalgorithms.h:330
#13 ~ContentPrivate (this=0x24f7f90, __in_chrg=<optimized out>) at
../../kmime/kmime_content_p.h:48
#14 ~MessagePrivate (this=0x24f7f90, __in_chrg=<optimized out>) at
../../kmime/kmime_message_p.h:29
#15 KMime::MessagePrivate::~MessagePrivate (this=0x24f7f90,
__in_chrg=<optimized out>) at ../../kmime/kmime_message_p.h:29
#16 0x00007fd78211db49 in KMime::Content::~Content (this=0x24600f0,
__in_chrg=<optimized out>) at ../../kmime/kmime_content.cpp:95
#17 0x000000000040e162 in MapiNote::~MapiNote (this=0x2460070,
__in_chrg=<optimized out>) at
/home/srhaque/akonadi/exchange/mail/exmailresource.cpp:513
#18 0x000000000040e609 in MapiNote::~MapiNote (this=0x2460070,
__in_chrg=<optimized out>) at
/home/srhaque/akonadi/exchange/mail/exmailresource.cpp:520
#19 0x00000000004143fa in release (this=0x245d3d0) at
/usr/include/boost/smart_ptr/detail/sp_counted_base_gcc_x86.hpp:145
#20 ~shared_count (this=0x247b5f0, __in_chrg=<optimized out>) at
/usr/include/boost/smart_ptr/detail/shared_count.hpp:217
#21 ~shared_ptr (this=0x247b5e8, __in_chrg=<optimized out>) at
/usr/include/boost/smart_ptr/shared_ptr.hpp:168
#22 ~Payload (this=0x247b5e0, __in_chrg=<optimized out>) at
/usr/include/akonadi/itempayloadinternals_p.h:285
#23 Akonadi::Payload<boost::shared_ptr<KMime::Message> >::~Payload
(this=0x247b5e0, __in_chrg=<optimized out>) at
/usr/include/akonadi/itempayloadinternals_p.h:285
#24 0x00007fd78246a776 in ~clone_ptr (this=0x247bfc0, __in_chrg=<optimized
out>) at ../../akonadi/item_p.h:48
#25 ~TypedPayload (this=0x247bfc0, __in_chrg=<optimized out>) at
../../akonadi/item_p.h:119
#26 _Destroy<Akonadi::_detail::TypedPayload> (__pointer=0x247bfc0) at
/usr/include/c++/4.6/bits/stl_construct.h:94
#27 __destroy<Akonadi::_detail::TypedPayload*> (__last=<optimized out>,
__first=<optimized out>) at /usr/include/c++/4.6/bits/stl_construct.h:104
#28 _Destroy<Akonadi::_detail::TypedPayload*> (__last=<optimized out>,
__first=<optimized out>) at /usr/include/c++/4.6/bits/stl_construct.h:127
#29 _Destroy<Akonadi::_detail::TypedPayload*,
Akonadi::_detail::TypedPayload> (__last=0x247bfd0, __first=<optimized out>)
at /usr/include/c++/4.6/bits/stl_construct.h:153
#30 ~vector (this=0x25594f8, __in_chrg=<optimized out>) at
/usr/include/c++/4.6/bits/stl_vector.h:350
#31 ~ItemPrivate (this=0x25594b0, __in_chrg=<optimized out>) at
../../akonadi/item_p.h:203
#32 Akonadi::ItemPrivate::~ItemPrivate (this=0x25594b0,
__in_chrg=<optimized out>) at ../../akonadi/item_p.h:204
#33 0x00007fd7823ca8cc in node_destruct (to=0x242f558, from=0x242f558,
this=<optimized out>) at /usr/include/qt4/QtCore/qlist.h:418
#34 QList<Akonadi::Item>::free (data=0x242f540, this=<optimized out>) at
/usr/include/qt4/QtCore/qlist.h:744
#35 0x00007fd782481ee0 in ~ItemModifyJobPrivate (this=0x2559740,
__in_chrg=<optimized out>) at ../../akonadi/itemmodifyjob_p.h:30
#36 Akonadi::ItemModifyJobPrivate::~ItemModifyJobPrivate (this=0x2559740,
__in_chrg=<optimized out>) at ../../akonadi/itemmodifyjob_p.h:30
#37 0x00007fd782486219 in Akonadi::Job::~Job (this=0x24e8c10,
__in_chrg=<optimized out>) at ../../akonadi/job.cpp:254
#38 0x00007fd78247de99 in Akonadi::ItemModifyJob::~ItemModifyJob
(this=0x24e8c10, __in_chrg=<optimized out>) at
../../akonadi/itemmodifyjob.cpp:134
...
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/
More information about the kde-pim
mailing list