<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;">
<div style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px;">
Hans asked me to look at a couple of ITK Coverity defects, as they were in code written in our lab.</div>
<div style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px;">
<br>
</div>
<div style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px;">
A couple of them are understandable but problematic. Basically there’s an exception thrown at itkObjectFactoryBase.cxx at line 533:</div>
<div>
<div><font face="Calibri,sans-serif"><br>
</font></div>
<div><font face="Calibri,sans-serif">531 if ( ObjectFactoryBase::m_StrictVersionChecking )</font></div>
<div><font face="Calibri,sans-serif">532 {</font></div>
<div><font face="Calibri,sans-serif"> <span class="Apple-tab-span" style="white-space:pre">
</span>1. exception_thrown: An exception of type "itk::ExceptionObject" is thrown.</font></div>
<div><font face="Calibri,sans-serif">533 itkGenericExceptionMacro(<< "Incompatible factory version load attempt:"</font></div>
<div><font face="Calibri,sans-serif">534 << "\nRunning itk version :\n" << Version::GetITKSourceVersion()</font></div>
<div><font face="Calibri,sans-serif">535 << "\nAttempted loading factory version:\n" << factory->GetITKSourceVersion()</font></div>
<div><font face="Calibri,sans-serif">536 << "\nAttempted factory:\n" << factory->m_LibraryPath << "\n");</font></div>
<div><font face="Calibri,sans-serif">537 }</font></div>
<div><font face="Calibri,sans-serif">538 else</font></div>
<div><font face="Calibri,sans-serif">539 {</font></div>
<div><font face="Calibri,sans-serif">540 itkGenericOutputMacro(<< "Possible incompatible factory load:"</font></div>
<div><font face="Calibri,sans-serif">541 << "\nRunning itk version :\n" << Version::GetITKSourceVersion()</font></div>
<div><font face="Calibri,sans-serif">542 << "\nLoaded factory version:\n" << factory->GetITKSourceVersion()</font></div>
<div><font face="Calibri,sans-serif">543 << "\nLoading factory:\n" << factory->m_LibraryPath << "\n");</font></div>
<div><font face="Calibri,sans-serif">544 }</font></div>
<div><font face="Calibri,sans-serif">545 }</font></div>
</div>
<div style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px;">
<br>
</div>
There are 4 Coverity defects reported that all point to this code. Given where the exceptions are thrown, it looks like every call to itk::<className>::New() should be bracketed by a try/catch pair.
<div><br>
</div>
<div>But in fact Coverity only reports 4 instances of this being a problem.</div>
<div><br>
</div>
<div>I can fix the reported defects for completeness’ sake, but I find it mysterious that more defects caused by this occur.</div>
<br>
<br>
<hr>
Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged. If you are not the intended recipient, you are hereby notified that any
retention, dissemination, distribution, or copying of this communication is strictly prohibited. Please reply to the sender that you have received the message in error, then delete it. Thank you.
<hr>
</body>
</html>