Hans asked me to look at a couple of ITK Coverity defects, as they were in code
written in our lab.
A couple of them are understandable but problematic. Basically there’s an
exception thrown at itkObjectFactoryBase.cxx at line 533:
531 if ( ObjectFactoryBase::m_StrictVersionChecking )
532 {
1. exception_thrown: An exception of type "itk::ExceptionObject" is thrown.
533 itkGenericExceptionMacro(<< "Incompatible factory version load
attempt:"
534 << "\nRunning itk version :\n" <<
Version::GetITKSourceVersion()
535 << "\nAttempted loading factory version:\n" <<
factory->GetITKSourceVersion()
536 << "\nAttempted factory:\n" <<
factory->m_LibraryPath << "\n");
537 }
538 else
539 {
540 itkGenericOutputMacro(<< "Possible incompatible factory load:"
541 << "\nRunning itk version :\n" <<
Version::GetITKSourceVersion()
542 << "\nLoaded factory version:\n" <<
factory->GetITKSourceVersion()
543 << "\nLoading factory:\n" <<
factory->m_LibraryPath << "\n");
544 }
545 }
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.
But in fact Coverity only reports 4 instances of this being a problem.
I can fix the reported defects for completeness’ sake, but I find it mysterious
that more defects caused by this occur.
________________________________
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.
________________________________
_______________________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Kitware offers ITK Training Courses, for more information visit:
http://kitware.com/products/protraining.php
Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ
Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/insight-developers