Bug 113580 - Crash on closing compose-window which is prompting for passphrase
Summary: Crash on closing compose-window which is prompting for passphrase
Status: RESOLVED FIXED
Alias: None
Product: kmail
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR crash
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-29 18:34 UTC by Remco
Modified: 2007-09-14 12:17 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
backtrace (3.82 KB, text/plain)
2006-09-18 19:50 UTC, Remco
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Remco 2005-09-29 18:34:58 UTC
Version:            (using KDE KDE 3.4.1)
Installed from:    Gentoo Packages
OS:                Linux

KMail crashes after closing a compose-window. When I have clicked the send-button and it prompted me for a passphrase to sign the message, the window closes correctly. But when I click "Cancel" in the "Passphrase"-dialog that is still open at that time, KMail crashes.

Steps to reproduce:

* Compose message
* Enable Options->Sign message
* Click send
* Switch to the compose-window
* Close it by clicking X
* Switch to the passphrase-dialog
* Press "Cancel".

When the passphrase-prompt is being shown all controls on the compose-window are disabled. So probably the best solution would be to disable the Close-button of that window as well. :)
Comment 1 Philip Rodrigues 2006-09-18 13:15:43 UTC
Does the problem still exist in KDE 3.5? Do  you get a backtrace?
Comment 2 Remco 2006-09-18 19:50:55 UTC
Created attachment 17829 [details]
backtrace

The backtrace I got. Unfortunately I don't have debugging symbols compiled in.
Comment 3 Remco 2006-09-18 19:52:09 UTC
The problem is still existent in KDE 3.5. I've attached the backtrace to this issue, but I don't think it's very informative.
Comment 4 Philip Rodrigues 2006-11-19 23:21:24 UTC
Please paste the first ~10 calls from backtraces, as it allows the "search for similar crashes" feature to work. Thanks!

#4  0xb583587c in MessageComposer::composeMessage ()
   from /usr/kde/3.5/lib/libkmailprivate.so
#5  0xb58331cc in MessageComposer::composeMessage ()
   from /usr/kde/3.5/lib/libkmailprivate.so
#6  0xb583bd92 in ComposeMessageJob::execute ()
   from /usr/kde/3.5/lib/libkmailprivate.so
#7  0xb582e78c in MessageComposer::slotDoNextJob ()
   from /usr/kde/3.5/lib/libkmailprivate.so
#8  0xb583ae93 in MessageComposer::qt_invoke ()
   from /usr/kde/3.5/lib/libkmailprivate.so
#9  0xb6749593 in QObject::activate_signal () from /usr/qt/3/lib/libqt-mt.so.3
#10 0xb6a7d4d8 in QSignal::signal () from /usr/qt/3/lib/libqt-mt.so.3
#11 0xb676312f in QSignal::activate () from /usr/qt/3/lib/libqt-mt.so.3
#12 0xb676a7d3 in QSingleShotTimer::event () from /usr/qt/3/lib/libqt-mt.so.3
#13 0xb66ee07c in QApplication::internalNotify ()
   from /usr/qt/3/lib/libqt-mt.so.3
#14 0xb66ed41d in QApplication::notify () from /usr/qt/3/lib/libqt-mt.so.3
#15 0xb6d349d2 in KApplication::notify ()
   from /usr/kde/3.5/lib/libkdecore.so.4
#16 0xb66ddb09 in QEventLoop::activateTimers ()
   from /usr/qt/3/lib/libqt-mt.so.3
Comment 5 Will Stephenson 2007-03-22 15:24:42 UTC
Only happens when gpg-agent is not used.  With gpg-agent, the composer window is disabled.
Comment 6 Will Stephenson 2007-03-22 17:39:49 UTC
SVN commit 645446 by wstephens:

Disallow closing the composer window whilst performing a sign operation, this causes a crash when using the non-gpg-agent PGP backend.
BUG: 113580


 M  +2 -0      kmcomposewin.cpp  
 M  +4 -3      messagecomposer.cpp  
 M  +2 -0      messagecomposer.h  


--- branches/KDE/3.5/kdepim/kmail/kmcomposewin.cpp #645445:645446
@@ -2055,6 +2055,8 @@
     return false;
   if ( kmkernel->shuttingDown() || kapp->sessionSaving() )
     return true;
+  if ( mComposer && mComposer->isPerformingSignOperation() ) // since the non-gpg-agent gpg plugin gets a passphrase using QDialog::exec()
+    return false;                                            // the user can try to close the window, which destroys mComposer mid-call.
 
   if ( isModified() ) {
     bool istemplate = ( mFolder!=0 && mFolder->isTemplates() );
--- branches/KDE/3.5/kdepim/kmail/messagecomposer.cpp #645445:645446
@@ -287,7 +287,7 @@
 
 MessageComposer::MessageComposer( KMComposeWin* win, const char* name )
   : QObject( win, name ), mComposeWin( win ), mCurrentJob( 0 ),
-    mKeyResolver( 0 ), mIdentityUid( 0 )
+    mKeyResolver( 0 ), mIdentityUid( 0 ), mPerformingSignOperation( false )
 {
 }
 
@@ -1590,9 +1590,10 @@
   }
 
   if ( doSignBody ) {
-
+    mPerformingSignOperation = true;  // this lets the KMComposeWin know if it is safe to close the window.
     pgpSignedMsg( mEncodedBody, format );
-
+    mPerformingSignOperation = false;
+    
     if ( mSignature.isEmpty() ) {
       kdDebug() << "signature was empty" << endl;
       mRc = false;
--- branches/KDE/3.5/kdepim/kmail/messagecomposer.h #645445:645446
@@ -92,6 +92,7 @@
     return mMessageList;
   }
 
+  bool isPerformingSignOperation() const { return mPerformingSignOperation; }
 signals:
   void done( bool );
 
@@ -273,6 +274,7 @@
 
   QValueList<MessageComposerJob*> mJobs;
   bool mEncryptWithChiasmus;
+  bool mPerformingSignOperation;
 };
 
 #endif /* MESSAGECOMPOSER_H */