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

List:       kde-frameworks-devel
Subject:    Re: Review Request 114895: Guard against null QX11Info::connection()
From:       Martin_Gräßlin <mgraesslin () kde ! org>
Date:       2014-01-08 10:27:01
Message-ID: 20140108102701.16659.79740 () probe ! kde ! org
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


> On Jan. 7, 2014, 3:14 p.m., Martin Gräßlin wrote:
> > checking obviously makes sense, though it shouldn't be needed. There \
> > must be something else which is wrong here, too. 
> > Could you try what the value of WId is in these cases? I wouldn't be \
> > surprised if it were 0. 
> > Oh and that code has unit tests, so I would appreciate if you extend \
> > the tests for that case.
> 
> David Edmundson wrote:
> WId seems to be valid. If I check the dialog with xwininfo before closing \
> plasmoidviewer it shows the same ID. 
> Here is a full backtrace of it being needed: \
> http://pastebin.kde.org/pxjhgw95d 
> I can guard against it inside plasma with 
> if (!QApplication::closingDown()) around the KWindowEffects calls.
> 
> I changed to guarding in the library as I can imagine others hitting it \
> in the future and in general library code shouldn't crash on reasonable \
> inputs. 
> 
> 
> 
> 
> Martin Gräßlin wrote:
> The backtrace includes QWindow::destroy which as the name says will do an \
> xcb_destroy_window. After that the DialogProxy::onVisibleChanged will be \
> invoked. At that point the window doesn't exist any more so the X calls \
> are just wrong. I'd say this needs fixing in DialogProxy to not call the \
> X specific calls for a destroyed window. 
> Then one could think about whether invoking the methods without a valid \
> xcb_connection is supposed to work. I'd say we should add asserts there \
> instead of the null checks. What do you think?

I just had a look at the QWindow implementation and whether it could \
provide us a useable way to figure out whether there is a window at all. \
Unfortunately it doesn't. So ShipIt!


- Martin


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/114895/#review46967
-----------------------------------------------------------


On Jan. 7, 2014, 2:57 p.m., David Edmundson wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/114895/
> -----------------------------------------------------------
> 
> (Updated Jan. 7, 2014, 2:57 p.m.)
> 
> 
> Review request for KDE Frameworks, Martin Gräßlin and Marco Martin.
> 
> 
> Repository: kwindowsystem
> 
> 
> Description
> -------
> 
> Guard against null QX11Info::connection()
> 
> This can fail if the application is currently shutting down,
> this is currently causing a crash on closing plasma with dialogs
> open.
> 
> 
> Diffs
> -----
> 
> src/kwindoweffects_x11.cpp 72cbb71 
> 
> Diff: https://git.reviewboard.kde.org/r/114895/diff/
> 
> 
> Testing
> -------
> 
> Opened plasmoidviewer -a org.kde.example.widgetgallery expanded the \
> applet, then closed plasmoidviewer It used to crash, now it doesn't.
> 
> 
> Thanks,
> 
> David Edmundson
> 
> 


[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="https://git.reviewboard.kde.org/r/114895/">https://git.reviewboard.kde.org/r/114895/</a>
  </td>
    </tr>
   </table>
   <br />





<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; \
padding-left: 10px;">  <p style="margin-top: 0;">On January 7th, 2014, 3:14 \
p.m. CET, <b>Martin Gräßlin</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;">checking obviously makes sense, though it shouldn&#39;t be \
needed. There must be something else which is wrong here, too.

Could you try what the value of WId is in these cases? I wouldn&#39;t be \
surprised if it were 0.

Oh and that code has unit tests, so I would appreciate if you extend the \
tests for that case.</pre>  </blockquote>




 <p>On January 7th, 2014, 3:22 p.m. CET, <b>David Edmundson</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;">WId seems to be valid. If I check the dialog with xwininfo \
before closing plasmoidviewer it shows the same ID.

Here is a full backtrace of it being needed: \
http://pastebin.kde.org/pxjhgw95d

I can guard against it inside plasma with 
if (!QApplication::closingDown()) around the KWindowEffects calls.

I changed to guarding in the library as I can imagine others hitting it in \
the future and in general library code shouldn&#39;t crash on reasonable \
inputs.



</pre>
 </blockquote>





 <p>On January 7th, 2014, 3:48 p.m. CET, <b>Martin Gräßlin</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;">The backtrace includes QWindow::destroy which as the name says \
will do an xcb_destroy_window. After that the DialogProxy::onVisibleChanged \
will be invoked. At that point the window doesn&#39;t exist any more so the \
X calls are just wrong. I&#39;d say this needs fixing in DialogProxy to not \
call the X specific calls for a destroyed window.

Then one could think about whether invoking the methods without a valid \
xcb_connection is supposed to work. I&#39;d say we should add asserts there \
instead of the null checks. What do you think?</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;">I just had a \
look at the QWindow implementation and whether it could provide us a \
useable way to figure out whether there is a window at all. Unfortunately \
it doesn&#39;t. So ShipIt!</pre> <br />










<p>- Martin</p>


<br />
<p>On January 7th, 2014, 2:57 p.m. CET, David Edmundson wrote:</p>








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

<div>Review request for KDE Frameworks, Martin Gräßlin and Marco \
Martin.</div> <div>By David Edmundson.</div>


<p style="color: grey;"><i>Updated Jan. 7, 2014, 2:57 p.m.</i></p>









<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
kwindowsystem
</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;">Guard against null QX11Info::connection()

This can fail if the application is currently shutting down,
this is currently causing a crash on closing plasma with dialogs
open.


</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;">Opened plasmoidviewer -a org.kde.example.widgetgallery \
expanded the applet, then closed plasmoidviewer It used to crash, now it \
doesn&#39;t.</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/kwindoweffects_x11.cpp <span style="color: \
grey">(72cbb71)</span></li>

</ul>

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







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








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



_______________________________________________
Kde-frameworks-devel mailing list
Kde-frameworks-devel@kde.org
https://mail.kde.org/mailman/listinfo/kde-frameworks-devel


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

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