[Ace-users] TAO_AMH_DSI_Exception_Holder usage ...clarification requested

Venkat swara101 at yahoo.com
Thu Nov 1 22:34:10 CDT 2007


Hello TAO team,

Following is the PRF details for the problem:

TAO VERSION: 1.6.1
ACE VERSION: 5.6.1

HOST MACHINE and OPERATING SYSTEM:
amd64, NetBSD 3.1

TARGET MACHINE and OPERATING SYSTEM, if different from HOST:
same
THE $ACE_ROOT/ace/config.h FILE [if you use a link to a platform-
specific file, simply state which one]:
config-netbsd.h

THE $ACE_ROOT/include/makeinclude/platform_macros.GNU FILE :
platform_netbsd.GNU
CONTENTS OF $ACE_ROOT/bin/MakeProjectCreator/config/default.features
ssl=1

AREA/CLASS/EXAMPLE AFFECTED:
COMPILATION? No
LINKING? No
EXECUTION? No

SYNOPSIS:

    Incorrect usage or memory leak of TAO_AMH_DSI_Exception_Holder?

DESCRIPTION:

Example: TAO/tests/DSI_AMI_Gateway/My_DII_Reply_Handler.cpp

void
My_DII_Reply_Handler::handle_response(TAO_InputCDR &incoming)
{   .............

   TAO_AMH_DSI_Exception_Holder h (new CORBA::UNKNOWN());  // Heap
allocated
    response_handler_->invoke_excep(&h);

BUT  it is not released by the holder;

TAO/tao/DynamicInterface/AMH_DSI_Response_Handler.*

TAO_AMH_DSI_Exception_Holder::TAO_AMH_DSI_Exception_Holder
(CORBA::Exception *ex)
  : exception_ (ex)


private:
  TAO_AMH_DSI_Exception_Holder (const TAO_AMH_DSI_Exception_Holder &);
  void operator= (const TAO_AMH_DSI_Exception_Holder &);
  CORBA::Exception *exception_;

--------------
It is not clear what is the right usage. If the Holder is not supposed
to release it, then test code has a memory leak. This seems to be the
problem. But if the lifetime of the exception held by the Holder is
beyond the creation, then Holder has incorrect implementation.

Pls. clarify which one is the right interpretation?

REPEAT BY:
SAMPLE FIX/WORKAROUND:

Thanks
Venakt



More information about the Ace-users mailing list