[Ace-users] [ace-users] ~ACE_Reactor crashes under Win32

Douglas C. Schmidt schmidt at dre.vanderbilt.edu
Thu Nov 15 08:32:27 CST 2007


Hi Folks,

> "Vial, Florent" <fvial at arri.de> writes:
> > Everything goes fine from the functionality point of view.
> > When I close the application, the destructor of the client calls
> > ACE_Reactor::notify() on the reactor, and wait().
> > This goes fine, but when the destructor of ACE_Reactor is called, there
> > is a crash happening with the very clear message "0xC0000005: Access
> > violation reading location 0x04f9fad0".
> > This corresponds to the line :
> >
> > ACE_Event_Handler::Reference_Counting_Policy::Value
> > ACE_Event_Handler::Reference_Counting_Policy::value (void) const
> > {
> >   return this->value_;
> > }
> >
> >
> > The call stack is following :
> >
> > ACEd.dll: ACE_Event_Handler::Reference_Counting_Policy::value()  Line
> > 232 + 0x3 bytes
> > ACEd.dll:
> > ACE_WFMO_Reactor_Handler_Repository::make_changes_in_current_infos()
> > Line 777 + 0xf bytes
> > ACEd.dll: ACE_WFMO_Reactor_Handler_Repository::make_changes()  Line 417
> > ACEd.dll: ACE_WFMO_Reactor::~ACE_WFMO_Reactor()  Line 1332 + 0x19 bytes
> > ACEd.dll: ACE_WFMO_Reactor::`vector deleting destructor'()  + 0x6c bytes
> > ACEd.dll: ACE_Reactor::~ACE_Reactor()  Line 123 + 0x39 bytes
> > MyApp.exe: MyClass::MyClientTask::~MyClientTask()  Line 50 + 0x15 bytes
> >
> > Anyone would have a clue of what might go wrong ?
> > Thank you in advance,
> 
> Hi,
> 
> In the future, please use the PROBLEM-REPORT-FORM in the ACE_wrappers
> directory when asking questions.  Without this info, we have to guess
> what version/platform/compiler/options you are using, which is very
> error prone and slows down our responsiveness.
> 
> It appears that your crash occurs when the reactor trys to access the
> reference count of your event handler object.  Since this happens in
> destruction, my suspicion is that the event handler has already been
> destructed even though it's still registered with the reactor.  Take a
> second look at the object lifecycle of your event handlers and your
> reactor and see if anything jumps out.

Right!  BTW, Florent, please see Chapter 4 o C++NPv2
<www.cs.wustl.edu/~schmidt/ACE/book2/> for info on how to manage the
lifecycle of event handlers with the ACE_WFMO_Reactor.

Thanks,

        Doug



More information about the Ace-users mailing list