logging-log4cxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tom Quarendon" <t...@teamwpc.co.uk>
Subject SIGSEGV on log4cxx initialisation
Date Thu, 26 Aug 2004 12:05:02 GMT
Unless I've called some kind of configuration before I call
Logger::getLogger, I seem to get a SIGSEGV. Program continues and works as
expected, it is just an anoyance in a debugger where you get a SIGSEGV
before you get to main. Indeed it's taken me quite a long time to realise
that the segv is caused by log4cxx, and to realise that if you just continue
and ignore it the program works fine.

The sample program I'm using is

#include <log4cxx/Logger.h>
#include <log4cxx/basicconfigurator.h>

using namespace log4cxx;
LoggerPtr logger = Logger::getLogger("a.b");

int main(int argc, char* argv[]) {
	BasicConfigurator::configure();
	logger->fatal("Fatal message");
}

I'm on Windows XP and using Cygwin GCC, and running this through gdb I get 2
segvs before I get to main.

I've just noticed that if I change it to move the "LoggerPtr logger = ..."
line after the BasicConfigurator::configure() call I get the same 2 segvs,
but this time when stepping over the BasicConfigurator::configure call.

I'm not sure how to compile the log4cxx code with debug, so at the moment I
can't give any help on where these segvx are comming from.


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.737 / Virus Database: 491 - Release Date: 11/08/2004


Mime
View raw message