Description:
when logging a message, the following is called:
00077 LogHandler::append_impl(const char* pCategory, Logger::LoggerLevel level,
00078 const char* pMsg)
00079 {
00080 writeHeader(pCategory, level);
00081 if (m_count_repeated_messages <= 1)
00082 writeMessage(pMsg);
00083 else
00084 {
00085 BaseString str(pMsg);
00086 str.appfmt(" - Repeated %d times", m_count_repeated_messages);
00087 writeMessage(str.c_str());
00088 }
00089 m_count_repeated_messages= 0;
00090 writeFooter();
00091 }
but writeHeader sets up internal variables for severity and category for use by
writeMessage.
There are no locks around these two, so it's possible to get log messages with incorrect
severity and/or category.
How to repeat:
use SHM transporter for a higher probability of hitting this.
Suggested fix:
In SyslogHandler:
lock in writeHeader, unlock in writemessage.
Description: when logging a message, the following is called: 00077 LogHandler::append_impl(const char* pCategory, Logger::LoggerLevel level, 00078 const char* pMsg) 00079 { 00080 writeHeader(pCategory, level); 00081 if (m_count_repeated_messages <= 1) 00082 writeMessage(pMsg); 00083 else 00084 { 00085 BaseString str(pMsg); 00086 str.appfmt(" - Repeated %d times", m_count_repeated_messages); 00087 writeMessage(str.c_str()); 00088 } 00089 m_count_repeated_messages= 0; 00090 writeFooter(); 00091 } but writeHeader sets up internal variables for severity and category for use by writeMessage. There are no locks around these two, so it's possible to get log messages with incorrect severity and/or category. How to repeat: use SHM transporter for a higher probability of hitting this. Suggested fix: In SyslogHandler: lock in writeHeader, unlock in writemessage.