Bug 144303 - KMail/Kontact crashes when cancelling GnuPG signing a new message
Summary: KMail/Kontact crashes when cancelling GnuPG signing a new message
Status: RESOLVED FIXED
Alias: None
Product: kmail
Classification: Applications
Component: encryption (show other bugs)
Version: 1.9.6
Platform: Gentoo Packages Linux
: NOR crash
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
: 148706 149561 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-04-16 16:04 UTC by Elias Probst
Modified: 2007-09-05 16:49 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Elias Probst 2007-04-16 16:04:49 UTC
Version:           1.9.6 (using KDE KDE 3.5.6)
Installed from:    Gentoo Packages
Compiler:          gcc-Version 4.1.1 (Gentoo 4.1.1-r3) CFLAGS="-ggdb -O2 -march=nocona -msse3 -pipe -fomit-frame-pointer -fvar-tracking"
OS:                Linux

Reproducable:
Create a new mail
Activate GnuPG signature
Keep GnuPG encryption deactivated
Send mail
Cancel the dialog asking: "Valid trusted encryption keys were found for all recipients. Encrypt this message?"

Settings:
-> Security
	-> Composing
		-> All checkboxes are active
	-> Warnings
		-> All checkboxes are active

Versions:
KDE/KMail (see above)
gnupg-1.9.21

Backtrace:
Using host libthread_db library "/lib/libthread_db.so.1".
[Thread debugging using libthread_db enabled]
[New Thread -1250888016 (LWP 20232)]
[New Thread -1279775856 (LWP 20236)]
[New Thread -1271383152 (LWP 20235)]
[New Thread -1262990448 (LWP 20234)]
[New Thread -1254597744 (LWP 20233)]
[KCrash handler]
#9  0xb7e566f9 in MessageComposer::emitDone (this=0x84bd0b8, b=false)
    at messagecomposer.cpp:364
#10 0xb7e5681e in MessageComposer::doNextJob (this=0x84bd0b8)
    at messagecomposer.cpp:352
#11 0xb7e56864 in MessageComposer::slotDoNextJob (this=0x84bd0b8)
    at messagecomposer.cpp:389
#12 0xb7e5691d in MessageComposer::qt_invoke (this=0x84bd0b8, _id=2, 
    _o=0xbf815e44) at messagecomposer.moc:95
#13 0xb5fce29e in QObject::activate_signal () from /usr/qt/3/lib/libqt-mt.so.3
#14 0xb62e07f7 in QSignal::signal () from /usr/qt/3/lib/libqt-mt.so.3
#15 0xb5fe8459 in QSignal::activate () from /usr/qt/3/lib/libqt-mt.so.3
#16 0xb5feefc9 in QSingleShotTimer::event () from /usr/qt/3/lib/libqt-mt.so.3
#17 0xb5f72fe5 in QApplication::internalNotify ()
   from /usr/qt/3/lib/libqt-mt.so.3
#18 0xb5f73b42 in QApplication::notify () from /usr/qt/3/lib/libqt-mt.so.3
#19 0xb6601938 in KApplication::notify (this=0xbf8162f0, receiver=0x82acd88, 
    event=0xbf8160f4) at kapplication.cpp:550
#20 0xb5f68d5a in QEventLoop::activateTimers ()
   from /usr/qt/3/lib/libqt-mt.so.3
#21 0xb5f25cf4 in QEventLoop::processEvents ()
   from /usr/qt/3/lib/libqt-mt.so.3
#22 0xb5f889ad in QEventLoop::enterLoop () from /usr/qt/3/lib/libqt-mt.so.3
#23 0xb5f88852 in QEventLoop::exec () from /usr/qt/3/lib/libqt-mt.so.3
#24 0xb5f72b0b in QApplication::exec () from /usr/qt/3/lib/libqt-mt.so.3
#25 0x0804a47a in main (argc=139428056, argv=0x819f400) at main.cpp:110
#26 0xb572a824 in __libc_start_main () from /lib/libc.so.6
#27 0x0804a201 in _start ()


Thank you!
Comment 1 Tommi Tervo 2007-08-10 10:21:02 UTC
*** Bug 148706 has been marked as a duplicate of this bug. ***
Comment 2 quazgar 2007-08-14 14:34:51 UTC
I can confirm this, with kmail 1.9.7, also on gentoo (gcc 4.1.2).

Steps to reproduce:
* Try to send an email with encryption, click on "Send email"
* in the key approval dialog, click "Cancel"
* click on "Send email" again
* in the key approval dialog, click "Cancel"

Actual result:
Kmail crashes.

Expected result:
Kmail does not crash.

This could also be reproduced by people in #kontact on irc.freenode.net
Comment 3 Will Stephenson 2007-08-14 17:48:55 UTC
SVN commit 700035 by wstephens:

When sending an encrypted message, with an empty body, and the
encryption key selection or encryption prefs selection dialogs were
cancelled, mNewBodyPart was deleted without ever having been
initialised.

Also init some other vars ASAP.  I've looked for cases of things being
used uninitialised and this should be safe.

BUG:144303



 M  +18 -1     messagecomposer.cpp  


--- branches/kdepim/enterprise/kdepim/kmail/messagecomposer.cpp #700034:700035
@@ -287,7 +287,24 @@
 
 MessageComposer::MessageComposer( KMComposeWin* win, const char* name )
   : QObject( win, name ), mComposeWin( win ), mCurrentJob( 0 ),
-    mKeyResolver( 0 ), mIdentityUid( 0 ), mPerformingSignOperation( false )
+    mReferenceMessage( 0 ), mKeyResolver( 0 ), 
+    mUseOpportunisticEncryption( false ),
+    mSignBody( false ), mEncryptBody( false ),
+    mSigningRequested(  false ), mEncryptionRequested( false ),
+    mDoSign( false ), mDoEncrypt( false ),
+    mAllowedCryptoMessageFormats( 0 ),
+    mDisableCrypto( false ),
+    mDisableBreaking( false ),
+    mDebugComposerCrypto( false ),
+    mAutoCharset( true ),
+    mIsRichText( false ),
+    mIdentityUid( 0 ), mRc( true ),
+    mHoldJobs( false ),
+    mNewBodyPart( 0 ),
+    mEarlyAddAttachments( false ), mAllAttachmentsAreInBody( false ),
+    mPreviousBoundaryLevel( 0 ),
+    mEncryptWithChiasmus( false ),
+    mPerformingSignOperation( false )
 {
 }
 
Comment 4 Will Stephenson 2007-08-14 17:50:36 UTC
SVN commit 700038 by wstephens:

Backport r700035 to 3.5 branch.
(fix #144303 - Kmail/Kontact crashes when cancelling GnuPG singing a new
(empty) message.

CCBUG:144303


 M  +18 -1     messagecomposer.cpp  


--- branches/KDE/3.5/kdepim/kmail/messagecomposer.cpp #700037:700038
@@ -287,7 +287,24 @@
 
 MessageComposer::MessageComposer( KMComposeWin* win, const char* name )
   : QObject( win, name ), mComposeWin( win ), mCurrentJob( 0 ),
-    mKeyResolver( 0 ), mIdentityUid( 0 ), mPerformingSignOperation( false )
+    mReferenceMessage( 0 ), mKeyResolver( 0 ), 
+    mUseOpportunisticEncryption( false ),
+    mSignBody( false ), mEncryptBody( false ),
+    mSigningRequested(  false ), mEncryptionRequested( false ),
+    mDoSign( false ), mDoEncrypt( false ),
+    mAllowedCryptoMessageFormats( 0 ),
+    mDisableCrypto( false ),
+    mDisableBreaking( false ),
+    mDebugComposerCrypto( false ),
+    mAutoCharset( true ),
+    mIsRichText( false ),
+    mIdentityUid( 0 ), mRc( true ),
+    mHoldJobs( false ),
+    mNewBodyPart( 0 ),
+    mEarlyAddAttachments( false ), mAllAttachmentsAreInBody( false ),
+    mPreviousBoundaryLevel( 0 ),
+    mEncryptWithChiasmus( false ),
+    mPerformingSignOperation( false )
 {
 }
 
Comment 5 Will Stephenson 2007-08-14 17:58:48 UTC
SVN commit 700042 by wstephens:

Forward port r700035 - (#144303 KMail/Kontact crash on cancelling
signing an new (empty) message )
CCBUG:144303


 M  +18 -1     messagecomposer.cpp  


--- trunk/KDE/kdepim/kmail/messagecomposer.cpp #700041:700042
@@ -314,7 +314,24 @@
 
 MessageComposer::MessageComposer( KMComposeWin *win )
   : QObject( win ), mComposeWin( win ), mCurrentJob( 0 ),
-    mKeyResolver( 0 ), mIdentityUid( 0 ), mPerformingSignOperation( false )
+    mReferenceMessage( 0 ), mKeyResolver( 0 ), 
+    mUseOpportunisticEncryption( false ),
+    mSignBody( false ), mEncryptBody( false ),
+    mSigningRequested(  false ), mEncryptionRequested( false ),
+    mDoSign( false ), mDoEncrypt( false ),
+    mAllowedCryptoMessageFormats( 0 ),
+    mDisableCrypto( false ),
+    mDisableBreaking( false ),
+    mDebugComposerCrypto( false ),
+    mAutoCharset( true ),
+    mIsRichText( false ),
+    mIdentityUid( 0 ), mRc( true ),
+    mHoldJobs( false ),
+    mNewBodyPart( 0 ),
+    mEarlyAddAttachments( false ), mAllAttachmentsAreInBody( false ),
+    mPreviousBoundaryLevel( 0 ),
+    mEncryptWithChiasmus( false ),
+    mPerformingSignOperation( false )
 {
 }
 
Comment 6 Elias Probst 2007-08-14 21:14:53 UTC
Thank you for fixing this!
Comment 7 Thomas McGuire 2007-09-05 16:49:06 UTC
*** Bug 149561 has been marked as a duplicate of this bug. ***