I have been unable to reproduce the problem on Ubuntu Linux 6.06-1
and gcc 4.0.3 running under VMWare Fusion on Mac OS/X either in
single processor or double processor mode. That is the glorious
thing about race conditions, the slightly little change might hide
them. Thanks for the output when you were seeing corruption, it at
least suggests that the problem isn't in the layout since all the
bogus characters appear between perfectly formatted messages. That
suggests that the problem is in the FileAppender or probably more
likely in the CharsetEncoder or CharsetDecoder.
I won't be able to work on it until Monday, however it would be
helpful to know if setting LOG4CXX_LOCALE_ENCODING_UTF8=1 (which will
replace the APR encoders/decoders with straight byte copies) or the
equivalent manual hack to src/charsetencoder.cpp and src/
charsetdecoder.cpp changes the behavior.
I've also run the helgrind tool from valgrind 2.2.0 and generated a
report of possible race conditions in the executed code, but I
haven't had time to review them yet.