<br><font size=2 face="sans-serif">My suspicion is that when the handler
is destroyed, it's not being unregistered from *all* events that it was
registered for (e.g. timeouts, reads, writes). &nbsp;From my experience,
this is the primary cause for this type of crash. &nbsp;Have you ensured
that on its destruction path, the Handler has cancelled all timers and
unregistered from the Reactor with an ALL_EVENTS_MASK? &nbsp;Also, make
sure that the underlying socket (peer) hasn't been destroyed yet (or at
least make sure that you've saved the socket's handle somewhere), since
the Reactor requires that socket's handle (via the get_handle() on the
Handler, which calls get_handle() on the peer). &nbsp;If the socket is
destroyed before the Handler tries to unregister, the socket's handle will
be invalid and this will not allow the Reactor to properly map handle to
Handler for unregistering. &nbsp;In this case as well, your Handler will
still be registered with the Reactor even after it's been destroyed.</font>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=35%>
<br>
<br>
<br><font size=1 face="sans-serif"><b>&quot;Douglas C. Schmidt&quot; &lt;schmidt@dre.vanderbilt.edu&gt;</b></font>
<br><font size=1 face="sans-serif">Sent by: ace-users-bounces@cse.wustl.edu</font>
<br><font size=1 face="sans-serif">11/19/2007 08:25 AM</font>
<td width=64%>
<table width=100%>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">To</font></div>
<td><font size=1 face="sans-serif">ace-users@cse.wustl.edu</font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">Subject</font></div>
<td><font size=1 face="sans-serif">Re: [ace-users] Race condition between
handle_input() &amp; &nbsp; &nbsp; &nbsp; &nbsp;handle_timeout()
in ACE_Svc_Handler ?</font></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br>
<br><tt><font size=2>Hi Shawn,<br>
<br>
&gt;I have synchronized the handler methods with a thread mutex. But my<br>
&gt;problem is if I return -1 in the handle_timeout, other thread might<br>
&gt;crash and seems it's using the handler.<br>
&gt;And I also tried to use notify and return -1 inside handle_exception()<br>
&gt;but no luck.<br>
&gt;It seems that even I returned -1 in handler methods, and the handler<br>
&gt;is released, ACE is still trying to distribute events to that<br>
&gt;*destroyed* handler.<br>
&gt;<br>
&gt;Is this a know bug in ACE5.4 or mis-use of &quot;return -1' ?<br>
<br>
Good question. &nbsp;I recommend you first try to upgrade to ACE 5.6.1<br>
&lt;download.dre.vanderbilt.edu&gt; and if that doesn't help we'll think
of<br>
something new.<br>
<br>
Thanks,<br>
<br>
Doug<br>
<br>
_______________________________________________<br>
ace-users mailing list<br>
ace-users@mail.cse.wustl.edu<br>
http://mail.cse.wustl.edu/mailman/listinfo/ace-users<br>
</font></tt>
<br>
<br>
<br>
<br>
<br>
<br>
<br><font size=2 face="sans-serif"><br>
<br>
_______________________________________________________________________________________________________________
<br>
This e-mail communication (and any attachment/s) may contain confidential
or privileged information and is intended only for the individual(s) or
entity named above and to others who have been specifically authorized
to receive it. If you are not the intended recipient, please do not read,
copy, use or disclose the contents of this communication to others. Please
notify the sender that you have received this e-mail in error by reply
e-mail, and delete the e-mail subsequently. Please note that in order to
protect the security of our information systems an AntiSPAM solution is
in use and will browse through incoming emails. <br>
Thank you. <br>
_________________________________________________________________________________________________________________
<br>
<br>
Ce message (ainsi que le(s) fichier(s)), transmis par courriel, peut contenir
des renseignements confidentiels ou protégés et est destiné à l&#8217;usage
exclusif du destinataire ci-dessus. Toute autre personne est, par les présentes,
avisée qu&#8217;il est strictement interdit de le diffuser, le distribuer ou
le reproduire. Si vous l&#8217;avez reçu par inadvertance, veuillez nous en
aviser et détruire ce message. Veuillez prendre note qu'une solution antipollupostage
(AntiSPAM) est utilisée afin d'assurer la sécurité de nos systèmes d'information
et qu'elle furètera les courriels entrants.<br>
Merci. <br>
_________________________________________________________________________________________________________________
<br>
<br>
</font>