I'm trying to narrowing down my problem and find that the following code crashes with signal 11, but eliminating the `//' on the sixth line make it run without any problem. Could anyone please give me a clue?
--kiyoshi #include <log4cxx/logger.h> #include <log4cxx/basicconfigurator.h> #include <log4cxx/propertyconfigurator.h> #include <iostream> // static log4cxx::LoggerPtr s_message = log4cxx::Logger::getLogger("root"); class baz { public: ~baz() { std::cout << "baz::~baz()" << std::endl; LOG4CXX_FATAL(log4cxx::Logger::getLogger("root"), "~baz()"); } } s_baz; int main(int, char**) { log4cxx::BasicConfigurator::configure(); return EXIT_SUCCESS; } On Sun, Mar 2, 2008 at 8:59 PM, Kiyoshi Mizumaru <[EMAIL PROTECTED]> wrote: > Hi > > A program linked with log4cxx caught signal 11. > It uses some RollingFileAppender object, instanciated via > PropertyConfigurator::configure and I believe problem occurs > while exiting the program (I found the last line in main() > function executed correctly, by using gdb). > > Could anyone please let me know how to solve the problem or > any workaround? My log4cxx is built from > http://svn.apache.org/repos/asf/logging/log4cxx/trunk, > Revision: 632740. > > Thanks in advance, > Kiyoshi > > > Program received signal SIGSEGV, Segmentation fault. > [Switching to Thread 182908034112 (LWP 14481)] > apr_pool_create_ex (newpool=0x7fbffff340, parent=0x516288, abort_fn=0, > allocator=0x512170) at memory/unix/apr_pools.c:249 > 249 if ((*ref = node->next) == NULL && i >= max_index) { > Current language: auto; currently c > (gdb) bt > #0 apr_pool_create_ex (newpool=0x7fbffff340, parent=0x516288, > abort_fn=0, allocator=0x512170) at memory/unix/apr_pools.c:249 > #1 0x0000002a956a5fe0 in log4cxx::helpers::Pool::Pool () at > > /usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_iterator.h:759 > #2 0x0000002a95656bbc in log4cxx::helpers::IOException::formatMessage > (stat=9) at exception.cpp:139 > #3 0x0000002a95658103 in IOException (this=0x533aa0, stat=Variable > "stat" is not available. > ) at exception.cpp:120 > #4 0x0000002a956604df in log4cxx::helpers::FileOutputStream::close > (this=0x522030) at fileoutputstream.cpp:71 > #5 0x0000002a956b519e in > log4cxx::rolling::CountingOutputStream::close (this=0x52ab60, > p=Variable "p" is not available. > ) at ../../../src/main/include/log4cxx/helpers/objectptr.h:157 > #6 0x0000002a956e110f in log4cxx::WriterAppender::closeWriter > (this=0x5229e0) at > ../../../src/main/include/log4cxx/helpers/objectptr.h:157 > #7 0x0000002a956e1222 in log4cxx::WriterAppender::close > (this=0x5229e0) at writerappender.cpp:143 > #8 0x0000002a9565c403 in ~FileAppender (this=0x5229e0, > __vtt_parm=0x2a958448f0) at fileappender.cpp:88 > #9 0x0000002a95641316 in ~RollingFileAppenderSkeleton (this=0x5229e0, > __vtt_parm=0x2a958448e8) at > ../../../src/main/include/log4cxx/helpers/objectptr.h:100 > #10 0x0000002a95696784 in ~RollingFileAppender (this=0x5229e0) at > obsoleterollingfileappender.cpp:87 > #11 0x0000002a9562b84a in ~ObjectPtrT (this=0x5329f0) at > ../../../src/main/include/log4cxx/helpers/objectptr.h:100 > #12 0x0000002a9562c38e in ~AppenderAttachableImpl (this=0x5220c0) at > > /usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_construct.h:107 > #13 0x0000002a9568055c in ~Logger (this=0x51a330, __vtt_parm=Variable > "__vtt_parm" is not available. > ) at ../../../src/main/include/log4cxx/helpers/objectptr.h:100 > #14 0x0000002a956b8634 in ~RootLogger (this=0x51a330) at rootlogger.cpp:48 > #15 0x0000002a95bf5e43 in __tcf_0 () at > /Proj/07057/tools/include/log4cxx/helpers/objectptr.h:100 > #16 0x000000388c830f2b in __cxa_finalize () from /lib64/tls/libc.so.6 > #17 0x0000002a95bc1073 in __do_global_dtors_aux () from > /home/maru/branch-log4cxx/monaco/test/stage/lib/libMonacoCommon.so.0 > #18 0x0000007fbffff730 in ?? () > #19 0x0000002a95bfc601 in _fini () from > /home/maru/branch-log4cxx/monaco/test/stage/lib/libMonacoCommon.so.0 > #20 0x0000000000000013 in ?? () > #21 0x000000388c60b29b in _dl_fini () from /lib64/ld-linux-x86-64.so.2 > Previous frame inner to this frame (corrupt stack?) > (gdb) >