Bug 359698

Summary: Wastebin does not get emptied when config set to empty on exit
Product: [Applications] kmail2 Reporter: Ian <ianseeks>
Component: miscAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED FIXED    
Severity: crash CC: ianseeks, rjvbertin
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In: 5.1.3
Sentry Crash Report:
Attachments: Backtrace for kmail2 crash on reload

Description Ian 2016-02-23 11:46:37 UTC
kmail2
Version 5.1.2
KDE Frameworks 5.19.0
Qt 5.5.1 (built against 5.5.1)
The xcb windowing system

Reproducible: Always

Steps to Reproduce:
1. Set mkail config/misc/empty wastebin on exit to yes
2. Exit kmail2
3. Reload kmail2
4. check wastebin 

Actual Results:  
Kmail2 closes and does not empty wastebin, kmail2 will then crash on reload with this error "Executable: kmail PID: 22596 Signal: Segmentation fault (11) Time: 23/02/2016 11:44:41" but it still loads and is usable

Expected Results:  
Empty wastebin on exit
kmail2 not to crash on reload
Comment 1 RJVB 2016-02-23 13:26:43 UTC
You should upload a backtrace for the crash, either through DrKonqi (which *should* appear when a KDE application crashes) or else by running kmail from within a debugger (type `gdb --args /usr/bin/kmail --nofork` or something like that in a terminal, and then `bt` [without the quotes] when the crash occurs)
Comment 2 Ian 2016-02-23 15:46:00 UTC
Created attachment 97377 [details]
Backtrace for kmail2 crash on reload

if i set Empty wastebin on exit, exited and reloaded. i get this error but kmail2 loads as usual and seems to work fine.
Comment 3 Ian 2016-02-23 15:47:32 UTC
(In reply to RJVB from comment #1)
> You should upload a backtrace for the crash, either through DrKonqi (which
> *should* appear when a KDE application crashes) or else by running kmail
> from within a debugger (type `gdb --args /usr/bin/kmail --nofork` or
> something like that in a terminal, and then `bt` [without the quotes] when
> the crash occurs)

I did the backtrace from the error dialog that pops up
Comment 4 RJVB 2016-02-23 16:06:51 UTC
The venom appears to be here

Thread 1 (Thread 0x7f751218b940 (LWP 26483)):
[KCrash Handler]
#6  QListData::size (this=0x10) at /usr/include/qt5/QtCore/qlist.h:105
#7  QList<KMail::UndoInfo*>::count (this=0x10) at /usr/include/qt5/QtCore/qlist.h:314
#8  KMail::UndoStack::size (this=0x0) at /usr/src/debug/kdepim-15.12.2/kmail/undostack.cpp:58
#9  0x00007f7511a1247c in KMMainWidget::updateMessageActionsDelayed (this=this@entry=0xddef60) at /usr/src/debug/kdepim-15.12.2/kmail/kmmainwidget.cpp:3850
#10 0x00007f7511a12d23 in KMMainWidget::updateMessageActions (this=this@entry=0xddef60, fast=fast@entry=false) at /usr/src/debug/kdepim-15.12.2/kmail/kmmainwidget.cpp:3682
#11 0x00007f7511a23331 in KMMainWidget::setupActions (this=this@entry=0xddef60) at /usr/src/debug/kdepim-15.12.2/kmail/kmmainwidget.cpp:3423
#12 0x00007f7511a277db in KMMainWidget::KMMainWidget (this=0xddef60, parent=<optimized out>, aGUIClient=0xea9ec0, actionCollection=0xce4930, config=...) at /usr/src/debug/kdepim-15.12.2/kmail/kmmainwidget.cpp:256
#13 0x00007f75119d56d2 in KMMainWin::KMMainWin (this=0xea9e50, __in_chrg=<optimized out>, __vtt_parm=<optimized out>) at /usr/src/debug/kdepim-15.12.2/kmail/kmmainwin.cpp:61
#14 0x00007f75119e6237 in KMKernel::openReader (this=this@entry=0x7ffec338fcc0, onlyCheck=onlyCheck@entry=false) at /usr/src/debug/kdepim-15.12.2/kmail/kmkernel.cpp:522

That looks like an attempt to determine the size of a non-existing undo stack -- maybe KMail detects the presence of messages in the wastebin and presumes this must mean that an undo stack has been created?
Comment 5 Laurent Montel 2016-02-23 21:43:53 UTC
Git commit d7f066f3d19b6861b5adfaefe40b4ba86cda2394 by Montel Laurent.
Committed on 23/02/2016 at 21:43.
Pushed by mlaurent into branch 'Applications/15.12'.

Fix Bug 359698 - Wastebin does not get emptied when config set to empty on exit

FIXED-IN: 5.1.3

M  +4    -0    kmail/main.cpp

http://commits.kde.org/kdepim/d7f066f3d19b6861b5adfaefe40b4ba86cda2394