[From nobody Tue Nov 26 14:30:24 2013 From: Jan Safranek <reviewboard@gallagherhome.com> Precedence: list MIME-Version: 1.0 To: =?utf-8?b?VG9tw6HFoSBCxb5hdGVr?= <tbzatek@redhat.com>, Michal Minar <miminar@redhat.com>, scanbot <jsafrane@redhat.com>, Jan Safranek <jsafrane@redhat.com>, OpenLMI Developers <openlmi-reviews@lists.fedorahosted.org> References: <20131126111549.234376.884@ex-std-node147.prod.rhcloud.com> In-Reply-To: <20131126111549.234376.884@ex-std-node147.prod.rhcloud.com> Date: Tue, 26 Nov 2013 12:04:32 -0000 Reply-To: Jan Safranek <jsafrane@redhat.com>, openlmi-reviews@lists.fedorahosted.org Message-ID: <20131126120432.234375.74878@ex-std-node147.prod.rhcloud.com> Content-Type: multipart/alternative; boundary="===============5046247904508910934==" Subject: Re: Review Request 1291: indicationmgr: fixed deadlock when re-starting the namager thread. Message: 67 --===============5046247904508910934== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: http://reviewboard-openlmi.rhcloud.com/r/1291/ ----------------------------------------------------------- (Updated Nov. 26, 2013, 1:04 p.m.) Status ------ This change has been marked as submitted. Review request for OpenLMI Developers. Repository: openlmi-providers Description ------- indicationmgr: fixed deadlock when re-starting the namager thread. When the indication manager thread was stopped, it destroys its mutex and creates new one. If pthread_mutex_destroy() fails because the mutex is locked, the new mutex is not created -> the old one is used, but it's already locked -> deadlock. So let's make sure the mutex is unlocked when destroying the thread. Rewrite of indication manager thread is needed to have the manage() function interruptible when waiting for events, e.g. using a pipe and select(), this pthread_cancel leads to memory leaks. Diffs ----- src/indmanager/ind_manager.c 7d6bc7545647589178ed2a858c0d136c4806b7b0 Diff: http://reviewboard-openlmi.rhcloud.com/r/1291/diff/ Testing ------- Thanks, Jan Safranek --===============5046247904508910934== Content-Type: text/html; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit <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://reviewboard-openlmi.rhcloud.com/r/1291/">http://reviewboard-openlmi.rhcloud.com/r/1291/</a> </td> </tr> </table> <br /> <table bgcolor="#e0e0e0" width="100%" cellpadding="8" style="border: 1px gray solid;"> <tr> <td> <h1 style="margin-right: 0.2em; padding: 0; font-size: 10pt;">This change has been marked as submitted.</h1> </td> </tr> </table> <br /> <table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('http://reviewboard-openlmi.rhcloud.com/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 OpenLMI Developers.</div> <div>By Jan Safranek.</div> <p style="color: grey;"><i>Updated Nov. 26, 2013, 1:04 p.m.</i></p> <div style="margin-top: 1.5em;"> <b style="color: #575012; font-size: 10pt;">Repository: </b> openlmi-providers </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;">indicationmgr: fixed deadlock when re-starting the namager thread. When the indication manager thread was stopped, it destroys its mutex and creates new one. If pthread_mutex_destroy() fails because the mutex is locked, the new mutex is not created -&gt; the old one is used, but it&#39;s already locked -&gt; deadlock. So let&#39;s make sure the mutex is unlocked when destroying the thread. Rewrite of indication manager thread is needed to have the manage() function interruptible when waiting for events, e.g. using a pipe and select(), this pthread_cancel leads to memory leaks. </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/indmanager/ind_manager.c <span style="color: grey">(7d6bc7545647589178ed2a858c0d136c4806b7b0)</span></li> </ul> <p><a href="http://reviewboard-openlmi.rhcloud.com/r/1291/diff/" style="margin-left: 3em;">View Diff</a></p> </td> </tr> </table> </div> </body> </html> --===============5046247904508910934==-- ]