[Insight-developers] Purify errors

Miller, James V (CRD) millerjv@crd.ge.com
Wed, 6 Mar 2002 09:32:50 -0500


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_000_01C1C51B.CB2407CA
Content-Type: multipart/alternative;
	boundary="----_=_NextPart_001_01C1C51B.CB2407CA"


------_=_NextPart_001_01C1C51B.CB2407CA
Content-Type: text/plain;
	charset="iso-8859-1"

People,
 
As of last Friday, I had the Purify errors on the Dashboard down to 111 (which was down from 8000).
 
In the last few days, the number of Purify errors has increased to 235!
 
For the people that have been checking in code over the last few days, please look through the Purify

errors and try to address the errors you introduced.  If you cannot decipher the error send me a note
and
I will guide you through.
 
Most of these errors are in the non-critical category. They are mostly uninitialized memory copies
and 
uninitialize memory reads. These particular UMR and UMC errors may be benign.  I can suppress
certain errors if they outside of our control.
 
These purify results were computed using a RelWithDebInfo build on the Intel C++ 5.0 compiler.  It
produces
a few more UMC's than Microsoft Visual C++. One case in particular that the Intel compiler produces a
UMC 
where the VC++ does not is in copy "empty" structures.  An empty structure is of the form
 
struct foo {};
 
These are used in parts of the code to force particular overloaded functions to be called. If they
are passed 
by value, a UMC occurs.  This is because all data structures have to take up "some" space, usually a
word.
But since the structure has no ivars, there is nothing to initialize programatically. I have changed
some of these
over to being passed by reference (const reference in particular) which avoids the UMC error.
 
Another popular error is having a std::vector (or a std::queue, etc) of itk::Vector's. The default
constructors
for itk:Vector does not initialize the memory.  So when a vector resizes, a UMC error occurs on the
"unused" portion of the previous allocation. This is an example of one of the errors that I suppress
by hand.  I just 
need to know where all of them are.
 
Finally, classes that have a template parameter that used for an ivar accessable from a Set macro
will produce a UMC when the Set is called and the template parameter is something like an
itk::Vector.
Since the ivar datatype is a template parameter, we cannot assume a particular initializer and we
have
to rely on the default constructors.  Here are some possible solutions:
 
1) Assume the tempate parameter is going to be a subclass of itkFixedArray or itkArray and call
Fill() on all these ivars in your constructor.
 
2) Don't use a template parameter for this and force people to use itkFixedArrays or itkArrays.
 
 


Jim Miller 
_____________________________________
Visualization & Computer Vision
GE Corporate Research & Development
Bldg. KW, Room C218B
P.O. Box 8, Schenectady NY 12301

millerjv@crd.ge.com < mailto:millerjv@crd.ge.com <mailto:millerjv@crd.ge.com> >
(518) 387-4005, Dial Comm: 8*833-4005, 
Cell: (518) 505-7065, Fax: (518) 387-6981 


 

------_=_NextPart_001_01C1C51B.CB2407CA
Content-Type: text/html;
	charset="iso-8859-1"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">


<META content="MSHTML 5.50.4807.2300" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=020331114-06032002><FONT size=2>People,</FONT></SPAN></DIV>
<DIV><SPAN class=020331114-06032002><FONT size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=020331114-06032002><FONT size=2>As of last Friday, I had the 
Purify errors on the Dashboard down to 111 (which was down from 
8000).</FONT></SPAN></DIV>
<DIV><SPAN class=020331114-06032002><FONT size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=020331114-06032002><FONT size=2>In the last few days, the 
number of Purify errors has increased to 235!</FONT></SPAN></DIV>
<DIV><SPAN class=020331114-06032002><FONT size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=020331114-06032002><FONT size=2>For the people that have been 
checking in code over the last few days, please look through the Purify 
</FONT></SPAN></DIV>
<DIV><SPAN class=020331114-06032002><FONT size=2>errors and try to address the 
errors you introduced.&nbsp; If you cannot decipher the error send me a note 
and</FONT></SPAN></DIV>
<DIV><SPAN class=020331114-06032002><FONT size=2>I will guide you 
through.</FONT></SPAN></DIV>
<DIV><SPAN class=020331114-06032002><FONT size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=020331114-06032002><FONT size=2>Most of these errors are in the 
non-critical category. They are mostly uninitialized memory copies and 
</FONT></SPAN></DIV>
<DIV><SPAN class=020331114-06032002><FONT size=2>uninitialize memory reads. 
These particular&nbsp;UMR and UMC errors may be benign.&nbsp; I can 
suppress</FONT></SPAN></DIV>
<DIV><SPAN class=020331114-06032002><FONT size=2>certain errors if they outside 
of our control.</FONT></SPAN></DIV>
<DIV><SPAN class=020331114-06032002><FONT size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=020331114-06032002><FONT size=2>These purify results were 
computed using a RelWithDebInfo build on the Intel C++ 5.0 compiler.&nbsp; It 
produces</FONT></SPAN></DIV>
<DIV><SPAN class=020331114-06032002><FONT size=2>a few more UMC's than Microsoft 
Visual C++. One case in particular that the Intel compiler produces a UMC 
</FONT></SPAN></DIV>
<DIV><SPAN class=020331114-06032002><FONT size=2>where the VC++ does not is in 
copy "empty" structures.&nbsp; An empty structure is of the 
form</FONT></SPAN></DIV>
<DIV><SPAN class=020331114-06032002><FONT size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=020331114-06032002><FONT size=2>struct foo 
{};</FONT></SPAN></DIV>
<DIV><SPAN class=020331114-06032002><FONT size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=020331114-06032002><FONT size=2>These are used in parts of the 
code to force particular overloaded functions to be called.&nbsp;If they are 
passed </FONT></SPAN></DIV>
<DIV><SPAN class=020331114-06032002><FONT size=2>by value, a UMC occurs.&nbsp; 
This is because all data structures have to take up "some" space, usually a 
word.</FONT></SPAN></DIV>
<DIV><SPAN class=020331114-06032002><FONT size=2>But since the structure has no 
ivars, there is nothing to initialize programatically. I have changed some of 
these</FONT></SPAN></DIV>
<DIV><SPAN class=020331114-06032002><FONT size=2>over to being passed by 
reference (const reference in particular) which avoids the UMC 
error.</FONT></SPAN></DIV>
<DIV><SPAN class=020331114-06032002><FONT size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=020331114-06032002><FONT size=2>Another popular error is having 
a std::vector (or a std::queue, etc) of itk::Vector's. The default 
constructors</FONT></SPAN></DIV>
<DIV><SPAN class=020331114-06032002><FONT size=2>for itk:Vector does not 
initialize the memory.&nbsp; So when a vector resizes, a UMC error occurs on the 
"unused" portion of the previous allocation. This is an example of one of the 
errors that I suppress by hand.&nbsp; I just </FONT></SPAN></DIV>
<DIV><SPAN class=020331114-06032002><FONT size=2>need to know where all of them 
are.</FONT></SPAN></DIV>
<DIV><SPAN class=020331114-06032002><FONT size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=020331114-06032002><FONT size=2>Finally, classes that have a 
template parameter that used for an ivar accessable from a Set 
macro</FONT></SPAN></DIV>
<DIV><SPAN class=020331114-06032002><FONT size=2>will produce a UMC when the Set 
is called and the template parameter is something like an 
itk::Vector.</FONT></SPAN></DIV>
<DIV><SPAN class=020331114-06032002><FONT size=2>Since the ivar datatype is a 
template parameter, we cannot assume a particular initializer and we 
have</FONT></SPAN></DIV>
<DIV><SPAN class=020331114-06032002><FONT size=2>to rely on the default 
constructors.&nbsp; Here are some possible solutions:</FONT></SPAN></DIV>
<DIV><SPAN class=020331114-06032002><FONT size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=020331114-06032002><FONT size=2>1) Assume the tempate parameter 
is going to be a subclass of itkFixedArray or itkArray and 
call</FONT></SPAN></DIV>
<DIV><SPAN class=020331114-06032002><FONT size=2>Fill() on all these ivars in 
your constructor.</FONT></SPAN></DIV>
<DIV><SPAN class=020331114-06032002><FONT size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=020331114-06032002><FONT size=2>2) Don't use a template 
parameter for this and force people to use itkFixedArrays or 
itkArrays.</FONT></SPAN></DIV>
<DIV><SPAN class=020331114-06032002><FONT size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=020331114-06032002><FONT size=2></FONT></SPAN>&nbsp;</DIV><BR>
<P><B><FONT face="Comic Sans MS" color=#000080>Jim Miller</FONT></B> 
<BR><B><I><FONT face=Arial color=#ff0000 
size=2>_____________________________________</FONT></I></B><I></I><BR><I></I><I><FONT 
face=Arial color=#000000 size=1>Visualization &amp; Computer Vision<BR>GE 
Corporate Research &amp; Development<BR>Bldg. KW, Room C218B<BR>P.O. Box 8, 
Schenectady NY 12301<BR><BR></FONT><U><FONT face=Arial color=#0000ff 
size=1>millerjv@crd.ge.com &lt;<A 
href="mailto:millerjv@crd.ge.com">mailto:millerjv@crd.ge.com</A>&gt;</FONT></U></I><BR><I><FONT 
face=Arial color=#000000 size=1>(518) 387-4005, Dial Comm: 8*833-4005, 
</FONT></I><BR><I><FONT face=Arial color=#000000 size=1>Cell: (518) 505-7065, 
Fax: (518) 387-6981</FONT></I> </P><BR>
<DIV>&nbsp;</DIV></BODY></HTML>

------_=_NextPart_001_01C1C51B.CB2407CA--

------_=_NextPart_000_01C1C51B.CB2407CA
Content-Type: application/octet-stream;
	name="Miller, James V (CRD).vcf"
Content-Disposition: attachment;
	filename="Miller, James V (CRD).vcf"

BEGIN:VCARD
VERSION:2.1
N:Miller;James
FN:Miller, James V (CRD)
ORG:CRD;ESL
TITLE:Computer Scientist
TEL;WORK;VOICE:*833-4005
TEL;WORK;VOICE:1 518 387-4005
ADR;WORK:;KW-C218B;P.O. Box 8;Schenectady;New York;12301;USA
LABEL;WORK;ENCODING=QUOTED-PRINTABLE:KW-C218B=0D=0AP.O. Box 8=0D=0ASchenectady, New York 12301=0D=0AUSA
EMAIL;PREF;INTERNET:millerjv@crd.ge.com
REV:20010420T140329Z
END:VCARD

------_=_NextPart_000_01C1C51B.CB2407CA--