<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>136365</bug_id>
          
          <creation_ts>2006-10-26 23:59:49 +0000</creation_ts>
          <short_desc>Crash on exit in autoSaveMessage</short_desc>
          <delta_ts>2007-09-14 12:17:01 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>10</classification_id>
          <classification>Unmaintained</classification>
          <product>kmail</product>
          <component>composer</component>
          <version>1.9.5</version>
          <rep_platform>Gentoo Packages</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>crash</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Marcin Gryszkalis">mg</reporter>
          <assigned_to name="kdepim bugs">pim-bugs-null</assigned_to>
          <cc>bugs2</cc>
    
    <cc>m.wege</cc>
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>480030</commentid>
    <comment_count>0</comment_count>
    <who name="Marcin Gryszkalis">mg</who>
    <bug_when>2006-10-26 23:59:49 +0000</bug_when>
    <thetext>Version:           1.9.5 (using KDE KDE 3.5.5)
Installed from:    Gentoo Packages
Compiler:          gcc 4.1.1 
OS:                Linux

It crashed upon exit, here&apos;s the backtrace, the important line is (I guess)
#24 0xb7cd27d8 in KMComposeWin::autoSaveMessage (this=0xe147e50)
    at kmcomposewin.cpp:699


#13 0xb51dd470 in *__GI_raise (sig=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#14 0xb51deb9e in *__GI_abort () at abort.c:88
#15 0xb721a714 in __gnu_cxx::__verbose_terminate_handler ()
   from /usr/lib/gcc/i686-pc-linux-gnu/4.1.1/libstdc++.so.6
#16 0xb7218105 in __cxxabiv1::__terminate ()
   from /usr/lib/gcc/i686-pc-linux-gnu/4.1.1/libstdc++.so.6
#17 0xb7218142 in std::terminate ()
   from /usr/lib/gcc/i686-pc-linux-gnu/4.1.1/libstdc++.so.6
#18 0xb721827a in __cxa_throw ()
   from /usr/lib/gcc/i686-pc-linux-gnu/4.1.1/libstdc++.so.6
#19 0xb72186bb in operator new ()
   from /usr/lib/gcc/i686-pc-linux-gnu/4.1.1/libstdc++.so.6
#20 0xb721878d in operator new[] ()
   from /usr/lib/gcc/i686-pc-linux-gnu/4.1.1/libstdc++.so.6
#21 0xb7cd4f7f in QValueVectorPrivate (this=0x8e04c50, x=@0x8fea598)
    at /usr/qt/3/include/qvaluevector.h:124
#22 0xb7cd4ff5 in QValueVector&lt;KMMessage*&gt;::detachInternal (this=0xe147f80)
    at /usr/qt/3/include/qvaluevector.h:499
#23 0xb7cd50b0 in QValueVector&lt;KMMessage*&gt;::front (this=0xe147f80)
    at /usr/qt/3/include/qvaluevector.h:369
#24 0xb7cd27d8 in KMComposeWin::autoSaveMessage (this=0xe147e50)
    at kmcomposewin.cpp:699
#25 0xb7cd2145 in KMComposeWin::qt_invoke (this=0xe147e50, _id=143,
    _o=0xbf8e257c) at kmcomposewin.moc:467
#26 0xb5a06f03 in QObject::activate_signal (this=0x8f51b28, clist=0x9593050,
    o=0xbf8e257c) at kernel/qobject.cpp:2356
#27 0xb5a07c9c in QObject::activate_signal (this=0x8f51b28, signal=2)
    at kernel/qobject.cpp:2325
#28 0xb5e0610a in QTimer::timeout (this=0x8f51b28)
    at .moc/debug-shared-mt/moc_qtimer.cpp:82
#29 0xb5a35805 in QTimer::event (this=0x8f51b28, e=0xbf8e28a8)
    at kernel/qtimer.cpp:219
#30 0xb5992703 in QApplication::internalNotify (this=0xbf8e2b34,
    receiver=0x8f51b28, e=0xbf8e28a8) at kernel/qapplication.cpp:2635
#31 0xb599467b in QApplication::notify (this=0xbf8e2b34, receiver=0x8f51b28,
    e=0xbf8e28a8) at kernel/qapplication.cpp:2358
#32 0xb624cca6 in KApplication::notify (this=0xbf8e2b34, receiver=0x8f51b28,
    event=0xbf8e28a8) at kapplication.cpp:550
#33 0xb770666f in QApplication::sendEvent (receiver=0x8f51b28,
    event=0xbf8e28a8) at /usr/qt/3/include/qapplication.h:496
#34 0xb5983518 in QEventLoop::activateTimers (this=0x8084a80)
    at kernel/qeventloop_unix.cpp:556
#35 0xb5932d4f in QEventLoop::processEvents (this=0x8084a80, flags=4)
    at kernel/qeventloop_x11.cpp:389
#36 0xb59b071d in QEventLoop::enterLoop (this=0x8084a80)
    at kernel/qeventloop.cpp:198
#37 0xb59b053e in QEventLoop::exec (this=0x8084a80)
    at kernel/qeventloop.cpp:145
#38 0xb59943c7 in QApplication::exec (this=0xbf8e2b34)
    at kernel/qapplication.cpp:2758
#39 0x0804a922 in main (argc=) at main.cpp:110</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>511472</commentid>
    <comment_count>1</comment_count>
    <who name="Marcin Gryszkalis">mg</who>
    <bug_when>2007-02-25 23:20:08 +0000</bug_when>
    <thetext>Happened again, in kde 3.5.6 (kmail 1.9.6)

Using host libthread_db library &quot;/lib/libthread_db.so.1&quot;.
[Thread debugging using libthread_db enabled]
[New Thread -1256039712 (LWP 31808)]
[New Thread -1289581680 (LWP 31813)]
[New Thread -1281188976 (LWP 31812)]
[New Thread -1272796272 (LWP 31811)]
[New Thread -1264403568 (LWP 31810)]
[KCrash handler]
#6  0xb7c29b4b in DwString::c_str (this=0xb534d109)
    at ../mimelib/mimelib/string.h:620
#7  0xb7c19c1c in KMMessage::asString (this=0xa8a97c8) at kmmessage.cpp:309
#8  0xb7cbe41e in KMComposeWin::autoSaveMessage (this=0x80fc1a0)
    at kmcomposewin.cpp:709
#9  0xb7cbd9cf in KMComposeWin::qt_invoke (this=0x80fc1a0, _id=145, 
    _o=0xbf829fdc) at kmcomposewin.moc:473
#10 0xb5a51ecf in QObject::activate_signal (this=0xa820f00, clist=0xa0ba270, 
    o=0xbf829fdc) at kernel/qobject.cpp:2356
#11 0xb5a52c68 in QObject::activate_signal (this=0xa820f00, signal=2)
    at kernel/qobject.cpp:2325
#12 0xb5e510ee in QTimer::timeout (this=0xa820f00)
    at .moc/debug-shared-mt/moc_qtimer.cpp:82
#13 0xb5a807d1 in QTimer::event (this=0xa820f00, e=0xbf82a308)
    at kernel/qtimer.cpp:219
#14 0xb59dd5ff in QApplication::internalNotify (this=0xbf82a590, 
    receiver=0xa820f00, e=0xbf82a308) at kernel/qapplication.cpp:2635
#15 0xb59df577 in QApplication::notify (this=0xbf82a590, receiver=0xa820f00, 
    e=0xbf82a308) at kernel/qapplication.cpp:2358
#16 0xb62c81c6 in KApplication::notify (this=0xbf82a590, receiver=0xa820f00, 
    event=0xbf82a308) at kapplication.cpp:550
#17 0xb76ac61f in QApplication::sendEvent (receiver=0xa820f00, 
    event=0xbf82a308) at /usr/qt/3/include/qapplication.h:496
#18 0xb59ce414 in QEventLoop::activateTimers (this=0x8089548)
    at kernel/qeventloop_unix.cpp:556
#19 0xb597dd97 in QEventLoop::processEvents (this=0x8089548, flags=4)
    at kernel/qeventloop_x11.cpp:389
#20 0xb59fb619 in QEventLoop::enterLoop (this=0x8089548)
    at kernel/qeventloop.cpp:198
#21 0xb59fb43a in QEventLoop::exec (this=0x8089548)
    at kernel/qeventloop.cpp:145
#22 0xb59df2c3 in QApplication::exec (this=0xbf82a590)
    at kernel/qapplication.cpp:2758
#23 0x0804a912 in main (argc=176584064, argv=0x9dcb398) at main.cpp:110
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>517581</commentid>
    <comment_count>2</comment_count>
    <who name="Thomas McGuire">mcguire</who>
    <bug_when>2007-03-27 20:15:33 +0000</bug_when>
    <thetext>Does the message you are composing have an attachment?
If yes, how big is it?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>517624</commentid>
    <comment_count>3</comment_count>
    <who name="Marcin Gryszkalis">mg</who>
    <bug_when>2007-03-28 00:02:08 +0000</bug_when>
    <thetext>I can&apos;t repeat this now - I forgot order of clicks, I&apos;ll try again later</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>518670</commentid>
    <comment_count>4</comment_count>
    <who name="Tommi Tervo">tommi.tervo</who>
    <bug_when>2007-04-03 11:24:18 +0000</bug_when>
    <thetext>*** Bug 143385 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>518677</commentid>
    <comment_count>5</comment_count>
    <who name="Thomas McGuire">mcguire</who>
    <bug_when>2007-04-03 13:23:54 +0000</bug_when>
    <thetext>These crashes are are all related to autoSaveMessage, but do not seem exactly the same: bug 143776, bug 136365, bug 108312.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>529852</commentid>
    <comment_count>6</comment_count>
    <who name="Bram Schoenmakers">me</who>
    <bug_when>2007-06-04 22:52:02 +0000</bug_when>
    <thetext>*** Bug 146368 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>537747</commentid>
    <comment_count>7</comment_count>
    <who name="Bruno Virlet">bvirlet</who>
    <bug_when>2007-07-24 16:25:44 +0000</bug_when>
    <thetext>&gt; I can&apos;t repeat this now - I forgot order of clicks, I&apos;ll try again later 
You&apos;re talking about a click order, even if you don&apos;t remember this order, what are the clicks you&apos;re talking about ?

And also, did your message have an attachement ? or was it empty ?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>537750</commentid>
    <comment_count>8</comment_count>
    <who name="Marcin Gryszkalis">mg</who>
    <bug_when>2007-07-24 16:50:23 +0000</bug_when>
    <thetext>I don&apos;t remember if it had attachement.

I also don&apos;t remember what actions caused this bug - I don&apos;t know when auto-save is  called - btw. I think now kmail&apos;s behavior is not consistent (File/Quit in main Kmail window leaves composer windows open).

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>540698</commentid>
    <comment_count>9</comment_count>
    <who name="Bruno Virlet">bvirlet</who>
    <bug_when>2007-08-13 15:06:10 +0000</bug_when>
    <thetext>SVN commit 699554 by bvirlet:

Fixes event loop bug. Credit goes to Dirk.


BUG: 108312
BUG: 148700
BUG: 143003
BUG: 136365
BUG: 90467

Most probably closed:
BUG: 143776
BUG: 147016
BUG: 137279
BUG: 136413

https://bugzilla.novell.com/show_bug.cgi?id=226462


 M  +10 -17    kmcomposewin.cpp  
 M  +1 -1      kmcomposewin.h  


--- branches/KDE/3.5/kdepim/kmail/kmcomposewin.cpp #699553:699554
@@ -709,16 +709,22 @@
 
   if ( mAutoSaveTimer )
     mAutoSaveTimer-&gt;stop();
+
   connect( this, SIGNAL( applyChangesDone( bool ) ),
-           this, SLOT( slotContinueAutoSave( bool ) ) );
+           this, SLOT( slotContinueAutoSave() ) );
   // This method is called when KMail crashed, so don&apos;t try signing/encryption
   // and don&apos;t disable controls because it is also called from a timer and
   // then the disabling is distracting.
   applyChanges( true, true );
 
   // Don&apos;t continue before the applyChanges is done!
-  qApp-&gt;enter_loop();
+}
 
+void KMComposeWin::slotContinueAutoSave()
+{
+  disconnect( this, SIGNAL( applyChangesDone( bool ) ),
+              this, SLOT( slotContinueAutoSave( bool ) ) );
+
   // Ok, it&apos;s done now - continue dead letter saving
   if ( mComposedMessages.isEmpty() ) {
     kdDebug(5006) &lt;&lt; &quot;Composing the message failed.&quot; &lt;&lt; endl;
@@ -761,16 +767,9 @@
   }
 
   if ( autoSaveInterval() &gt; 0 )
-    mAutoSaveTimer-&gt;start( autoSaveInterval() );
+    updateAutoSave();
 }
 
-void KMComposeWin::slotContinueAutoSave( bool )
-{
-  disconnect( this, SIGNAL( applyChangesDone( bool ) ),
-              this, SLOT( slotContinueAutoSave( bool ) ) );
-  qApp-&gt;exit_loop();
-}
-
 //-----------------------------------------------------------------------------
 void KMComposeWin::slotView(void)
 {
@@ -2193,18 +2192,12 @@
 {
   kdDebug(5006) &lt;&lt; &quot;entering KMComposeWin::applyChanges&quot; &lt;&lt; endl;
 
-  if(!mMsg) {
+  if(!mMsg || mComposer) {
     kdDebug(5006) &lt;&lt; &quot;KMComposeWin::applyChanges() : mMsg == 0!\n&quot; &lt;&lt; endl;
     emit applyChangesDone( false );
     return;
   }
 
-  if( mComposer ) {
-    kdDebug(5006) &lt;&lt; &quot;KMComposeWin::applyChanges() : applyChanges called twice&quot;
-                  &lt;&lt; endl;
-    return;
-  }
-
   // Make new job and execute it
   mComposer = new MessageComposer( this );
   connect( mComposer, SIGNAL( done( bool ) ),
--- branches/KDE/3.5/kdepim/kmail/kmcomposewin.h #699553:699554
@@ -780,7 +780,7 @@
 
   void slotContinueDoSend( bool );
   void slotContinuePrint( bool );
-  void slotContinueAutoSave( bool );
+  void slotContinueAutoSave();
 
   void slotEncryptChiasmusToggled( bool );
 
</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>