Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[ace-users] ACE_Log_Msg Memory Leak

107 views
Skip to first unread message

subrata majumder

unread,
Jun 19, 2009, 2:05:54 PM6/19/09
to ace-...@list.isis.vanderbilt.edu

ACE VERSION: 5.6.9

HOST MACHINE and OPERATING SYSTEM:
Linux 2.6.9-42.ELsmp #1 SMP Wed Jul 12 23:27:17 EDT 2006 i686 i686 i386 GNU/Linux


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

THE $ACE_ROOT/include/makeinclude/platform_macros.GNU FILE
include $(ACE_ROOT)/include/makeinclude/platform_linux.GNU


DOES THE PROBLEM AFFECT:
COMPILATION? No
I have executed "make inline=0" from $ACE_ROOT and from $TAO_ROOT to compile the ACE and TAO library.
LINKING? No
On Unix systems, did you run make realclean first? No
EXECUTION?
OTHER (please specify)?
My application is affected.

SYNOPSIS:
Memory Leak form ACE_Log_Msg object, purify shows that ACE_Log_Msg is allocated on heap but never released.

DESCRIPTION:
I have noticed this memory leak in 5.5 version. Later I have tried ACE 5.6.1 and 5.6.9 but still I am noticing memory leak
from ACE_Log_Msg. I am using ACE_Log_Msg to log messages to syslog, surprisingly memory leak is not from my logging code.
To confirm this I have put an infinite loop to log messages at the beginning of the main(). There is no memory leak.
Some section of the ACE code is using ACE_Log_Msg object and causing memory leak. Interestingly purify doesn't show complete
stack trace of ACE_Log_Msg allocation.

Is there any solution to avoid this memory leak ?

Thanks
Subrata



Douglas C. Schmidt

unread,
Jun 19, 2009, 2:39:22 PM6/19/09
to subrata majumder, ace-...@list.isis.vanderbilt.edu

Hi Subrata,

Thanks for using the PRF.

You don't provide enough information to give a definitive answer, e.g.,
what does Purify actually show as the source of the leak? At any rate,
my guess is that you're seeing a "leak" with thread-specific storage
that ACE_Log_Msg allocates once when it's first accessed, so this may
not be an issue in practice. If you can provide more detailed info that
shows this is an actual problem that would be helpful.

Thanks,

Doug

Johnny Willemsen

unread,
Jun 22, 2009, 12:36:28 AM6/22/09
to subrata majumder, ace-...@list.isis.vanderbilt.edu
Hi,

We run all tests with purify and valgrind, I don't see a leak as you
suggest. You will need to provide us a regression test in order to analyze
this further.

Johnny

> Thanks
> Subrata
>
>
>
> _______________________________________________
> ace-users mailing list
> ace-...@list.isis.vanderbilt.edu
> http://list.isis.vanderbilt.edu/mailman/listinfo/ace-users

subrata majumder

unread,
Jun 22, 2009, 1:43:36 PM6/22/09
to ace-...@list.isis.vanderbilt.edu, jwill...@remedy.nl

Hi All,

Thanks for prompt reply. I have got purify leak trace from ACE 5.5 version which I am currently using.

Following is the stack trace from purify. Please assist me , Is this leak result of improper uses of ACE ?

MLK: 165360 bytes leaked in 20 blocks
* This memory was allocated from:
malloc [rtlib.o]
operator new(unsigned) [libstdc++.so.6]
ACE_Log_Msg::instance() [libACE.so.5]
ACE_Log_Msg::inherit_hook(ACE_OS_Thread_Descriptor*, ACE_OS_Log_Msg_Attributes&) [libACE.so.5]
ACE_Base_Thread_Adapter::inherit_log_msg() [libACE.so.5]
ACE_Thread_Adapter::invoke() [libACE.so.5]
ace_thread_adapter [libACE.so.5]
start_thread [libpthread.so.0]
clone [libc.so.6]
* Block of 8268 bytes (20 times); last block at 0xa81c570

MLK: 8268 bytes leaked at 0xa314750
* This memory was allocated from:
malloc [rtlib.o]
operator new(unsigned) [libstdc++.so.6]
ACE_Log_Msg::instance() [libACE.so.5]
ACE_Object_Manager::init() [libACE.so.5]
ACE_Object_Manager::ACE_Object_Manager[not-in-charge]() [libACE.so.5]
ACE_Object_Manager::instance() [libACE.so.5]
ACE_Object_Manager_Manager::ACE_Object_Manager_Manager[not-in-charge]() [libACE.so.5]
*unknown func* [pc=0x6313e1]
__do_global_ctors_aux [libACE.so.5]
_init [libACE.so.5]
_dl_init_internal []
_dl_start_user []


Thanks
Subrata

--- On Mon, 6/22/09, Johnny Willemsen <jwill...@remedy.nl> wrote:

Johnny Willemsen

unread,
Jun 22, 2009, 1:47:49 PM6/22/09
to subrata majumder, ace-...@list.isis.vanderbilt.edu
Hi,

Please get logs from ACE 5.6.9

johnny

> -----Original Message-----
> From: subrata majumder [mailto:subra...@yahoo.com]
> Sent: maandag 22 juni 2009 11:44
> To: ace-...@list.isis.vanderbilt.edu; jwill...@remedy.nl
> Subject: RE: [ace-users] ACE_Log_Msg Memory Leak
>
>

Douglas C. Schmidt

unread,
Jun 22, 2009, 1:49:03 PM6/22/09
to subrata majumder, ace-...@list.isis.vanderbilt.edu

Hi Subrata,

> Thanks for prompt reply. I have got purify leak trace from ACE 5.5 version which I am currently using.

That's an old version of ACE. Please upgrade to ACE+TAO+CIAO x.6.9
(i.e., ACE 5.6.9, TAO 1.6.9, and CIAO 0.6.9), which you can download
from

http://download.dre.vanderbilt.edu

under the heading: "Latest Micro Release Kit."

The DOC groups at Washington University, UC Irvine, and Vanderbilt
University only provide "best effort" support for non-sponsors for the
latest release, as described in

http://www.dre.vanderbilt.edu/~schmidt/DOC_ROOT/ACE/docs/ACE-bug-process.html

Thus, if you need more "predictable" help for earlier versions of
ACE+TAO, I recommend that you check out

http://www.dre.vanderbilt.edu/support.html

for a list of companies that will provide you with ACE+TAO commercial
support.

> Following is the stack trace from purify. Please assist me , Is this leak result of improper uses of ACE ?
>
> MLK: 165360 bytes leaked in 20 blocks
> * This memory was allocated from:
> malloc [rtlib.o]
> operator new(unsigned) [libstdc++.so.6]
> ACE_Log_Msg::instance() [libACE.so.5]
> ACE_Log_Msg::inherit_hook(ACE_OS_Thread_Descriptor*, ACE_OS_Log_Msg_Attributes&) [libACE.so.5]
> ACE_Base_Thread_Adapter::inherit_log_msg() [libACE.so.5]
> ACE_Thread_Adapter::invoke() [libACE.so.5]
> ace_thread_adapter [libACE.so.5]
> start_thread [libpthread.so.0]
> clone [libc.so.6]
> * Block of 8268 bytes (20 times); last block at 0xa81c570
>
> MLK: 8268 bytes leaked at 0xa314750
> * This memory was allocated from:
> malloc [rtlib.o]
> operator new(unsigned) [libstdc++.so.6]
> ACE_Log_Msg::instance() [libACE.so.5]
> ACE_Object_Manager::init() [libACE.so.5]
> ACE_Object_Manager::ACE_Object_Manager[not-in-charge]() [libACE.so.5]
> ACE_Object_Manager::instance() [libACE.so.5]

> ACE_Object_Manager_Manager::ACE_Object_Manager_Manager[not-in-charge]() [libACE.so.5]


> *unknown func* [pc=0x6313e1]
> __do_global_ctors_aux [libACE.so.5]
> _init [libACE.so.5]
> _dl_init_internal []
> _dl_start_user []

It looks to me like you're not cleaning up the thread-specific memory
created by ACE_Log_Msg's per-thread singleton. Make sure you call the
ACE::fini() method when you shut down ACE.

Thanks,

Doug

0 new messages