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

Not initialized LoggerPtr segfault program.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.10.0
    • 0.10.0
    • None
    • None
    • SunOS 5.9
      gcc-3.4.6
      apr-1.2.8
      apr-iconv-1.1.1
      apr-util-1.2.8

    Description

      #include <log4cxx/logger.h>
      using namespace log4cxx;

      int main(int argn, char* argv[])
      {
      LoggerPtr logger;
      return 0;
      }

      This code crash program.
      Compile as "g++ foo.cpp -llog4cxx".
      >./a.out
      Segmentation Fault (core dumped)

      gdb a.out core:
      #0 0xfefedf8c in apr_atomic_xchg32 (mem=0x0, val=0) at atomic/unix/apr_atomic.c:349
      349 atomic/unix/apr_atomic.c: No such file or directory.
      in atomic/unix/apr_atomic.c

      APR compiled by this gcc from sources.

      Problem was found, when i have made daemon with fork() and exit(0). In this case LoggerPtr using as global object.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: