Hello,

I noticed that log4cxx (SVN r677817) crashes (Segmentation Fault)
when trying to log from an exit-handler. The code below reproduces the crash:

#include <stdlib.h>
#include <log4cxx/logger.h>
#include <log4cxx/basicconfigurator.h>

static log4cxx::LoggerPtr log;

static void cleanup() {
        LOG4CXX_DEBUG(log, "Oops...");
}

int main(int argc, char **argv) {
        atexit(cleanup);
        log4cxx::BasicConfigurator::configure();
        log = log4cxx::Logger::getLogger("main");
        atexit(cleanup);
        return 0;
}

Is this a bug in log4cxx or should one expect this behavior? If its
expected: Is there a workaround for this problem (getting rid of
'atexit()' is not an option...).

Thanks,

- Michel

Reply via email to