Bug 287177

Summary: KMail crashes when deleting an Attachment
Product: [Applications] kmail2 Reporter: Johannes Obermayr <johannesobermayr>
Component: generalAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED UNMAINTAINED    
Severity: crash CC: laurent.rineau, mgolden, montel, winter
Priority: NOR    
Version: 4.8   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In: 4.7.4
Sentry Crash Report:
Attachments: New crash information added by DrKonqi
New crash information added by DrKonqi
New crash information added by DrKonqi
New crash information added by DrKonqi
New crash information added by DrKonqi
New crash information added by DrKonqi
New crash information added by DrKonqi
New crash information added by DrKonqi
New crash information added by DrKonqi
New crash information added by DrKonqi

Description Johannes Obermayr 2011-11-21 16:03:00 UTC
Application: kmail (4.8 pre)
KDE Platform Version: 4.7.3 (4.7.3) "release 1"
Qt Version: 4.7.4
Operating System: Linux 3.1.0-1.2-desktop x86_64
Distribution (Platform): openSUSE RPMs

-- Information about the crash:
1. &RMB; -> "Show Message Structure"

2. Choose one body part

3. &RMB; -> "Delete Attachment"

4. "Delete"

5. Crash

The crash can be reproduced every time.

-- Backtrace:
Application: KMail (kmail), signal: Segmentation fault
[Current thread is 1 (Thread 0x7fbcd6ab4760 (LWP 4414))]

Thread 3 (Thread 0x7fbcba10a700 (LWP 4417)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:162
#1  0x00007fbcc82c49dc in WTF::TCMalloc_PageHeap::scavengerThread (this=0x7fbcc8c7b200) at ../../../Source/JavaScriptCore/wtf/FastMalloc.cpp:2495
#2  0x00007fbcc82c4b09 in WTF::TCMalloc_PageHeap::runScavengerThread (context=<optimized out>) at ../../../Source/JavaScriptCore/wtf/FastMalloc.cpp:1618
#3  0x00007fbcd1c5ff05 in start_thread (arg=0x7fbcba10a700) at pthread_create.c:301
#4  0x00007fbcd3e6e53d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:115

Thread 2 (Thread 0x7fbcb97f1700 (LWP 4418)):
#0  0x00007fbcd3e65423 in __GI___poll (fds=<optimized out>, nfds=<optimized out>, timeout=<optimized out>) at ../sysdeps/unix/sysv/linux/poll.c:87
#1  0x00007fbccc002a98 in g_main_context_poll (n_fds=1, fds=0x802d00, timeout=5501, context=0x976aa0, priority=<optimized out>) at gmain.c:3386
#2  g_main_context_iterate (context=0x976aa0, block=<optimized out>, dispatch=1, self=<optimized out>) at gmain.c:3068
#3  0x00007fbccc002f59 in g_main_context_iteration (context=0x976aa0, may_block=1) at gmain.c:3136
#4  0x00007fbcd5470576 in QEventDispatcherGlib::processEvents (this=0x7f9860, flags=<optimized out>) at kernel/qeventdispatcher_glib.cpp:424
#5  0x00007fbcd5444a22 in QEventLoop::processEvents (this=<optimized out>, flags=...) at kernel/qeventloop.cpp:149
#6  0x00007fbcd5444c1f in QEventLoop::exec (this=0x7fbcb97f0e20, flags=...) at kernel/qeventloop.cpp:201
#7  0x00007fbcd535c5df in QThread::exec (this=<optimized out>) at thread/qthread.cpp:498
#8  0x00007fbcd535f025 in QThreadPrivate::start (arg=0x7c8c30) at thread/qthread_unix.cpp:331
#9  0x00007fbcd1c5ff05 in start_thread (arg=0x7fbcb97f1700) at pthread_create.c:301
#10 0x00007fbcd3e6e53d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:115

Thread 1 (Thread 0x7fbcd6ab4760 (LWP 4414)):
[KCrash Handler]
#6  begin (this=0x10000003f) at /usr/include/QtCore/qlist.h:861
#7  QList<KMime::Content*>::contains (this=0x10000003f, t=@0x7fff717f7b48) at /usr/include/QtCore/qlist.h:863
#8  0x00007fbcd08638dc in KMime::Content::removeContent (this=0xe4a9e0, c=0x14de080, del=true) at /usr/src/debug/kdepimlibs-4.7.46/kmime/kmime_content.cpp:566
#9  0x00007fbccd2332a3 in MessageViewer::ViewerPrivate::deleteAttachment (this=0x9da900, node=0x14de080, showWarning=<optimized out>) at /usr/src/debug/kdepim-4.7.46/messageviewer/viewer_p.cpp:407
#10 0x00007fbccd240847 in MessageViewer::ViewerPrivate::slotAttachmentDelete (this=0x9da900) at /usr/src/debug/kdepim-4.7.46/messageviewer/viewer_p.cpp:2374
#11 0x00007fbccd2438ed in MessageViewer::ViewerPrivate::qt_metacall (this=0x9da900, _c=QMetaObject::InvokeMetaMethod, _id=55, _a=0x7fff717f7e70) at /usr/src/debug/kdepim-4.7.46/build/messageviewer/viewer_p.moc:254
#12 0x00007fbcd545859a in QMetaObject::activate (sender=0x1265e40, m=<optimized out>, local_signal_index=<optimized out>, argv=0x7fff717f7e70) at kernel/qobject.cpp:3287
#13 0x00007fbcd480e5d2 in QAction::triggered (this=<optimized out>, _t1=false) at .moc/release-shared/moc_qaction.cpp:263
#14 0x00007fbcd480e7bf in QAction::activate (this=0x1265e40, event=<optimized out>) at kernel/qaction.cpp:1257
#15 0x00007fbcd4c44969 in QMenuPrivate::activateCausedStack (this=0x1741ff0, causedStack=..., action=0x1265e40, action_e=QAction::Trigger, self=true) at widgets/qmenu.cpp:1005
#16 0x00007fbcd4c4a5a2 in QMenuPrivate::activateAction (this=0x1741ff0, action=0x1265e40, action_e=QAction::Trigger, self=true) at widgets/qmenu.cpp:1097
#17 0x00007fbcd6582f50 in KMenu::mouseReleaseEvent (this=0x7fff717f9740, e=0x7fff717f8a40) at /usr/src/debug/kdelibs-4.7.46/kdeui/widgets/kmenu.cpp:464
#18 0x00007fbcd48652b6 in QWidget::event (this=0x7fff717f9740, event=0x7fff717f8a40) at kernel/qwidget.cpp:8295
#19 0x00007fbcd4c4bb0b in QMenu::event (this=0x7fff717f9740, e=0x7fff717f8a40) at widgets/qmenu.cpp:2405
#20 0x00007fbcd4814be4 in notify_helper (e=0x7fff717f8a40, receiver=0x7fff717f9740, this=0x65da70) at kernel/qapplication.cpp:4481
#21 QApplicationPrivate::notify_helper (this=0x65da70, receiver=0x7fff717f9740, e=0x7fff717f8a40) at kernel/qapplication.cpp:4453
#22 0x00007fbcd481a36b in QApplication::notify (this=<optimized out>, receiver=0x7fff717f9740, e=0x7fff717f8a40) at kernel/qapplication.cpp:4042
#23 0x00007fbcd64c1046 in KApplication::notify (this=0x7fff717fb5c0, receiver=0x7fff717f9740, event=0x7fff717f8a40) at /usr/src/debug/kdelibs-4.7.46/kdeui/kernel/kapplication.cpp:311
#24 0x00007fbcd544581c in QCoreApplication::notifyInternal (this=0x7fff717fb5c0, receiver=0x7fff717f9740, event=0x7fff717f8a40) at kernel/qcoreapplication.cpp:787
#25 0x00007fbcd4815bb2 in sendEvent (event=<optimized out>, receiver=<optimized out>) at ../../src/corelib/kernel/qcoreapplication.h:215
#26 QApplicationPrivate::sendMouseEvent (receiver=0x7fff717f9740, event=0x7fff717f8a40, alienWidget=0x0, nativeWidget=0x7fff717f9740, buttonDown=0x0, lastMouseReceiver=..., spontaneous=true) at kernel/qapplication.cpp:3141
#27 0x00007fbcd4892201 in QETWidget::translateMouseEvent (this=0x7fff717f9740, event=<optimized out>) at kernel/qapplication_x11.cpp:4406
#28 0x00007fbcd4890a2a in QApplication::x11ProcessEvent (this=0x7fff717fb5c0, event=0x7fff717f9300) at kernel/qapplication_x11.cpp:3598
#29 0x00007fbcd48b82a2 in x11EventSourceDispatch (s=0x660450, callback=0, user_data=0x0) at kernel/qguieventdispatcher_glib.cpp:146
#30 0x00007fbccc00258d in g_main_dispatch (context=0x65d6c0) at gmain.c:2425
#31 g_main_context_dispatch (context=0x65d6c0) at gmain.c:2995
#32 0x00007fbccc002d88 in g_main_context_iterate (context=0x65d6c0, block=<optimized out>, dispatch=1, self=<optimized out>) at gmain.c:3073
#33 0x00007fbccc002f59 in g_main_context_iteration (context=0x65d6c0, may_block=1) at gmain.c:3136
#34 0x00007fbcd547050f in QEventDispatcherGlib::processEvents (this=0x60b8d0, flags=<optimized out>) at kernel/qeventdispatcher_glib.cpp:422
#35 0x00007fbcd48b7f2e in QGuiEventDispatcherGlib::processEvents (this=<optimized out>, flags=<optimized out>) at kernel/qguieventdispatcher_glib.cpp:204
#36 0x00007fbcd5444a22 in QEventLoop::processEvents (this=<optimized out>, flags=...) at kernel/qeventloop.cpp:149
#37 0x00007fbcd5444c1f in QEventLoop::exec (this=0x7fff717f96d0, flags=...) at kernel/qeventloop.cpp:201
#38 0x00007fbcd4c47a81 in QMenu::exec (this=<optimized out>, p=..., action=0x0) at widgets/qmenu.cpp:2049
#39 0x00007fbccd22f9cb in MessageViewer::ViewerPrivate::showContextMenu (this=0x9da900, content=0x14de080, pos=...) at /usr/src/debug/kdepim-4.7.46/messageviewer/viewer_p.cpp:1661
#40 0x00007fbccd230d70 in MessageViewer::ViewerPrivate::slotMimeTreeContextMenuRequested (this=0x9da900, pos=...) at /usr/src/debug/kdepim-4.7.46/messageviewer/viewer_p.cpp:2258
#41 0x00007fbccd243871 in MessageViewer::ViewerPrivate::qt_metacall (this=0x9da900, _c=QMetaObject::InvokeMetaMethod, _id=47, _a=0x7fff717f9c40) at /usr/src/debug/kdepim-4.7.46/build/messageviewer/viewer_p.moc:246
#42 0x00007fbcd545859a in QMetaObject::activate (sender=0x977d20, m=<optimized out>, local_signal_index=<optimized out>, argv=0x7fff717f9c40) at kernel/qobject.cpp:3287
#43 0x00007fbcd485b982 in QWidget::customContextMenuRequested (this=<optimized out>, _t1=<optimized out>) at .moc/release-shared/moc_qwidget.cpp:360
#44 0x00007fbcd4865c51 in QWidget::event (this=0x977d20, event=0x7fff717fa840) at kernel/qwidget.cpp:8465
#45 0x00007fbcd4c09716 in QFrame::event (this=0x977d20, e=0x7fff717fa840) at widgets/qframe.cpp:557
#46 0x00007fbcd4d19adb in QAbstractItemView::viewportEvent (this=0x977d20, event=0x7fff717fa840) at itemviews/qabstractitemview.cpp:1628
#47 0x00007fbcd4d5e7d5 in QTreeView::viewportEvent (this=0x977d20, event=0x7fff717fa840) at itemviews/qtreeview.cpp:1256
#48 0x00007fbcd54459a8 in QCoreApplicationPrivate::sendThroughObjectEventFilters (this=<optimized out>, receiver=0x95f260, event=0x7fff717fa840) at kernel/qcoreapplication.cpp:902
#49 0x00007fbcd4814baf in notify_helper (e=0x7fff717fa840, receiver=0x95f260, this=0x65da70) at kernel/qapplication.cpp:4477
#50 QApplicationPrivate::notify_helper (this=0x65da70, receiver=0x95f260, e=0x7fff717fa840) at kernel/qapplication.cpp:4453
#51 0x00007fbcd4819f5c in QApplication::notify (this=<optimized out>, receiver=0x95f260, e=0x7fff717fa840) at kernel/qapplication.cpp:4121
#52 0x00007fbcd64c1046 in KApplication::notify (this=0x7fff717fb5c0, receiver=0x95f260, event=0x7fff717fa840) at /usr/src/debug/kdelibs-4.7.46/kdeui/kernel/kapplication.cpp:311
#53 0x00007fbcd544581c in QCoreApplication::notifyInternal (this=0x7fff717fb5c0, receiver=0x95f260, event=0x7fff717fa840) at kernel/qcoreapplication.cpp:787
#54 0x00007fbcd4891bb8 in sendSpontaneousEvent (event=0x7fff717fa840, receiver=0x95f260) at ../../src/corelib/kernel/qcoreapplication.h:218
#55 QETWidget::translateMouseEvent (this=<optimized out>, event=<optimized out>) at kernel/qapplication_x11.cpp:4477
#56 0x00007fbcd4890a2a in QApplication::x11ProcessEvent (this=0x7fff717fb5c0, event=0x7fff717fb0d0) at kernel/qapplication_x11.cpp:3598
#57 0x00007fbcd48b82a2 in x11EventSourceDispatch (s=0x660450, callback=0, user_data=0x0) at kernel/qguieventdispatcher_glib.cpp:146
#58 0x00007fbccc00258d in g_main_dispatch (context=0x65d6c0) at gmain.c:2425
#59 g_main_context_dispatch (context=0x65d6c0) at gmain.c:2995
#60 0x00007fbccc002d88 in g_main_context_iterate (context=0x65d6c0, block=<optimized out>, dispatch=1, self=<optimized out>) at gmain.c:3073
#61 0x00007fbccc002f59 in g_main_context_iteration (context=0x65d6c0, may_block=1) at gmain.c:3136
#62 0x00007fbcd547050f in QEventDispatcherGlib::processEvents (this=0x60b8d0, flags=<optimized out>) at kernel/qeventdispatcher_glib.cpp:422
#63 0x00007fbcd48b7f2e in QGuiEventDispatcherGlib::processEvents (this=<optimized out>, flags=<optimized out>) at kernel/qguieventdispatcher_glib.cpp:204
#64 0x00007fbcd5444a22 in QEventLoop::processEvents (this=<optimized out>, flags=...) at kernel/qeventloop.cpp:149
#65 0x00007fbcd5444c1f in QEventLoop::exec (this=0x7fff717fb4a0, flags=...) at kernel/qeventloop.cpp:201
#66 0x00007fbcd5448de7 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1064
#67 0x0000000000402df3 in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/kdepim-4.7.46/kmail/main.cpp:145

Reported using DrKonqi
Comment 1 Laurent Montel 2011-11-21 17:59:14 UTC
Fixed in 4.7.4.
Comment 2 mgolden 2011-12-14 05:18:59 UTC
Created attachment 66718 [details]
New crash information added by DrKonqi

kmail (4.7.2) on KDE Platform 4.7.2 (4.7.2) using Qt 4.7.4

- What I was doing when the application crashed:

I had selected an attachment (the html part of a text/html message) and was deleting it.

-- Backtrace (Reduced):
#6  begin (this=0x40) at /usr/include/qt4/QtCore/qlist.h:861
#7  QList<KMime::Content*>::contains (this=0x40, t=@0x7fffd3dac658) at /usr/include/qt4/QtCore/qlist.h:863
#8  0x00007f589adda43c in KMime::Content::removeContent (this=0x3589500, c=0x2a884a0, del=true) at ../../kmime/kmime_content.cpp:566
#9  0x00007f589781b23b in MessageViewer::ViewerPrivate::deleteAttachment (this=0x186e950, node=0x2a884a0, showWarning=<optimized out>) at ../../messageviewer/viewer_p.cpp:397
#10 0x00007f58978280f7 in MessageViewer::ViewerPrivate::slotAttachmentDelete (this=0x186e950) at ../../messageviewer/viewer_p.cpp:2320
Comment 3 mgolden 2011-12-14 05:18:59 UTC
Created attachment 66719 [details]
New crash information added by DrKonqi

kmail (4.7.2) on KDE Platform 4.7.2 (4.7.2) using Qt 4.7.4

- What I was doing when the application crashed:

I had selected an attachment (the html part of a text/html message) and was deleting it.

-- Backtrace (Reduced):
#6  begin (this=0x40) at /usr/include/qt4/QtCore/qlist.h:861
#7  QList<KMime::Content*>::contains (this=0x40, t=@0x7fffd3dac658) at /usr/include/qt4/QtCore/qlist.h:863
#8  0x00007f589adda43c in KMime::Content::removeContent (this=0x3589500, c=0x2a884a0, del=true) at ../../kmime/kmime_content.cpp:566
#9  0x00007f589781b23b in MessageViewer::ViewerPrivate::deleteAttachment (this=0x186e950, node=0x2a884a0, showWarning=<optimized out>) at ../../messageviewer/viewer_p.cpp:397
#10 0x00007f58978280f7 in MessageViewer::ViewerPrivate::slotAttachmentDelete (this=0x186e950) at ../../messageviewer/viewer_p.cpp:2320
Comment 4 mgolden 2011-12-14 05:18:59 UTC
Created attachment 66720 [details]
New crash information added by DrKonqi

kmail (4.7.2) on KDE Platform 4.7.2 (4.7.2) using Qt 4.7.4

- What I was doing when the application crashed:

I had selected an attachment (the html part of a text/html message) and was deleting it.

-- Backtrace (Reduced):
#6  begin (this=0x40) at /usr/include/qt4/QtCore/qlist.h:861
#7  QList<KMime::Content*>::contains (this=0x40, t=@0x7fffd3dac658) at /usr/include/qt4/QtCore/qlist.h:863
#8  0x00007f589adda43c in KMime::Content::removeContent (this=0x3589500, c=0x2a884a0, del=true) at ../../kmime/kmime_content.cpp:566
#9  0x00007f589781b23b in MessageViewer::ViewerPrivate::deleteAttachment (this=0x186e950, node=0x2a884a0, showWarning=<optimized out>) at ../../messageviewer/viewer_p.cpp:397
#10 0x00007f58978280f7 in MessageViewer::ViewerPrivate::slotAttachmentDelete (this=0x186e950) at ../../messageviewer/viewer_p.cpp:2320
Comment 5 Allen Winter 2011-12-17 02:45:17 UTC
I fixed this one already in 4.7.4

make sure to use kdepimlibs from 4.7.4 too
Comment 6 mgolden 2011-12-17 07:06:03 UTC
Created attachment 66825 [details]
New crash information added by DrKonqi

kmail (4.7.4) on KDE Platform 4.7.4 (4.7.4) using Qt 4.7.4

- What I was doing when the application crashed:

I just downloaded kmail2 from the kubuntu-updates ppa, and I am now running 4.7.4.  I am still getting the crash

-- Backtrace (Reduced):
#6  isEmpty (this=0x60) at /usr/include/qt4/QtCore/qlist.h:95
#7  isEmpty (this=0x60) at /usr/include/qt4/QtCore/qlist.h:139
#8  KMime::Content::removeContent (this=0x316e0c0, c=0x2bd85a0, del=true) at ../../kmime/kmime_content.cpp:566
#9  0x00007f323d4ea6db in MessageViewer::ViewerPrivate::deleteAttachment (this=0x22117b0, node=0x2bd85a0, showWarning=<optimized out>) at ../../messageviewer/viewer_p.cpp:397
#10 0x00007f323d4f7637 in MessageViewer::ViewerPrivate::slotAttachmentDelete (this=0x22117b0) at ../../messageviewer/viewer_p.cpp:2346
Comment 7 Christophe Marin 2011-12-17 10:58:17 UTC
*** Bug 289164 has been marked as a duplicate of this bug. ***
Comment 8 mgolden 2011-12-20 17:58:28 UTC
Created attachment 66945 [details]
New crash information added by DrKonqi

kmail (4.7.4) on KDE Platform 4.7.4 (4.7.4) using Qt 4.7.4

- What I was doing when the application crashed:

Today a new build of the kdepimlibs-dbg:amd64 (4.7.4-0ubuntu0.1~ppa3) came down from the repository and yet I am still seeing this bug.  How can I tell which version of the source this is built from so I can tell the builder there to get the most up-to-date version?

-- Backtrace (Reduced):
#6  isEmpty (this=0x60) at /usr/include/qt4/QtCore/qlist.h:95
#7  isEmpty (this=0x60) at /usr/include/qt4/QtCore/qlist.h:139
#8  KMime::Content::removeContent (this=0x1fcffb0, c=0x1baec20, del=true) at ../../kmime/kmime_content.cpp:566
#9  0x00007f79b3e1c6db in MessageViewer::ViewerPrivate::deleteAttachment (this=0x124a320, node=0x1baec20, showWarning=<optimized out>) at ../../messageviewer/viewer_p.cpp:397
#10 0x00007f79b3e29637 in MessageViewer::ViewerPrivate::slotAttachmentDelete (this=0x124a320) at ../../messageviewer/viewer_p.cpp:2346
Comment 9 mgolden 2011-12-20 17:58:29 UTC
Created attachment 66946 [details]
New crash information added by DrKonqi

kmail (4.7.4) on KDE Platform 4.7.4 (4.7.4) using Qt 4.7.4

- What I was doing when the application crashed:

Today a new build of the kdepimlibs-dbg:amd64 (4.7.4-0ubuntu0.1~ppa3) came down from the repository and yet I am still seeing this bug.  How can I tell which version of the source this is built from so I can tell the builder there to get the most up-to-date version?

-- Backtrace (Reduced):
#6  isEmpty (this=0x60) at /usr/include/qt4/QtCore/qlist.h:95
#7  isEmpty (this=0x60) at /usr/include/qt4/QtCore/qlist.h:139
#8  KMime::Content::removeContent (this=0x1fcffb0, c=0x1baec20, del=true) at ../../kmime/kmime_content.cpp:566
#9  0x00007f79b3e1c6db in MessageViewer::ViewerPrivate::deleteAttachment (this=0x124a320, node=0x1baec20, showWarning=<optimized out>) at ../../messageviewer/viewer_p.cpp:397
#10 0x00007f79b3e29637 in MessageViewer::ViewerPrivate::slotAttachmentDelete (this=0x124a320) at ../../messageviewer/viewer_p.cpp:2346
Comment 10 mgolden 2011-12-20 17:58:29 UTC
Created attachment 66947 [details]
New crash information added by DrKonqi

kmail (4.7.4) on KDE Platform 4.7.4 (4.7.4) using Qt 4.7.4

- What I was doing when the application crashed:

Today a new build of the kdepimlibs-dbg:amd64 (4.7.4-0ubuntu0.1~ppa3) came down from the repository and yet I am still seeing this bug.  How can I tell which version of the source this is built from so I can tell the builder there to get the most up-to-date version?

-- Backtrace (Reduced):
#6  isEmpty (this=0x60) at /usr/include/qt4/QtCore/qlist.h:95
#7  isEmpty (this=0x60) at /usr/include/qt4/QtCore/qlist.h:139
#8  KMime::Content::removeContent (this=0x1fcffb0, c=0x1baec20, del=true) at ../../kmime/kmime_content.cpp:566
#9  0x00007f79b3e1c6db in MessageViewer::ViewerPrivate::deleteAttachment (this=0x124a320, node=0x1baec20, showWarning=<optimized out>) at ../../messageviewer/viewer_p.cpp:397
#10 0x00007f79b3e29637 in MessageViewer::ViewerPrivate::slotAttachmentDelete (this=0x124a320) at ../../messageviewer/viewer_p.cpp:2346
Comment 11 mgolden 2011-12-28 07:20:35 UTC
Created attachment 67179 [details]
New crash information added by DrKonqi

kmail (4.8 rc1) on KDE Platform 4.7.95 (4.8 RC1 (4.7.95) using Qt 4.7.4

- What I was doing when the application crashed:

I just tried this with KDE 4.7.95 (the 4.8 RC1) kubuntu package, and the crash is still happening.

-- Backtrace (Reduced):
#6  isEmpty (this=0x40) at /usr/include/qt4/QtCore/qlist.h:95
#7  isEmpty (this=0x40) at /usr/include/qt4/QtCore/qlist.h:139
#8  KMime::Content::removeContent (this=0x2238d60, c=0x12d31a0, del=true) at ../../kmime/kmime_content.cpp:566
#9  0x00007ff90aa2d4f3 in MessageViewer::ViewerPrivate::deleteAttachment (this=0x1414eb0, node=0x12d31a0, showWarning=<optimized out>) at ../../messageviewer/viewer_p.cpp:407
#10 0x00007ff90aa3aa87 in MessageViewer::ViewerPrivate::slotAttachmentDelete (this=0x1414eb0) at ../../messageviewer/viewer_p.cpp:2379
Comment 12 mgolden 2012-01-08 03:59:26 UTC
Created attachment 67562 [details]
New crash information added by DrKonqi

kmail (4.8 rc2) on KDE Platform 4.7.97 (4.8 RC2 (4.7.97) using Qt 4.7.4

- What I was doing when the application crashed:

Just tried deleting an attachment with KDE 4.8 RC2 (4.7.97) and this bug is still occurring.

-- Backtrace (Reduced):
#6  isEmpty (this=0x40) at /usr/include/qt4/QtCore/qlist.h:95
#7  isEmpty (this=0x40) at /usr/include/qt4/QtCore/qlist.h:139
#8  KMime::Content::removeContent (this=0x32657c0, c=0x32bc3a0, del=true) at ../../kmime/kmime_content.cpp:566
#9  0x00007f25166434f3 in MessageViewer::ViewerPrivate::deleteAttachment (this=0x2427090, node=0x32bc3a0, showWarning=<optimized out>) at ../../messageviewer/viewer_p.cpp:407
#10 0x00007f2516650a87 in MessageViewer::ViewerPrivate::slotAttachmentDelete (this=0x2427090) at ../../messageviewer/viewer_p.cpp:2379
Comment 13 mgolden 2012-01-26 15:32:54 UTC
Created attachment 68197 [details]
New crash information added by DrKonqi

kmail (4.8.0) on KDE Platform 4.8.00 (4.8.0 using Qt 4.7.4

- What I was doing when the application crashed:

This bug is NOT fixed.  I am using the KDE 4.8 release that just came down from Kubuntu repository, and I get this crash every time I try to delete an attachment

-- Backtrace (Reduced):
#6  isEmpty (this=0x40) at /usr/include/qt4/QtCore/qlist.h:95
#7  isEmpty (this=0x40) at /usr/include/qt4/QtCore/qlist.h:139
#8  KMime::Content::removeContent (this=0x2cd6710, c=0x3031060, del=true) at ../../kmime/kmime_content.cpp:566
#9  0x00007f14977d34f3 in MessageViewer::ViewerPrivate::deleteAttachment (this=0x2595970, node=0x3031060, showWarning=<optimized out>) at ../../messageviewer/viewer_p.cpp:407
#10 0x00007f14977e0a87 in MessageViewer::ViewerPrivate::slotAttachmentDelete (this=0x2595970) at ../../messageviewer/viewer_p.cpp:2379
Comment 14 Christophe Marin 2012-02-23 13:43:10 UTC
*** Bug 292475 has been marked as a duplicate of this bug. ***
Comment 15 Christophe Marin 2012-02-23 13:43:34 UTC
reopen. There are two similar bugs with 4.8
Comment 16 Christophe Marin 2012-02-23 13:43:46 UTC
*** Bug 294502 has been marked as a duplicate of this bug. ***
Comment 17 Allen Winter 2012-06-08 23:07:35 UTC
Except in this case you are attempting to delete a body part, not an attachment.

Laurent, I don't think in this case you should permit the "Delete Attachment" menu option.  I think the "Delete Attachment" menu should be disabled for body parts.
Comment 18 mgolden 2012-06-08 23:13:30 UTC
I don't know much about the internals of kmail, but I don't see why it's a big difference to delete a body part compared with an attachment.  i regularly use pine (I am old school) and want to switch to kmail, but its inability to do this has kept me from doing so.  in pine any part of the mail message may be deleted or viewed separately.  I delete all the text/html parts of mail messages and only retain the text/plain part.

In the message itself, a body part isn't really too different from an attachment.  It's just a minor difference in the MIME header.
Comment 19 Laurent Montel 2012-06-09 13:19:34 UTC
Allen it's not a crash specific to attachment or not but a bug in treemodel.
Will fix it.
Comment 20 Denis Kurz 2016-09-24 18:12:05 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 21 Denis Kurz 2017-01-07 21:40:27 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.
Comment 22 Ingo Klöcker 2021-04-23 10:16:35 UTC
Git commit 0b53b36701f4fe44dfa46af120bc0c71d327040c by Ingo Klöcker.
Committed on 23/04/2021 at 10:15.
Pushed by kloecker into branch 'master'.

Allow deletion of attachments from message structure view

Deletion of attachments (and other message parts) is only allowed
one at a time. Message parts inside encrypted message parts cannot
be deleted.

This (re-)adds the "Delete Attachment" action to the context menu
of the message structure view. It was removed 3 years ago because
it always crashed (because it tried to work with a copy of the node
tree of the original message).

Sponsored by: Intevation GmbH
Related: bug 436089
FIXED-IN: 5.18.0

M  +22   -1    messageviewer/src/viewer/viewer_p.cpp
M  +1    -0    messageviewer/src/viewer/viewer_p.h

https://invent.kde.org/pim/messagelib/commit/0b53b36701f4fe44dfa46af120bc0c71d327040c