logging-log4cxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tomislav Petrović <t.petro...@inet.hr>
Subject Re: log4cxx::LoggerPtr becoming NULL
Date Tue, 19 Feb 2008 11:08:31 GMT
Curt Arnold said on 19.2.2008 10:15:

First of all, many many thanks for your prompt responses.

> On Feb 19, 2008, at 2:07 AM, Tomislav Petrović wrote:
>> Unfortunately it is not that simple :). MyClass instance is very much
>> alive :(.
>> Inside one of the MyClass methods, for example I have code like this:
>> LOG4CXX_DEBUG(logger, "log something")
>> simple statement (or few statements) which does not do anything with 
>> logger
>> LOG4CXX_DEBUG(logger, "log something else")
> Is "logger" a static class member, class member, or an local variable?  
> You said in your other message that would might be calling 
> Logger::getLogger() from many threads which would not be the case if you 
> were using a static class member.

logger is a class member being initialized with Logger::getLogger() in 
some initialization method of class, this initialization method is 
called for each class instance once in separate thread so there is 
possibility that two instances have their initialization methods called

So since we are using revision 474761 (sorry missed last 1 in first 
post), is it possible this is related to 
https://issues.apache.org/jira/browse/LOGCXX-132? In which revision 
where problems described there fixed?

> Don't know how cooperative your client is, but having someone being able 
> to reproduce the problem is key to figuring out how to avoid it.  Some 
> possible experiments would be:
> 1. Attempt to substantially reduce or  eliminate calls to 
> Logger::getLogger() on non-main threads and see if the problem goes away.
> 2. Update to SVN HEAD and see if the problem goes away.
> 3. Fabricate a test case that mimics the logging behavior of the 
> application and attach to a bug report.  If the code can run or easily 
> be ported to Linux, I could run it under helgrind to check for 
> synchronization issues.  It would also be be useful to know: does the 
> code fail on the client's machine with your snapshot of log4cxx and does 
> it fail when built with the current head.

Code fails on client machine with our snapshot (revision 474761).

I'll think about all of those possibilities and see which I can try with 
the client, thanks.

Tomy <t.petrovic@inet.hr>

View raw message