<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="12" style="border: 1px #c9c399 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://git.reviewboard.kde.org/r/127626/">https://git.reviewboard.kde.org/r/127626/</a>
     </td>
    </tr>
   </table>
   <br />





<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On April 10th, 2016, 4:29 p.m. UTC, <b>David Faure</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">1) is this fixed by applying the QPixmapCache fix in Qt itself? (git cherry-pick be926e412c9c4ec9ee77b49dbe370fbb5451f0e1). It's in Qt 5.6.0 though.
2) do you feel like writing a test app for kdbusservice (or even an autotest) that reproduces the issue? I wonder why the existing autotest doesn't hit this. I tried linking to Qt5::Widgets, didn't make a difference. But well, I have Qt 5.6, so if it's the above commit, no wonder.</p></pre>
 </blockquote>




 <p>On April 10th, 2016, 4:33 p.m. UTC, <b>Martin Tobias Holmedahl Sandsmark</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">This is with 5.6.0. It doesn't crash 100% of the time, it is a bit spurious (it is a race condition as far as I can tell), and maybe it depends on some other part of the system or something.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">I'll try to write a proper autotest.</p></pre>
 </blockquote>





 <p>On April 10th, 2016, 5:20 p.m. UTC, <b>Martin Tobias Holmedahl Sandsmark</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">I tried switching the existing kdbusservice autotest to use QApplication like you, but I'm unable to reproduce it as well. I also can't reproduce it in konsole when running under valgrind or gdb which is very annoying.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Maybe it is some other library or framework that doesn't handle an exit() before the QApplication is deleted (maybe for some reason it gets called from the event loop after some static data is unallocated)? I'll try to link in all the frameworks konsole uses.</p></pre>
 </blockquote>





 <p>On April 10th, 2016, 5:35 p.m. UTC, <b>David Faure</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Actually the testcase in the QTBUG still crashes for me with 5.6, but not in the pixmapcache, in the QSurface dtor: http://www.davidfaure.fr/2016/crash.txt
I'll add this info to the QTBUG when I can log into it again (seems broken right now).</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">But yeah, a unittest that exhibits the problem would be a good way to ensure no future regression (or at least catch them quicker, when they come from Qt).</p></pre>
 </blockquote>








</blockquote>

<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Talked briefly with thiago (and others) in #kde-devel yesterday about this, and calling exit() without destroying the QCoreApplication is not supported and a design flaw in KDBusService, apparently.

Some workarounds are to either to use quick_exit()/_exit(), or try to call the QCoreApplication destructor manually (and hope it doesn't get called by anything else) before calling exit().

The best solution I think is to work around it in applications where possible, and try to fix everything that breaks down when exit() is called before the QCoreApplication is deleted. This crash for example is (according to thiago) because the qtdbus module is unloaded while a thread is still using it, so he suggested to create a module destructor for qtdbus.</pre>
<br />










<p>- Martin Tobias Holmedahl</p>


<br />
<p>On April 10th, 2016, 3:29 p.m. UTC, Martin Tobias Holmedahl Sandsmark wrote:</p>








<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="12" style="border: 1px #888a85 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
 <tr>
  <td>

<div>Review request for Konsole, David Faure and Kurt Hindenburg.</div>
<div>By Martin Tobias Holmedahl Sandsmark.</div>


<p style="color: grey;"><i>Updated April 10, 2016, 3:29 p.m.</i></p>









<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
konsole
</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Fix crash when KDBusService exits.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">This is a bit of an ugly workaround, but it seems to work.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">I'll paste in my comment from https://git.reviewboard.kde.org/r/127625/ here:</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;"><div class="codehilite" style="background: #f8f8f8"><pre style="line-height: 125%">It seems like it is this that it happening: https://bugreports.qt.io/browse/QTBUG-48709

>From my understanding it can't really be fixed, short of somehow getting KDBusService to delete the QApplication before calling exit(), which might get nasty with QApplications allocated on the stack?

In any case it seems to be a general bug with KDBusService and how it is supposed to be used, not something that we can easily fix in konsole.
</pre></div>
</p></pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Tested by forcing it to open a new window in an existing session (commenting out line 237 in main.cpp), and running under valgrind to verify the deletion.</p></pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>src/main.cpp <span style="color: grey">(5e1420e37363454cf5e7886a82381cb9eb4447d8)</span></li>

</ul>

<p><a href="https://git.reviewboard.kde.org/r/127626/diff/" style="margin-left: 3em;">View Diff</a></p>






  </td>
 </tr>
</table>







  </div>
 </body>
</html>