logging-log4cxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From prakash kadam <prakash_f_ka...@walla.com>
Subject Freeing Non Heap memory problem
Date Sun, 17 Apr 2005 05:38:41 GMT

<BODY oncontextmenu="return false" dir=ltr style="OVERFLOW-Y: scroll" leftMargin=0 topMargin=0
rightMargin=0><DIV id=wrteplaceholder style="FONT-FAMILY: Arial" name="wrteplaceholder">
<DIV><BR>Hi ,<BR><BR>&nbsp;I am testing memory leak of log4cxx
using purify&nbsp; utility and i am getting error like<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
FNH: Freeing non heap memory (2 times)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
This is occurring while in:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
realloc&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [rtlib.o]<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
putenv&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [libc.so.1]<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
log4cxx::helpers::TimeZone::TimeZone(const std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt;
&gt;&amp;) [timezone.cpp:46]<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
*** WARNING: Source file is newer, display may be incorrect<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
USES_CONVERSION;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
::putenv((char *)T2A(timeZoneEnv.c_str()));<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
=&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
int i;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
tzset();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
time_t now = time(0);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
log4cxx::helpers::ObjectPtrT&lt;log4cxx::helpers::TimeZone&gt;log4cxx::helpers::TimeZone::getTimeZone(const
std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt;
&gt;&amp;) [timezone.cpp:105]<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
void log4cxx::helpers::PatternParser::finalizeConverter(char) [patternparser.cpp:265]<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
log4cxx::helpers::ObjectPtrT&lt;log4cxx::helpers::PatternConverter&gt;log4cxx::helpers::PatternParser::parse()
[patternparser.cpp:176]<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Attempting
to free block at 0xffbef860 on the stack.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Note: Some 'free's permit freeing such memory, but this is not portable.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
To suppress this error, add 'suppress fnh *' to your .purify file.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
New memory leaked: 271098 bytes (90%); potentially leaked: 1536 bytes (0.51%)<BR><BR><BR><BR>I
think error is with USES_CONVERSION, because USES_CONVERSION allocates memory using alloca
and program free it automatically, but here purify say's that it free's the memory which is
not allocated. How do i over come from this problem.<BR><BR>
<HR>

<DIV>Prakash F. Kadam<BR>ISSC, Pune University</DIV></DIV></DIV></BODY><hr><div
style="background-color:white;color:black;">Walla! Mail - <a href="http://www.walla.com"
style="color:blue">get your free 1G mail today</a></div>
Mime
  • Unnamed multipart/mixed (inline, None, 0 bytes)
    • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message