[ace-users] ACE_TP_Reactor:random crash sometimes

Mihai Bucica misu200 at yahoo.com
Tue Jun 12 05:16:46 CDT 2007


--- "Douglas C. Schmidt" <schmidt at dre.vanderbilt.edu>
wrote:
> >     ACE VERSION: 5.5
> 
> ACE 5.5 is rather old, so could you please try
> upgrading to ACE+TAO+CIAO


I've compiled it the latest beta kit ACE 5.5.8 and the
issue is valid.

PRF:

    ACE_TP_Reactor:random crash sometimes 

    ACE VERSION: 5.5.8 (latest beta kit)

    HOST MACHINE and OPERATING SYSTEM:
      AMD Turion 64 & Windows XP Pro 32

    COMPILER NAME AND VERSION (AND PATCHLEVEL):
      Microsoft Visual C++ .NET 2003

    THE $ACE_ROOT/ace/config.h FILE : 
      #include "ace/config-win32.h"

    AREA/CLASS/EXAMPLE AFFECTED:
      ACE_TP_Reactor & Acceptor
 
    DOES THE PROBLEM AFFECT:
      EXECUTION
      
    SYNOPSIS:
      sometimes one thread from ACE_TP_Reactor' pool
is trying to access a recently removed handle 
    
    DESCRIPTION:
      I'm trying to build a server starting from
examples/APG/TreadPools/TP_Reactor project and I've
performed the following small modifications:
      I've added a 'ACE_Reactor_Notification_Strategy
_notifier' to our Request_Handler class and also done
the proper initialization stuff:
      
      Request_Handler: notifier_ (0, this,
ACE_Event_Handler::WRITE_MASK)
      Request_Handler::open -> this->notifier_.reactor
(this->reactor ());
                               this->msg_queue
()->notification_strategy (&this->notifier_);   
   
      I'm also doing a strange thing in handle_input()

      int Request_Handler::handle_input() {
        ..............
        ACE_Message_Block *mb = new
ACE_Message_Block(sizeof(buffer)+1);
        mb->copy(buffer,sizeof(buffer));
        this->putq(mb); 
  
        return -1; 
      }
      
      int Request_Handler::handle_close (ACE_HANDLE
fd, ACE_Reactor_Mask)
      {
        ACE_DEBUG ((LM_DEBUG,
              ACE_TEXT ("(%t) svr close; fd: 0x%x\n"),
              fd));

        return super::handle_close();
      }

      This will cause the program to crash
sometimes.The 'handle' is removed from reactor and
deleted but another thread from the thread pool will
try to output our ACE_Message_Block object from the
event handler internal queue.   
      (5200) handling events ....
      (3672) handling events ....
      (5676) handling events ....
        Request_Handler::open
      (3672) handling events ....
      (5676) handling events ....
      (5200) handling events ....
      (3672) svr input; fd: 0x6d8; input: e
      (3672) svr close; fd: 0x6d8
      (3672) ~Request_Handler()
      (3672) handling events ....
      (5200) handling events .... !!! HERE IT CRASHES
because the thread 5200 is trying to access the
previous deleted Request_Handler() object because he
tries to output our ACE_Message_Block object from the
event handler internal queue !!!!
      
      



 
____________________________________________________________________________________
Never miss an email again!
Yahoo! Toolbar alerts you the instant new Mail arrives.
http://tools.search.yahoo.com/toolbar/features/mail/



More information about the Ace-users mailing list