Log4cxx
  1. Log4cxx
  2. LOGCXX-217

Not initialized LoggerPtr segfault program.

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.10.0
    • Fix Version/s: 0.10.0
    • Component/s: None
    • Labels:
      None
    • Environment:
      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.

        Activity

        Hide
        Samusenko Andre added a comment -

        Today SVN HEAD dont have this problem.
        Problem was in SVN HEAD from 10 Nov 2007.

        Show
        Samusenko Andre added a comment - Today SVN HEAD dont have this problem. Problem was in SVN HEAD from 10 Nov 2007.
        Hide
        Samusenko Andre added a comment -

        I'am running SVN HEAD from 9 Nov 2007.

        Stack is:
        (gdb) bt
        #0 0xfeffdf8c in apr_atomic_xchg32 (mem=0xfeb90000, val=0) at atomic/unix/apr_atomic.c:349
        #1 0x00010d00 in ~ObjectPtrT (this=0xffbff450) at objectptr.h:110
        #2 0x00010be4 in main (argn=1, argv=0xffbff4cc) at foo.cpp:7
        Current language: auto; currently c

        Now was download today HEAD, will try.

        Show
        Samusenko Andre added a comment - I'am running SVN HEAD from 9 Nov 2007. Stack is: (gdb) bt #0 0xfeffdf8c in apr_atomic_xchg32 (mem=0xfeb90000, val=0) at atomic/unix/apr_atomic.c:349 #1 0x00010d00 in ~ObjectPtrT (this=0xffbff450) at objectptr.h:110 #2 0x00010be4 in main (argn=1, argv=0xffbff4cc) at foo.cpp:7 Current language: auto; currently c Now was download today HEAD, will try.
        Hide
        Curt Arnold added a comment -

        Can you confirm that you are running with the current SVN HEAD? If you are, could you provide a deeper stack trace since I don't see how you would have a call to apr_atomic_xchg32 with your sample code with the current code base.

        If you still have the problem after updating, could you comment out the following section in src/main/cpp/objectptr.cpp

        #elif APR_SIZEOF_VOIDP == 4
        return (void*) apr_atomic_xchg32((volatile apr_uint32_t*) destination,
        (apr_uint32_t) newValue);
        #else

        and see what happens.

        Show
        Curt Arnold added a comment - Can you confirm that you are running with the current SVN HEAD? If you are, could you provide a deeper stack trace since I don't see how you would have a call to apr_atomic_xchg32 with your sample code with the current code base. If you still have the problem after updating, could you comment out the following section in src/main/cpp/objectptr.cpp #elif APR_SIZEOF_VOIDP == 4 return (void*) apr_atomic_xchg32((volatile apr_uint32_t*) destination, (apr_uint32_t) newValue); #else and see what happens.

          People

          • Assignee:
            Curt Arnold
            Reporter:
            Samusenko Andre
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development