<?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>340014</bug_id>
          
          <creation_ts>2014-10-16 08:55:56 +0000</creation_ts>
          <short_desc>kMail crashes when opening a new main window if the original (first) main window has been closed</short_desc>
          <delta_ts>2021-06-20 17:10:49 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>kmail2</product>
          <component>UI</component>
          <version>5.2.3</version>
          <rep_platform>Kubuntu</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>REOPENED</bug_status>
          <resolution></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>1</everconfirmed>
          <reporter name="Gunter Ohrner">mails.bugs.kde.org-2025-1</reporter>
          <assigned_to name="kdepim bugs">pim-bugs-null</assigned_to>
          <cc>abyss.7</cc>
    
    <cc>davidbryant</cc>
    
    <cc>eddie.howson</cc>
    
    <cc>felixelens</cc>
    
    <cc>johannes.willkomm</cc>
    
    <cc>kde</cc>
    
    <cc>kdenis</cc>
    
    <cc>rodney.baker</cc>
    
    <cc>stakanov</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>1476344</commentid>
    <comment_count>0</comment_count>
    <who name="Gunter Ohrner">mails.bugs.kde.org-2025-1</who>
    <bug_when>2014-10-16 08:55:56 +0000</bug_when>
    <thetext>kMail crashes if a new main window should be opened but the original, first main window has been closed before.

Reproducible: Always

Steps to Reproduce:
1. Start kMail
2. Open a new main window using File-&gt;New-&gt;Main Window
3. Close the first (original) main window.
4. Chose File-&gt;New-&gt;Main Window again, in the newly opened main window =&gt; crash

Actual Results:  
kMail crashes.

Expected Results:  
kMail should not crash and a new, second main window should appear.

Application: KMail (kmail), signal: Segmentation fault
Using host libthread_db library &quot;/lib/x86_64-linux-gnu/libthread_db.so.1&quot;.
[Current thread is 1 (Thread 0x7f75977d6800 (LWP 7300))]

Thread 6 (Thread 0x7f756f8a9700 (LWP 7303)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007f758957e81d in WTF::TCMalloc_PageHeap::scavengerThread() () from /usr/lib/x86_64-linux-gnu/libQtWebKit.so.4
#2  0x00007f758957e859 in WTF::TCMalloc_PageHeap::runScavengerThread(void*) () from /usr/lib/x86_64-linux-gnu/libQtWebKit.so.4
#3  0x00007f75923fc182 in start_thread (arg=0x7f756f8a9700) at pthread_create.c:312
#4  0x00007f7594b3afbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 5 (Thread 0x7f752e0aa700 (LWP 7304)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007f75892bf20d in JSC::BlockAllocator::blockFreeingThreadMain() () from /usr/lib/x86_64-linux-gnu/libQtWebKit.so.4
#2  0x00007f75895adfd6 in WTF::wtfThreadEntryPoint(void*) () from /usr/lib/x86_64-linux-gnu/libQtWebKit.so.4
#3  0x00007f75923fc182 in start_thread (arg=0x7f752e0aa700) at pthread_create.c:312
#4  0x00007f7594b3afbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 4 (Thread 0x7f752d1b2700 (LWP 7305)):
#0  0x00007f7594b2dc6d in poll () at ../sysdeps/unix/syscall-template.S:81
#1  0x00007f758cb97fe4 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f758cb980ec in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f75954ca7be in QEventDispatcherGlib::processEvents (this=0x7f75200008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:436
#4  0x00007f759549c0af in QEventLoop::processEvents (this=this@entry=0x7f752d1b1de0, flags=...) at kernel/qeventloop.cpp:149
#5  0x00007f759549c3a5 in QEventLoop::exec (this=this@entry=0x7f752d1b1de0, flags=...) at kernel/qeventloop.cpp:204
#6  0x00007f7595398c5f in QThread::exec (this=&lt;optimized out&gt;) at thread/qthread.cpp:537
#7  0x00007f759539b32f in QThreadPrivate::start (arg=0x228ad60) at thread/qthread_unix.cpp:349
#8  0x00007f75923fc182 in start_thread (arg=0x7f752d1b2700) at pthread_create.c:312
#9  0x00007f7594b3afbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 3 (Thread 0x7f752760f700 (LWP 7306)):
#0  0x00007f7594b2dc6d in poll () at ../sysdeps/unix/syscall-template.S:81
#1  0x00007f758cb97fe4 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f758cb980ec in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f75954ca7be in QEventDispatcherGlib::processEvents (this=0x7f751c0008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:436
#4  0x00007f759549c0af in QEventLoop::processEvents (this=this@entry=0x7f752760eda0, flags=...) at kernel/qeventloop.cpp:149
#5  0x00007f759549c3a5 in QEventLoop::exec (this=this@entry=0x7f752760eda0, flags=...) at kernel/qeventloop.cpp:204
#6  0x00007f7595398c5f in QThread::exec (this=this@entry=0x2677b20) at thread/qthread.cpp:537
#7  0x00007f759547d823 in QInotifyFileSystemWatcherEngine::run (this=0x2677b20) at io/qfilesystemwatcher_inotify.cpp:265
#8  0x00007f759539b32f in QThreadPrivate::start (arg=0x2677b20) at thread/qthread_unix.cpp:349
#9  0x00007f75923fc182 in start_thread (arg=0x7f752760f700) at pthread_create.c:312
#10 0x00007f7594b3afbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 2 (Thread 0x7f7526bfd700 (LWP 7308)):
#0  0x00007f7594b328e3 in select () at ../sysdeps/unix/syscall-template.S:81
#1  0x00007f759547a171 in QProcessManager::run (this=0x7f7595804540 &lt;processManager()::processManager&gt;) at io/qprocess_unix.cpp:270
#2  0x00007f759539b32f in QThreadPrivate::start (arg=0x7f7595804540 &lt;processManager()::processManager&gt;) at thread/qthread_unix.cpp:349
#3  0x00007f75923fc182 in start_thread (arg=0x7f7526bfd700) at pthread_create.c:312
#4  0x00007f7594b3afbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 1 (Thread 0x7f75977d6800 (LWP 7300)):
[KCrash Handler]
#6  QString::operator== (this=0x28002000680103, other=...) at tools/qstring.cpp:2192
#7  0x00007f759732874c in KStatusNotifierItem::setToolTipSubTitle (this=this@entry=0x256dbe0, subTitle=...) at ../../kdeui/notifications/kstatusnotifieritem.cpp:419
#8  0x00007f759655e86e in KMail::KMSystemTray::unreadMail (this=this@entry=0x256dbe0, model=model@entry=0x1e76cc0, parentIndex=...) at ../../kmail/kmsystemtray.cpp:415
#9  0x00007f759655e74d in KMail::KMSystemTray::unreadMail (this=this@entry=0x256dbe0, model=model@entry=0x1e76cc0, parentIndex=...) at ../../kmail/kmsystemtray.cpp:408
#10 0x00007f759655ea25 in KMail::KMSystemTray::initListOfCollection (this=0x256dbe0) at ../../kmail/kmsystemtray.cpp:375
#11 0x00007f759655ef3f in updateSystemTray (this=&lt;optimized out&gt;) at ../../kmail/kmsystemtray.cpp:437
#12 KMail::KMSystemTray::setShowUnreadCount (this=&lt;optimized out&gt;, showUnreadCount=&lt;optimized out&gt;) at ../../kmail/kmsystemtray.cpp:154
#13 0x00007f75965674a5 in KMKernel::toggleSystemTray (this=0x7fff1cf95630) at ../../kmail/kmkernel.cpp:2060
#14 0x00007f7596597bff in KMMainWidget::readConfig (this=this@entry=0x23d1910) at ../../kmail/kmmainwidget.cpp:875
#15 0x00007f75965a6f66 in KMMainWidget::KMMainWidget (this=0x23d1910, parent=&lt;optimized out&gt;, aGUIClient=0x28e65e0, actionCollection=&lt;optimized out&gt;, config=...) at ../../kmail/kmmainwidget.cpp:271
#16 0x00007f7596556ab1 in KMMainWin::KMMainWin (this=this@entry=0x28e6580, __in_chrg=&lt;optimized out&gt;, __vtt_parm=&lt;optimized out&gt;) at ../../kmail/kmmainwin.cpp:67
#17 0x00007f7596556e5d in KMMainWin::slotNewMailReader (this=&lt;optimized out&gt;) at ../../kmail/kmmainwin.cpp:156
#18 0x00007f75954b187a in QMetaObject::activate (sender=sender@entry=0xc8d2da0, m=m@entry=0x7f7596478de0 &lt;QAction::staticMetaObject&gt;, local_signal_index=local_signal_index@entry=1, argv=argv@entry=0x7fff1cf94400) at kernel/qobject.cpp:3539
#19 0x00007f75959c8a62 in QAction::triggered (this=this@entry=0xc8d2da0, _t1=false) at .moc/release-shared/moc_qaction.cpp:276
#20 0x00007f75959ca433 in QAction::activate (this=this@entry=0xc8d2da0, event=event@entry=QAction::Trigger) at kernel/qaction.cpp:1257
#21 0x00007f7595df8489 in QMenuPrivate::activateCausedStack (this=this@entry=0x86b07d0, causedStack=..., action=action@entry=0xc8d2da0, action_e=action_e@entry=QAction::Trigger, self=self@entry=true) at widgets/qmenu.cpp:1038
#22 0x00007f7595dfc9b9 in QMenuPrivate::activateAction (this=0x86b07d0, action=0xc8d2da0, action_e=action_e@entry=QAction::Trigger, self=self@entry=true) at widgets/qmenu.cpp:1130
#23 0x00007f7595e00385 in QMenu::mouseReleaseEvent (this=this@entry=0x84ff380, e=e@entry=0x7fff1cf94b30) at widgets/qmenu.cpp:2372
#24 0x00007f75972cc665 in KMenu::mouseReleaseEvent (this=0x84ff380, e=0x7fff1cf94b30) at ../../kdeui/widgets/kmenu.cpp:464
#25 0x00007f7595a1e50a in QWidget::event (this=this@entry=0x84ff380, event=event@entry=0x7fff1cf94b30) at kernel/qwidget.cpp:8376
#26 0x00007f7595e007bb in QMenu::event (this=0x84ff380, e=0x7fff1cf94b30) at widgets/qmenu.cpp:2481
#27 0x00007f75959cee2c in QApplicationPrivate::notify_helper (this=this@entry=0x1cefa90, receiver=receiver@entry=0x84ff380, e=e@entry=0x7fff1cf94b30) at kernel/qapplication.cpp:4567
#28 0x00007f75959d55dd in QApplication::notify (this=this@entry=0x7fff1cf95600, receiver=receiver@entry=0x84ff380, e=e@entry=0x7fff1cf94b30) at kernel/qapplication.cpp:4110
#29 0x00007f7597215d1a in KApplication::notify (this=0x7fff1cf95600, receiver=0x84ff380, event=0x7fff1cf94b30) at ../../kdeui/kernel/kapplication.cpp:311
#30 0x00007f759549d4dd in QCoreApplication::notifyInternal (this=0x7fff1cf95600, receiver=receiver@entry=0x84ff380, event=event@entry=0x7fff1cf94b30) at kernel/qcoreapplication.cpp:953
#31 0x00007f75959d4d93 in sendEvent (event=&lt;optimized out&gt;, receiver=&lt;optimized out&gt;) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:231
#32 QApplicationPrivate::sendMouseEvent (receiver=receiver@entry=0x84ff380, event=event@entry=0x7fff1cf94b30, alienWidget=alienWidget@entry=0x0, nativeWidget=nativeWidget@entry=0x84ff380, buttonDown=buttonDown@entry=0x7f75964b4318 &lt;qt_button_down&gt;, lastMouseReceiver=..., spontaneous=spontaneous@entry=true) at kernel/qapplication.cpp:3178
#33 0x00007f7595a49cfc in QETWidget::translateMouseEvent (this=this@entry=0x84ff380, event=event@entry=0x7fff1cf94e80) at kernel/qapplication_x11.cpp:4568
#34 0x00007f7595a49269 in QApplication::x11ProcessEvent (this=0x7fff1cf95600, event=event@entry=0x7fff1cf94e80) at kernel/qapplication_x11.cpp:3627
#35 0x00007f7595a70b02 in x11EventSourceDispatch (s=0x1d0a130, callback=0x0, user_data=0x0) at kernel/qguieventdispatcher_glib.cpp:146
#36 0x00007f758cb97e04 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#37 0x00007f758cb98048 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#38 0x00007f758cb980ec in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#39 0x00007f75954ca7a1 in QEventDispatcherGlib::processEvents (this=0x1c08af0, flags=...) at kernel/qeventdispatcher_glib.cpp:434
#40 0x00007f7595a70bb6 in QGuiEventDispatcherGlib::processEvents (this=&lt;optimized out&gt;, flags=...) at kernel/qguieventdispatcher_glib.cpp:204
#41 0x00007f759549c0af in QEventLoop::processEvents (this=this@entry=0x7fff1cf95250, flags=...) at kernel/qeventloop.cpp:149
#42 0x00007f759549c3a5 in QEventLoop::exec (this=this@entry=0x7fff1cf95250, flags=...) at kernel/qeventloop.cpp:204
#43 0x00007f75954a1b79 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1225
#44 0x00007f75959cd37c in QApplication::exec () at kernel/qapplication.cpp:3828
#45 0x0000000000402d18 in main (argc=&lt;optimized out&gt;, argv=&lt;optimized out&gt;) at ../../kmail/main.cpp:146</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1570873</commentid>
    <comment_count>1</comment_count>
    <who name="Gunter Ohrner">mails.bugs.kde.org-2025-1</who>
    <bug_when>2016-01-20 14:51:56 +0000</bug_when>
    <thetext>The feature to be able to open multiple mail windows has simply been removed from kMail to get rid of bugs like this...

So technically it&apos;s not fixed, but it also cannot be reproduced any more...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1655749</commentid>
    <comment_count>2</comment_count>
    <who name="Denis Kurz">kdenis</who>
    <bug_when>2017-01-20 21:47:25 +0000</bug_when>
    <thetext>*** Bug 375330 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1655751</commentid>
    <comment_count>3</comment_count>
    <who name="Denis Kurz">kdenis</who>
    <bug_when>2017-01-20 21:47:27 +0000</bug_when>
    <thetext>*** Bug 341712 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1655753</commentid>
    <comment_count>4</comment_count>
    <who name="Denis Kurz">kdenis</who>
    <bug_when>2017-01-20 21:47:32 +0000</bug_when>
    <thetext>*** Bug 341938 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1655755</commentid>
    <comment_count>5</comment_count>
    <who name="Denis Kurz">kdenis</who>
    <bug_when>2017-01-20 21:47:35 +0000</bug_when>
    <thetext>*** Bug 346257 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1655757</commentid>
    <comment_count>6</comment_count>
    <who name="Denis Kurz">kdenis</who>
    <bug_when>2017-01-20 21:47:42 +0000</bug_when>
    <thetext>*** Bug 342329 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1655759</commentid>
    <comment_count>7</comment_count>
    <who name="Denis Kurz">kdenis</who>
    <bug_when>2017-01-20 21:47:47 +0000</bug_when>
    <thetext>*** Bug 349178 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1655761</commentid>
    <comment_count>8</comment_count>
    <who name="Denis Kurz">kdenis</who>
    <bug_when>2017-01-20 21:47:57 +0000</bug_when>
    <thetext>*** Bug 347236 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1655763</commentid>
    <comment_count>9</comment_count>
    <who name="Denis Kurz">kdenis</who>
    <bug_when>2017-01-20 21:48:07 +0000</bug_when>
    <thetext>*** Bug 357150 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1655765</commentid>
    <comment_count>10</comment_count>
    <who name="Denis Kurz">kdenis</who>
    <bug_when>2017-01-20 22:09:06 +0000</bug_when>
    <thetext>Actually, this bug was reported for much more recent versions, although the way to trigger it is not the same.

I think I have a rough idea what happened: When a new KMail instance is created, its KMSystemTray is created as a copy from another KMSystemTray. This class has a raw d-pointer, but no copy control. Now when one of the instances is destroyed, the other has a dangling d-pointer.

That&apos;s just an educated guess, though. I&apos;m still very confused by the gigantic pim codebase, so I might have missed several important details.

The duplicate bug 375330 was reported for 5.2.3.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1985234</commentid>
    <comment_count>11</comment_count>
    <who name="Justin Zobel">justin.zobel</who>
    <bug_when>2020-12-17 05:26:15 +0000</bug_when>
    <thetext>Thank you for the crash report.

As it has been a while since this was reported, can you please test and confirm if this issue is still occurring or if this bug report can be marked as resolved.

I have set the bug status to &quot;needsinfo&quot; pending your response, please change back to &quot;reported&quot; or &quot;resolved/worksforme&quot; when you respond, thank you.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1986000</commentid>
    <comment_count>12</comment_count>
    <who name="Gunter Ohrner">mails.bugs.kde.org-2025-1</who>
    <bug_when>2020-12-17 14:35:06 +0000</bug_when>
    <thetext>I&apos;m not using kMail any more since a few years, as it was just too unreliable.

More than once I had the problem that I suddenly ended up with a non-working email program after upgrades to a KDE bugfix or next stable release due to some obscure Akonadi and other problems.


However, as far as I remember, the feature &quot;File-&gt;New-&gt;Main Window&quot; was removed from kMail alltogether to &quot;fix&quot; other issues the occured in relation to multiple main windows. As I was used to work with those before, it was quite a set-back back then.

So maybe the original issue here is not relevant any more at all, although I don&apos;t know about the issues Dennis mentioned in Comment 10 in 2017 - so not sure if this could be closed as &quot;worksforme&quot; or whatever...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2042557</commentid>
    <comment_count>13</comment_count>
    <who name="David C. Bryant">davidbryant</who>
    <bug_when>2021-06-20 17:10:49 +0000</bug_when>
    <thetext>I think this problem has been fixed. I&apos;m using Gentoo Packages, KMail 5.16.3, Plasma 5.21.5, Frameworks %.82.0, Qt 5.15.2.

The menu item &quot;File --&gt; New --&gt; Main Widow&quot; has been removed. Simply starting KMail, then saying &quot;kmail&quot; in a terminal window won&apos;t fire up a second instance of the program. But &quot;d-bus-launch kmail&quot; will start a second (and a third) instance of the program.

I fiddled around with this for a bit, and could not get any of the instances of KMail to crash. I could navigate to different folders / messages. I ran &quot;qps&quot; (traces process ids, like a GUI version of &quot;top&quot;). I saw multiple instances of the akonadi server running, which might eventually cause a problem. Memory usage was pretty high. Killing the extra instances of kmail left &quot;phantom&quot; instances of akonadi hanging around ... I&apos;m too lazy to try killing them one by one, so will probably just reboot to clean up the process tree..

The only really odd thing I noticed is that the system tray icon was not recreated when I opened a second main KMail window. And if I &quot;quit&quot; from the system tray, the second instance of KMail keeps on running.

Does anybody have any objection to marking this bug &quot;resolved&quot;?</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>