[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kwin
Subject:    Review Request: Protect animation list iterators against external changes
From:       Thomas_Lübking <thomas.luebking () web ! de>
Date:       2013-01-03 23:15:46
Message-ID: 20130103231546.27291.93607 () vidsolbach ! de
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/108151/
-----------------------------------------------------------

Review request for kwin and Martin Gräßlin.


Description
-------

I recently started to run into random crashes on the heap and slightly started to \
fear to have broken sth. on activities... whatever.
Turned out* that moving BE::Faded to AnimationEffect and for the very first time \
actually using "animationEnded" to chain animations (fade out -> fade in) would \
(actually obviously) alter the m_animations list what unfortunately turns our nice \
little iterators into random junk.

So this patch tracks list manipulations (in this case during the iteration calling \
animationEnded, being the natural candidate) and when they happen, re-validates the \
iterators (the map traversion is required due to the internals of QMap/QHash; the \
list could instead also be accessed by entry->first.at(animationCounter) instead; not \
sure about performance impact but it would have made the patch much larger ;-)

* I actually figured it because resizing on fullscreen changes always worked like \
crap because the window gets to resizes in a row (once for the decoration being \
removed and then the actual resize to the FS geometry) what got me multiplicative \
traslation/scaling. Chaining this made the crashes pretty reproducible but the result \
is pretty cool =)


Diffs
-----

  kwin/libkwineffects/kwinanimationeffect.cpp e0a6694 

Diff: http://git.reviewboard.kde.org/r/108151/diff/


Testing
-------

hehe - i un/fullscreened mplayer about a hundred times the last few minutes.
That crashed nearly *each* time before the patch.


Thanks,

Thomas Lübking


[Attachment #5 (text/html)]

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


<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" \
style="background-image: \
url('http://git.reviewboard.kde.org/media/rb/images/review_request_box_top_bg.png'); \
background-position: left top; background-repeat: repeat-x; border: 1px black \
solid;">  <tr>
  <td>

<div>Review request for kwin and Martin Gräßlin.</div>
<div>By Thomas Lübking.</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;">I recently started to run into random crashes on the heap and slightly \
started to fear to have broken sth. on activities... whatever.
Turned out* that moving BE::Faded to AnimationEffect and for the very first time \
actually using &quot;animationEnded&quot; to chain animations (fade out -&gt; fade \
in) would (actually obviously) alter the m_animations list what unfortunately turns \
our nice little iterators into random junk.

So this patch tracks list manipulations (in this case during the iteration calling \
animationEnded, being the natural candidate) and when they happen, re-validates the \
iterators (the map traversion is required due to the internals of QMap/QHash; the \
list could instead also be accessed by entry-&gt;first.at(animationCounter) instead; \
not sure about performance impact but it would have made the patch much larger ;-)

* I actually figured it because resizing on fullscreen changes always worked like \
crap because the window gets to resizes in a row (once for the decoration being \
removed and then the actual resize to the FS geometry) what got me multiplicative \
traslation/scaling. Chaining this made the crashes pretty reproducible but the result \
is pretty cool =)</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;">hehe - i un/fullscreened mplayer about a hundred times the last few \
minutes. That crashed nearly *each* time before the patch.</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>kwin/libkwineffects/kwinanimationeffect.cpp <span style="color: \
grey">(e0a6694)</span></li>

</ul>

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




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




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



_______________________________________________
kwin mailing list
kwin@kde.org
https://mail.kde.org/mailman/listinfo/kwin


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic