On Tuesday 16 April 2013 16:03:56 Jason Roehm wrote:
With that said, I'm now experiencing a segfault at shutdown. It appears down in the text_file_backend code:
However, I don't see this problem with any examples that I've tried, so it's not clear to me where the problem is. The crash is down in boost::filesystem. I'm not sure whether it's trying to access some resource too late in the shutdown process or what.
Well, from the backtrace it seems like the library tries to perform the last file rotation and calls filesystem::path::parent_path at some point, which tries to construct a path and access a locale facet for character code conversion. The problem is that the locale is stored as a function-local static in Boost.Filesystem and is destroyed at this point. I think this should be reported to Boost.Filesystem maintainer as this limitation with a global locale is quite unexpected from a user's standpoint. I think there is also a thread safety issue related to it that I reported quite some time ago, and it is still not fixed. As for Boost.Log, I'm not sure I can work it around in my code, except to avoid using Boost.Filesystem, which would be unfortunate. You can try to work around it on yor side though. If you access filesystem::path in the way so that the locale gets initialized _before_ you make any use of Boost.Log, then the locale should still be valid when Boost.Log is deinitialized.
On a side note, I wanted to point out that Boost.Log looks fantastic. It may seem a bit complex at first, but the amount of flexibility and extensibility is well beyond any other logging facility I've seen before.
Thank you for the kind words.