1
thread #11: tid = 0x82c51, 0x30fc99f8 libsystem_c.dylib`flockfile, stop reason = EXC_BAD_ACCESS (code=1, address=0x38)
 frame #0: 0x30fc99f8 libsystem_c.dylib`flockfile
 frame #1: 0x30ffd690 libsystem_c.dylib`fseeko + 60
 frame #2: 0x00205310 `std::__1::basic_filebuf<char, std::__1::char_traits<char> >::seekoff(long long, std::__1::ios_base::seekdir, unsigned int) + 516
 frame #3: 0x001d8186 `log4cplus::RollingFileAppender::append(log4cplus::spi::InternalLoggingEvent const&) + 746
 frame #4: 0x001c0758 `log4cplus::Appender::doAppend(log4cplus::spi::InternalLoggingEvent const&) + 484
 frame #5: 0x001c232c `log4cplus::helpers::AppenderAttachableImpl::appendLoopOnAppenders(log4cplus::spi::InternalLoggingEvent const&) const + 336
 frame #6: 0x001eea3a `log4cplus::spi::LoggerImpl::callAppenders(log4cplus::spi::InternalLoggingEvent const&) + 138
 frame #7: 0x001eef9e `log4cplus::spi::LoggerImpl::forcedLog(log4cplus::spi::InternalLoggingEvent const&) + 26
 frame #8: 0x001ee200 `log4cplus::Logger::forcedLog(log4cplus::spi::InternalLoggingEvent const&) const + 28
 frame #9: 0x001f0b94 `log4cplus::detail::macro_forced_log(log4cplus::Logger const&, int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, char const*, int, char const*) + 160
  • 以上是ios App中log4cplus crash的日志。我设置了 FileMaxSize = 500Kb 和 MaxBackUp = 5。
  • 因此,经过 5 次日志文件备份以及第 6 次备份的时间,然后它就崩溃了。
  • 我制作了一个静态库,在其中制作了 8 个 Logger 实例,并且全部都将日志转储到同一日志文件中。
  • 使用的多线程环境
4

0 回答 0