Bug 592

Summary: [Alleged] memory leak in TAO_ECG_UDP_Receiver::handle_input()
Product: TAO Reporter: tomz
Component: Real-Time Event ServiceAssignee: DOC Center Support List (internal) <tao-support>
Status: ASSIGNED ---    
Severity: normal    
Priority: P3    
Version: 1.1   
Hardware: All   
OS: All   

Description tomz 2000-06-14 19:30:45 CDT
Originally posted to tao-users June 6, 2000:

TAO VERSION:  1.1 (also in 1.1.3)
ACE VERSION:  5.1

HOST MACHINE and OPERATING SYSTEM:  Pentium II, WinNT 4.0 SP3
TARGET MACHINE and OPERATING SYSTEM, if different from HOST:  same
COMPILER NAME AND VERSION (AND PATCHLEVEL):  DevStudio 6.0 SP3

       Also, my config.h contains:
          #define ACE_HAS_STANDARD_CPP_LIBRARY 1
          #define ACE_HAS_MFC 1
          #include "ace/config-win32.h"


AREA/CLASS/EXAMPLE AFFECTED:  RTEC's UDP gateway


DOES THE PROBLEM AFFECT:
    COMPILATION?  No
    LINKING?      No
    EXECUTION?    Yes
    OTHER (please specify)?


SYNOPSIS:
Memory leak in TAO_ECG_UDP_Receiver::handle_input().


DESCRIPTION:
When msgs are fragmented handle_input() adds the fragments to the receiver's
hash map but never deletes them.


REPEAT BY:
I don't see any TAO test/example that uses the UDP gateway.  I haven't taken
the time to create an example but can do so if needed to illustrate the prob-
lem.
[LATER CORRECTION:  BCast and other tests do use the UDP gateway.  Release
 builds of BCast do not leak for me, but I doubt it's sending msgs large e-
 nough to be fragmented in the first place.  Debug builds leak big-time but
 that may have other source(s).

 Also, we have modified the RTEC IDL to include a String and another Long in
 the event header, but I believe the info in this report is still applicable.
]

SAMPLE FIX/WORKAROUND:
After the push() to the consumer proxy:

         this->consumer_proxy_->push (event, ACE_TRY_ENV);

I added:

         TAO_ECG_UDP_Request_Entry* request_entry = entry->int_id_;
         this->request_map_.unbind(entry);
         delete request_entry;

Not sure if these are EXACTLY proper; for example I may be using the wrong
unbind().  But it should be close.
Comment 1 Carlos O'Ryan 2000-06-16 17:09:12 CDT
Will review later this summer.
Comment 2 Carlos O'Ryan 2003-04-02 12:26:25 CST
I will never have time to work on these bugs.  Returning them to the TAO support
pool.
Comment 3 Nanbor Wang 2003-04-13 19:20:25 CDT
Accept for tao-support
Comment 4 Johnny Willemsen 2003-08-09 12:49:02 CDT
The fix is not in the code, but a lot of things changed in the RTEC recently. 
Do you know if this still happens with the latest version of ACE and TAO?