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

crash on program exit

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Duplicate
    • 0.10.0
    • None
    • Core
    • None
    • Linux with g++ 4.4.1

    Description

      I will attach a test program once I submitted the bug report.

      If it is compiled the like the following

      g++ Foo.cpp log4cxxtest.cpp -llog4cxx -o crash

      it crashes. Here is the output of gdb:

      > gdb ./crash
      (gdb) r
      Starting program: /home/tz/develop/astaro/crash
      [Thread debugging using libthread_db enabled]
      Foo(2) 0x616490
      0 [0x7ffff7fcf750] DEBUG Foo null - Foo()
      ~Foo(2) 0x616490

      Program received signal SIGSEGV, Segmentation fault.
      0x00007ffff7dc9230 in vtable for log4cxx::helpers::ObjectPtrBase () from /usr/lib/liblog4cxx.so.10
      (gdb) bt
      #0 0x00007ffff7dc9230 in vtable for log4cxx::helpers::ObjectPtrBase () from /usr/lib/liblog4cxx.so.10
      #1 0x00007ffff7b19958 in log4cxx::Logger::isDebugEnabled() const () from /usr/lib/liblog4cxx.so.10
      #2 0x0000000000401a71 in Foo::~Foo() ()
      #3 0x0000000000402033 in std::auto_ptr<Foo>::~auto_ptr() ()
      #4 0x00007ffff6f1cc12 in __run_exit_handlers (status=0) at exit.c:78
      #5 *__GI_exit (status=0) at exit.c:100
      #6 0x00007ffff6f02ac4 in __libc_start_main (main=<value optimized out>, argc=<value optimized out>, ubp_av=<value optimized out>,
      init=<value optimized out>, fini=<value optimized out>, rtld_fini=<value optimized out>, stack_end=0x7fffffffe298)
      at libc-start.c:252
      #7 0x0000000000401539 in _start () at ../sysdeps/x86_64/elf/start.S:113
      (gdb)

      If the order is changed to the following

      > g++ log4cxxtest.cpp Foo.cpp -llog4cxx -o nocrash
      > ./nocrash
      Foo(2) 0xd86490
      0 [0x7f7ad0061750] DEBUG Foo null - Foo()
      ~Foo(2) 0xd86490
      0 [0x7f7ad0061750] DEBUG Foo null - ~Foo()

      all works without problems.

      Attachments

        1. test.tgz
          1 kB
          Thorsten Zachmann

        Issue Links

          Activity

            People

              carnold@apache.org Curt Arnold
              zagge Thorsten Zachmann
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: