logging-log4cxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mathieu Malaterre <mathieu.malate...@gmail.com>
Subject Segmentation fault: apr_pool_create_ex
Date Wed, 15 Jul 2015 07:47:04 GMT
Hi all,

I am trying to understand what is so fundamentally wrong with the following
piece of code (taken from:

If I compile it with (see attached file):

$ g++ -g -o logger log4cxx_crash.cpp -llog4cxx

Here is the crash I get [*]. I did check that this is a different crash
from the one explained in the FAQ:

I've simply moved the initialisation from outside `main()` function to
inside `main()` function. I fail to understand why the order of
initialisation is so important (I could not find anything relevant in the

Thanks for comments, my c++ knowledge would need a refresher.


Using host libthread_db library "/lib64/libthread_db.so.1".
0 [0x7ffff7fb0780] INFO MyApp null - Entering application.
3 [0x7ffff7fb0780] INFO MyApp null - Exiting application.

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff5f69dc9 in apr_pool_create_ex () from /lib64/libapr-1.so.0
Missing separate debuginfos, use: debuginfo-install apr-1.5.1-3.fc21.x86_64
apr-util-1.5.4-1.fc21.x86_64 cyrus-sasl-lib-2.1.26-19.fc21.x86_64
expat-2.1.0-10.fc21.x86_64 libdb-5.3.28-9.fc21.x86_64
libgcc-4.9.2-6.fc21.x86_64 libstdc++-4.9.2-6.fc21.x86_64
libuuid-2.25.2-3.fc21.x86_64 log4cxx-0.10.0-17.fc21.x86_64
nspr-4.10.8-1.fc21.x86_64 nss-3.19.1-1.0.fc21.x86_64
nss-softokn-freebl-3.19.1-1.0.fc21.x86_64 nss-util-3.19.1-1.0.fc21.x86_64
openldap-2.4.40-3.fc21.x86_64 zlib-1.2.8-7.fc21.x86_64
(gdb) bt
#0  0x00007ffff5f69dc9 in apr_pool_create_ex () from /lib64/libapr-1.so.0
#1  0x00007ffff7b26b58 in log4cxx::helpers::Pool::Pool() () from
#2  0x00007ffff7ae06ea in
log4cxx::helpers::MutexException::formatMessage(int) () from
#3  0x00007ffff7ae0786 in
log4cxx::helpers::MutexException::MutexException(int) () from
#4  0x00007ffff7b4a310 in
const&) () from /lib64/liblog4cxx.so.10
#5  0x00007ffff7b5d9c8 in log4cxx::WriterAppender::close() () from
#6  0x00007ffff7ac979c in log4cxx::ConsoleAppender::~ConsoleAppender() ()
from /lib64/liblog4cxx.so.10
#7  0x00007ffff7ac98b9 in log4cxx::ConsoleAppender::~ConsoleAppender() ()
from /lib64/liblog4cxx.so.10
#8  0x00007ffff7aba247 in
log4cxx::helpers::AppenderAttachableImpl::~AppenderAttachableImpl() () from
#9  0x00007ffff7b0494c in log4cxx::Logger::~Logger() () from
#10 0x00007ffff7b388b4 in log4cxx::spi::RootLogger::~RootLogger() () from
#11 0x00007ffff7b0429a in log4cxx::Logger::~Logger() () from
#12 0x00007ffff7b04429 in log4cxx::Logger::~Logger() () from
#13 0x00000000004017c4 in
log4cxx::helpers::ObjectPtrT<log4cxx::Logger>::~ObjectPtrT (this=0x6031a0
<logger>, __in_chrg=<optimized out>) at
#14 0x00007ffff6e38392 in __run_exit_handlers () from /lib64/libc.so.6
#15 0x00007ffff6e383e5 in exit () from /lib64/libc.so.6
#16 0x00007ffff6e1efe7 in __libc_start_main () from /lib64/libc.so.6
#17 0x0000000000401319 in _start ()


View raw message