Hi ,

 I am testing memory leak of log4cxx using purify  utility and i am getting error like
      FNH: Freeing non heap memory (2 times)
      This is occurring while in:
            realloc        [rtlib.o]
            putenv         [libc.so.1]
            log4cxx::helpers::TimeZone::TimeZone(const std::basic_string<char,std::char_traits<char>,std::allocator<char> >&) [timezone.cpp:46]
               *** WARNING: Source file is newer, display may be incorrect
              
                       USES_CONVERSION;
                       ::putenv((char *)T2A(timeZoneEnv.c_str()));
            =>         int i;
                       tzset();
              
                       time_t now = time(0);
            log4cxx::helpers::ObjectPtrT<log4cxx::helpers::TimeZone>log4cxx::helpers::TimeZone::getTimeZone(const std::basic_string<char,std::char_traits<char>,std::allocator<char> >&) [timezone.cpp:105]
            void log4cxx::helpers::PatternParser::finalizeConverter(char) [patternparser.cpp:265]
            log4cxx::helpers::ObjectPtrT<log4cxx::helpers::PatternConverter>log4cxx::helpers::PatternParser::parse() [patternparser.cpp:176]
      Attempting to free block at 0xffbef860 on the stack.
      Note: Some 'free's permit freeing such memory, but this is not portable.
      To suppress this error, add 'suppress fnh *' to your .purify file.
      New memory leaked: 271098 bytes (90%); potentially leaked: 1536 bytes (0.51%)



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.


Prakash F. Kadam
ISSC, Pune University

Reply via email to