<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"Segoe UI";
panose-1:2 11 5 2 4 2 4 2 2 3;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">Hi everyone,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">We use QuickFIX\n in our application and one of our customers has been experiencing a regular error which crashes the application. We’re unable to reproduce it. It happens on the customer side pretty much every time their FIX session reaches
its EndTime.<br>
<br>
This is the Stack Trace:<br>
<br>
<span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#FF8B00;background:white">UnhandledExceptionHandler caught : System.IO.IOException: An unexpected network error occurred. </span><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#172B4D"><br>
</span><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#FF8B00;background:white">at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) </span><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#172B4D"><br>
</span><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#FF8B00;background:white">at System.IO.FileStream.WriteCore(Byte[] buffer, Int32 offset, Int32 count) </span><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#172B4D"><br>
</span><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#FF8B00;background:white">at System.IO.FileStream.FlushInternalBuffer() </span><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#172B4D"><br>
</span><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#FF8B00;background:white">at System.IO.FileStream.Flush(Boolean flushToDisk) </span><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#172B4D"><br>
</span><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#FF8B00;background:white">at System.IO.StreamWriter.Flush(Boolean flushStream, Boolean flushEncoder) </span><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#172B4D"><br>
</span><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#FF8B00;background:white">at System.IO.StreamWriter.Write(Char[] buffer, Int32 index, Int32 count) </span><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#172B4D"><br>
</span><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#FF8B00;background:white">at QuickFix.FileLog.OnEvent(String s) </span><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#172B4D"><br>
</span><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#FF8B00;background:white">at QuickFix.Transport.SocketInitiator.SocketInitiatorThreadStart(Object socketInitiatorThread) </span><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#172B4D"><br>
</span><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#FF8B00;background:white">at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) </span><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#172B4D"><br>
</span><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#FF8B00;background:white">at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) </span><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#172B4D"><br>
</span><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#FF8B00;background:white">at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) </span><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#172B4D"><br>
</span><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#FF8B00;background:white">at System.Threading.ThreadHelper.ThreadStart(Object obj): An unexpected network error occurred. </span><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#172B4D"><br>
</span><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#FF8B00;background:white">at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) </span><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#172B4D"><br>
</span><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#FF8B00;background:white">at System.IO.FileStream.WriteCore(Byte[] buffer, Int32 offset, Int32 count) </span><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#172B4D"><br>
</span><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#FF8B00;background:white">at System.IO.FileStream.FlushInternalBuffer() </span><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#172B4D"><br>
</span><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#FF8B00;background:white">at System.IO.FileStream.Flush(Boolean flushToDisk) </span><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#172B4D"><br>
</span><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#FF8B00;background:white">at System.IO.StreamWriter.Flush(Boolean flushStream, Boolean flushEncoder) </span><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#172B4D"><br>
</span><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#FF8B00;background:white">at System.IO.StreamWriter.Write(Char[] buffer, Int32 index, Int32 count) </span><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#172B4D"><br>
</span><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#FF8B00;background:white">at QuickFix.FileLog.OnEvent(String s) </span><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#172B4D"><br>
</span><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#FF8B00;background:white">at QuickFix.Transport.SocketInitiator.SocketInitiatorThreadStart(Object socketInitiatorThread) </span><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#172B4D"><br>
</span><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#FF8B00;background:white">at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) </span><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#172B4D"><br>
</span><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#FF8B00;background:white">at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) </span><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#172B4D"><br>
</span><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#FF8B00;background:white">at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) </span><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#172B4D"><br>
</span><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#FF8B00;background:white">at System.Threading.ThreadHelper.ThreadStart(Object obj)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#FF8B00;background:white"><o:p> </o:p></span></p>
<p class="MsoNormal">We have our own implementation of the QuickFIX ILogFactory interface but we just do that so that when the session expires we can safely copy the log file to another directory from where it can be archived. The customer with this bug doesn’t
use that functionality so in effect all our ILogFactor implementation does is to call the inbuilt QuickFIX logger. See the screenshot – I’ve stripped out some bits for simplicity but they’re not actually used in the case of this customer.<br>
<br>
<img width="605" height="652" style="width:6.302in;height:6.7916in" id="Picture_x0020_2" src="cid:image002.png@01D88581.CAB059E0"><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">The obvious thing for us to do is to use Try-Catch blocks in all these methods but I was wondering if anyone has seen this before and has any thoughts about what could be causing this?<br>
<br>
I think what the Stack Trace shows is that the QuickFix\n code first catches an error while trying to log event from SockInitiatorThreadStart, and then tries to log that error which throws an unhandled error that then crashes the application.<br>
<br>
<img width="628" height="617" style="width:6.5416in;height:6.427in" id="Picture_x0020_3" src="cid:image003.png@01D88582.881EC430"><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I’m guessing maybe we should be doing something differently in disposing the logger when the session expires, but I don’t understand why we can’t reproduce the issue if that’s the case.<br>
<br>
I also thought that maybe the customer has some process in place that’s interfering with log files at the time of session expiry but I can’t find any evidence of that – plus we’ve tested with different end times and the same issue has occurred.<br>
<br>
Any thoughts would be appreciated<br>
<br>
Thanks<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="vertical-align:baseline"><b><span style="font-size:9.0pt;font-family:"Arial",sans-serif;color:black">Steve Walmsley</span></b><span lang="EN-GB" style="font-size:9.0pt;font-family:"Segoe UI",sans-serif"><o:p></o:p></span></p>
<p class="MsoNormal" style="vertical-align:baseline"><span style="font-size:9.0pt;font-family:"Times New Roman",serif;color:black">He/Him</span><span lang="EN-GB" style="font-size:9.0pt;font-family:"Segoe UI",sans-serif"><o:p></o:p></span></p>
<p class="MsoNormal" style="vertical-align:baseline"><span style="font-size:9.0pt;font-family:"Times New Roman",serif;color:black">Developer</span><span lang="EN-GB" style="font-size:9.0pt;font-family:"Times New Roman",serif"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:.5in;vertical-align:baseline"><span lang="EN-GB"> </span><span lang="EN-GB" style="font-size:9.0pt;font-family:"Segoe UI",sans-serif"><o:p></o:p></span></p>
<p class="MsoNormal" style="vertical-align:baseline"><b><span style="font-size:9.0pt;font-family:"Arial",sans-serif;color:#D6002A">S&P Global</span></b><b><span style="font-size:9.0pt;font-family:"Arial",sans-serif;color:black">
</span></b><span lang="EN-GB">Market Intelligence </span><span lang="EN-GB" style="font-size:9.0pt;font-family:"Segoe UI",sans-serif"><o:p></o:p></span></p>
<p class="MsoNormal" style="vertical-align:baseline"><span style="font-size:9.0pt;font-family:"Times New Roman",serif;color:black">Manchester</span><span lang="EN-GB" style="font-size:9.0pt;font-family:"Segoe UI",sans-serif"><br>
</span><span style="font-size:9.0pt;font-family:"Times New Roman",serif;color:black"><a href="mailto:steve.walmsley@spglobal.com">steve.walmsley@spglobal.com</a></span><span lang="EN-GB" style="font-size:9.0pt;font-family:"Times New Roman",serif;color:black"> </span><span lang="EN-GB"> </span><span lang="EN-GB" style="font-size:9.0pt;font-family:"Segoe UI",sans-serif"><o:p></o:p></span></p>
<p class="MsoNormal" style="vertical-align:baseline"><span lang="EN-GB"> </span><span lang="EN-GB" style="font-size:9.0pt;font-family:"Segoe UI",sans-serif"><o:p></o:p></span></p>
<p class="MsoNormal" style="vertical-align:baseline"><span lang="EN-GB"><img border="0" width="534" height="134" style="width:5.5625in;height:1.3958in" id="Picture_x0020_11" src="cid:image001.jpg@01D8857F.AB1795A0"></span><span lang="EN-GB"> </span><span lang="EN-GB" style="font-size:9.0pt;font-family:"Segoe UI",sans-serif"><o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<br>
<hr>
<font face="Arial" color="Black" size="1"><br>
The information contained in this message is intended only for the recipient, and may be a confidential attorney-client communication or may otherwise be privileged and confidential and protected from disclosure. If the reader of this message is not the intended
recipient, or an employee or agent responsible for delivering this message to the intended recipient, please be aware that any dissemination or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately
notify us by replying to the message and deleting it from your computer. S&P Global Inc. reserves the right, subject to applicable local law, to monitor, review and process the content of any electronic message or information sent to or from S&P Global Inc.
e-mail addresses without informing the sender or recipient of the message. By sending electronic message or information to S&P Global Inc. e-mail addresses you, as the sender, are consenting to S&P Global Inc. processing any of your personal data therein.<br>
</font>
</body>
</html>