[omniORB] Memory leak with omniORB when calling ORB::run() from non-omni-thread

Martin B. 0xCDCDCDCD at gmx.at
Mon Dec 20 11:38:53 GMT 2010


Greetings!

I have the following issue with omniORB 4.1.2 (omniThread 3.3) (as far 
as I can see from SVN, the code in question isn't changed in 4.1.4):

We call ORB::run() from a thread that was not created as an omni_thread 
(created by _beginthreadex on Windows).

I have now noticed a memory leak due to this, specifically the 
_internal_omni_thread_dummy object created by the call to 
omni_condition::wait() in omniOrbORB::run() (line 819/820) is never 
free'd as far as I can see.

The current revision of this file is located at:

http://omniorb.svn.sourceforge.net/viewvc/omniorb/branches/4_1/omniORB/src/lib/omnithread/nt.cc?revision=5903&view=markup

The object is allocated at line 123, but see the whole code block 
starting at the comment at line 90.


My questions regd this would be:

1) Is this leak intentional or an oversight?
2) Is there actually a leak or am I doing something wrong? (apart from 
the fact that I call run() from a non-omni-thread thread, which I am not 
sure is "suppoerted")
3) I can think of the following fixes, please comment:
   3.1) Call run from an omni_thread
   3.2) Call create_dummy() before calling run and then call 
release_dummy() after calling run() -- this way 
_internal_omni_thread_dummy should not be allocated.
   3.3) Fix the code so that _internal_omni_thread_helper::cache is 
cleaned up before process exit -- obviously I would like to avoid 
modding anything in the omniORB sources just for me, but if someone can 
acknowledge this leak I might be tempted to try a patch.

any help appreciated,
best regards,
- Martin



More information about the omniORB-list mailing list