Uploaded image for project: 'Log4cxx'
  1. Log4cxx
  2. LOGCXX-154

PropertyConfigurator::configure kill application

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 0.9.7
    • Fix Version/s: 0.10.0
    • Component/s: Configurator
    • Labels:
      None
    • Environment:
      Solaris 9 gcc3.4.5

      Description

      Application have segfault or bus error with backtrace:
      #0 0xfdf47958 in t_delete () from /usr/lib/libc.so.1
      #1 0xfdf475f4 in realfree () from /usr/lib/libc.so.1
      #2 0xfdf47e64 in cleanfree () from /usr/lib/libc.so.1
      #3 0xfdf46fa0 in _malloc_unlocked () from /usr/lib/libc.so.1
      #4 0xfdf46e80 in malloc () from /usr/lib/libc.so.1
      #5 0xff0bb714 in operator new (sz=24) at ../../../../libstdc+-v3/libsupc+/new_op.cc:48
      #6 0xff2a6f94 in TimeZone (this=0x651a0, ID=@0xffbf96f4) at timezone.cpp:49
      #7 0xff2a7168 in log4cxx::helpers::TimeZone::getTimeZone (ID=@0xffbf96f4) at timezone.cpp:91
      #8 0xff287ab8 in log4cxx::helpers::PatternParser::finalizeConverter (this=0xffbf9620, c=100 'd') at patternparser.cpp:256
      #9 0xff288654 in log4cxx::helpers::PatternParser::parse (this=0xffbf9620) at patternparser.cpp:187
      #10 0xff284798 in log4cxx::PatternLayout::createPatternParser (this=0xffbf9768, pattern=@0x64eec) at patternlayout.cpp:71
      #11 0xff28491c in log4cxx::PatternLayout::activateOptions (this=0x64e38) at objectptr.h:97
      #12 0xff28ffd0 in log4cxx::config::PropertySetter::activate (this=0xffbf9900) at objectptr.h:85
      #13 0xff290740 in log4cxx::config::PropertySetter::setProperties (this=0xffbf9900, properties=@0xffbfa1d0, prefix=@0xffbf9980) at propertysetter.cpp:71
      #14 0xff290a8c in log4cxx::config::PropertySetter::setProperties (properties=@0xffbfa1d0, prefix=@0xffbf9980) at objectptr.h:77
      #15 0xff28b8f8 in log4cxx::PropertyConfigurator::parseAppender (this=0xffbfa258, props=@0xffbfa1d0, appenderName=@0xffbf9a50) at basic_string.h:2020
      #16 0xff28be54 in log4cxx::PropertyConfigurator::parseCategory (this=0xffbfa258, props=@0xffbfa1d0, logger=@0xffbf9b18, optionKey=@0xffbf9a80,
      loggerName=@0xff325944, value=@0xffbf9b38) at objectptr.h:97
      #17 0xff28d52c in log4cxx::PropertyConfigurator::configureRootCategory (this=0xffbfa258, props=@0xffbfa1d0, hierarchy=@0x64234)
      at propertyconfigurator.cpp:213
      #18 0xff28d940 in log4cxx::PropertyConfigurator::doConfigure (this=0xffbfa258, properties=@0xffbfa1d0, hierarchy=@0x64234) at propertyconfigurator.cpp:166
      #19 0xff28e64c in log4cxx::PropertyConfigurator::doConfigure (this=0xffbfa258, configFileName=@0xffbff5f0, hierarchy=@0x64234)
      at propertyconfigurator.cpp:119
      #20 0xff28eb38 in log4cxx::PropertyConfigurator::configure (configFilename=@0xffbff5f0) at propertyconfigurator.cpp:124

      when log4j.appender.A1.layout.ConversionPattern content "%d" (e.g. %d [%t] %-5p %c - %m%n) and program invoked with arguments (e.g. "-m 3").

      Program example:
      #include <log4cxx/logger.h>
      #include <log4cxx/propertyconfigurator.h>

      log4cxx::LoggerPtr logger(log4cxx::Logger::getLogger("main"));

      int main(int argc, char *argv[])
      {
      log4cxx::PropertyConfigurator::configure("log4cxx.properties");

      logger->error( "sss" );

      return 0;
      }

      log4cxx config file example:
      log4j.rootLogger=DEBUG, A1

      log4j.appender.A1=org.apache.log4j.ConsoleAppender
      log4j.appender.A1.layout=org.apache.log4j.PatternLayout
      log4j.appender.A1.layout.ConversionPattern=%d [%t] %-5p %c - %m%n

      log4j.logger.main=DEBUG

        Attachments

          Activity

            People

            • Assignee:
              carnold@apache.org Curt Arnold
              Reporter:
              dronord Samusenko Andre
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: