[Insight-developers] Bug in vnl_powell.cxx

Bill Lorensen bill.lorensen at gmail.com
Thu Oct 30 22:35:05 EDT 2008


Hans,

I wonder why our testing never caught this. Are you taking a path
through the code that we are not testing?

Luis, we should definitely include the fixes in the new release.

Bill

On Thu, Oct 30, 2008 at 8:50 PM, Hans Johnson <hans-johnson at uiowa.edu> wrote:
> ITK Developers,
>
> I just wanted to follow up on my previous e-mail a bit.
>
> I just found a nasty bug in the vxl_powell.cxx optimizer.  I've done
> extensive testing on it, and figured out how fix it.  This has given my
> application great speed increase, and no longer segmentation faults
> randomly.  The problem was that a variable was not explicitly being set, and
> from time to time it would have a non-zero initial value.  If you are really
> lucky then the default initialization is zero, and all is well; if you are
> somewhat lucky, the random value does not affect the outcome too much, and
> the method converges after a bunch of iterations, and occasionally you are
> unlucky and the the initialization is too crazy big/small and the function
> being minmized evaluates to nan or inf and all heck breaks loose.
>
> The least invasive way to avoid this bug is to initialize the variable
> "bx=0" on lines 87 and 124 of vnl_powell.cxx.  As stated in my previous
> message, this does work, but a little more work also removes two façade
> functions adapt the deprecated vnl_brent class member functions into the
> vnl_brent_minimizer class.
>
> Since this is so close to a release, I wanted to recommend the minimally
> invasisve fix prior to version 3.10, and the 15 line patch after the
> release.
>
> Let me know what you think.
> Hans
> _______________________________________________
> Insight-developers mailing list
> Insight-developers at itk.org
> http://www.itk.org/mailman/listinfo/insight-developers
>
>


More information about the Insight-developers mailing list