logging-log4cxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Curt Arnold <carn...@apache.org>
Subject Re: log4cxx crashing when used in 'atexit' function.
Date Sat, 30 Aug 2008 04:07:01 GMT
It always helps if you can specify the compiler and operating system
and a stack trace would also be nice.

Since it is the start of a holiday weekend is the USA, it may be a
while before somebody ged around to looking at the issue.

One likely  possibility is that APR may have already shut down.  
Calling apr after
a call to apr_terminate would likely seg fault.  If you have the  
ability to debug, setting a break point on the atexit and  
apr_terminate and seeing which gets called first and what triggers the  
apr_terminate would be helpful.


On Aug 29, 2008, at 2:46 PM, Michel Marti wrote:

> 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
>


Mime
View raw message