[Quickfix-developers] **** VERY IMPORTANT ***** Crashes in QuickFIX compiled with MS VC++ 6.0
Brought to you by:
orenmnero
From: Pasquale d'A. <pas...@ga...> - 2004-08-23 15:52:24
|
My application (compiled using Visual Studio 6.0) is affected by random = corruptions of data as other developers have mentioned. I found a recent Microsoft article about STL string use in = multithreading environment: http://support.microsoft.com/default.aspx?scid=3Dkb;en-us;813810 that can explain such a behaviour. In QuickFIX, common fields data, such as BeginString, SenderCompID, = TargetCompID, are filled in message by copying them from the original = values in Session::m_sessionID (see the function Session::fill() ); = concurrently, the same values are accessed by the incoming messages = thread to make validity checks (see the functions = Session::isCorrectCompID() and Session::next(const Message& message) ). Sometimes, especially during periods of heavy traffic, the reference = counting of the strings stored in Session::m_sessionID might be updated = wrongly as the above article explains. In these cases, the strings = stored in Session::m_sessionID might be released and following accesses = will cause memory corruptions and crashes. I'm going to protect all the simultaneous reads to shared std::string's = with a mutex. What do you think about? Regards. Pasquale d'Aloise |