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

List:       kde-core-devel
Subject:    Re: Review Request: Do not crash avahi DNSSD service
From:       "Albert Astals Cid" <tsdgeos () terra ! es>
Date:       2012-08-22 11:13:46
Message-ID: 20120822111346.11464.42029 () vidsolbach ! de
[Download RAW message or body]

> On Aug. 22, 2012, 10:13 a.m., Christoph Feck wrote:
> > Any comment? I would like to get it into 4.9.1, because we are continously \
> > getting crash reports for KTorrent. I tried contacting kdnssd maintainer, but got \
> > no answer.
> 
> Thomas Lübking wrote:
> "Ship It!"
> 
> "avahi" == "bonjour" == "zeroconf" == dnssd implementation ("DNS-Based Service \
> Discovery" ie. network / service autoconfig invented for apple users. Itunes runs \
> around and checks for pers. Cups uses it as well.) 
> Given " d->m_running" is used as condition to trigger "stop()" in ::publishAsync() \
> and a pointer check might be superfluous but no harm - yet is performed in many \
> other locations as well - both changes are reasonable, should not carry any harm \
> and if they prevent a segfault will rather do good then bad (could shadow a more \
> general issue) 
> That's however no official "ship it" but just imo, based on abstract code review \
> :-\

kbattleship uses PublicService to ease the location of other people in your network \
with who to play. You might give it a quick try to see you did not break anything (in \
case you have avahi installed)


- Albert


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


On July 19, 2012, 1:55 a.m., Christoph Feck wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/105613/
> -----------------------------------------------------------
> 
> (Updated July 19, 2012, 1:55 a.m.)
> 
> 
> Review request for kdelibs, KTorrent, Joris Guisson, and Thiago Macieira.
> 
> 
> Description
> -------
> 
> This is my attempt to fix the crash. As far as I followed the code, the crash is \
> because of m_group == 0 in serverStateChanged() when the avahi server is initially \
> "registering" or in "collision", and not "running" yet. When e.g. KTorrent starts, \
> it is possible that the avahi server needs some time until it is fully setup. The \
> m_group is initialized when the first tryApply() is called, which only happens when \
> server is initially in "running" state. 
> Additionally, the m_running variable was never reset to false in stop(), so the \
> (sync) publish() would never return on failure. 
> 
> This addresses bug 215288.
> http://bugs.kde.org/show_bug.cgi?id=215288
> 
> 
> Diffs
> -----
> 
> dnssd/avahi-publicservice.cpp 52bef22 
> 
> Diff: http://git.reviewboard.kde.org/r/105613/diff/
> 
> 
> Testing
> -------
> 
> I have no idea what avahi is or how it works, so I did not test it.
> 
> 
> Thanks,
> 
> Christoph Feck
> 
> 


[Attachment #3 (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/105613/">http://git.reviewboard.kde.org/r/105613/</a>
  </td>
    </tr>
   </table>
   <br />





<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <p style="margin-top: 0;">On August 22nd, 2012, 10:13 a.m., <b>Christoph \
Feck</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;">Any comment? I would like to get it into 4.9.1, because we are \
continously getting crash reports for KTorrent. I tried contacting kdnssd maintainer, \
but got no answer.</pre>  </blockquote>




 <p>On August 22nd, 2012, 11:09 a.m., <b>Thomas Lübking</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;">&quot;Ship It!&quot;

&quot;avahi&quot; == &quot;bonjour&quot; == &quot;zeroconf&quot; == dnssd \
implementation (&quot;DNS-Based Service Discovery&quot; ie. network / service \
autoconfig invented for apple users. Itunes runs around and checks for pers. Cups \
uses it as well.)

Given &quot; d-&gt;m_running&quot; is used as condition to trigger &quot;stop()&quot; \
in ::publishAsync() and a pointer check might be superfluous but no harm - yet is \
performed in many other locations as well - both changes are reasonable, should not \
carry any harm and if they prevent a segfault will rather do good then bad (could \
shadow a more general issue)

That&#39;s however no official &quot;ship it&quot; but just imo, based on abstract \
code review :-\</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;">kbattleship uses \
PublicService to ease the location of other people in your network with who to play. \
You might give it a quick try to see you did not break anything (in case you have \
avahi installed)</pre> <br />








<p>- Albert</p>


<br />
<p>On July 19th, 2012, 1:55 a.m., Christoph Feck wrote:</p>






<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 kdelibs, KTorrent, Joris Guisson, and Thiago Macieira.</div>
<div>By Christoph Feck.</div>


<p style="color: grey;"><i>Updated July 19, 2012, 1:55 a.m.</i></p>






<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;">This is my attempt to fix the crash. As far as I followed the code, the \
crash is because of m_group == 0 in serverStateChanged() when the avahi server is \
initially &quot;registering&quot; or in &quot;collision&quot;, and not \
&quot;running&quot; yet. When e.g. KTorrent starts, it is possible that the avahi \
server needs some time until it is fully setup. The m_group is initialized when the \
first tryApply() is called, which only happens when server is initially in \
&quot;running&quot; state.

Additionally, the m_running variable was never reset to false in stop(), so the \
(sync) publish() would never return on failure.</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;">I have no idea what avahi is or how it works, so I did not test \
it.</pre>  </td>
 </tr>
</table>



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


 <a href="http://bugs.kde.org/show_bug.cgi?id=215288">215288</a>


</div>


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

 <li>dnssd/avahi-publicservice.cpp <span style="color: grey">(52bef22)</span></li>

</ul>

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




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








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



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

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