[Insight-developers] Intermittent crashes on Solaris and
Mac
Bill Hoffman
bill . hoffman at kitware . com
Tue, 03 Sep 2002 08:51:42 -0400
Brad just pointed out that it is not a compiler bug.
Code like this is not valid c++:
OutputComponentType val = static_cast<OutputComponentType>(
0.2125 * static_cast<OutputComponentType>(*inputData++) +
0.7154 * static_cast<OutputComponentType>(*inputData++) +
0.0721 * static_cast<OutputComponentType>(*inputData++) );
The compiler can do the increments in any order as long as it is before the semi-colon. The order does not need to be preserved.
-Bill
At 10:28 AM 8/31/2002 -0400, Bill Lorensen wrote:
>I think we've fixed the intermittent crash problem that was occurring in some tests that used readers.
>
>The problem was in IO/itkConvertPixelBuffer::ConvertRGBToGray. I think it must be a compiler error. I rewrote the input buffer access and the problem is gone on the Solaris system. We'll see how the Mac does the next time an experimental is submitted.
>
>For some reason, this routine was trashing the heap and programs would subsequently crash somewhere unrelated. It took a while to find but Jim and I isolated the problem to one statement in the method. Once it was rewritten, the problem went away. I have rewritten all similar code in that file but have not checked it in yet.
>
>I used the Solaris watchpoint facility to track it down.
>
>Bill
>
>_______________________________________________
>Insight-developers mailing list
>Insight-developers@public.kitware.com
>http://public.kitware.com/mailman/listinfo/insight-developers