logging-log4cxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rhys Ulerich <rhys.uler...@gmail.com>
Subject Static destruction fiasco?
Date Sun, 27 Feb 2011 19:25:47 GMT
Hi,

I've noticed that this little test program segfaults beautifully under 0.10

   #include <log4cxx/logger.h>

   log4cxx::LoggerPtr logger;

   int main()
   {
       logger = log4cxx::Logger::getLogger("someName");
       LOG4CXX_WARN(logger, "Stuffstuffstuff");
       // logger = 0;
      return 0;
   }

but if I uncomment the "logger = 0" statement it runs just fine.  Presumably
that's because "logger = 0" forces the ObjectPtrT instance behind LoggerPtr to
destruct logger before other static destruction occurs.

That said, which of
   1) Bug
   2) Don't do that
does that segfault fall into?

Thanks,
Rhys

Mime
View raw message