views:

74

answers:

1

With the VXL library:

I'm using vnl_conjugate_gradient with VC8 (visual studio 2005) and occasionally I see this error in debug mode:

Run-Time Check Failure #2 - Stack around the variable 'z' was corrupted.**

This is happening while leaving the function cg_ in the file cg.c

This function is literally packed with "goto" btw, could that be the culprit??

Any idea?

PS: Callstack:

  • vision.dll!v3p_netlib_cg_(double * x=0x01d6b040, double * e=0x0012f1d4, long * it=0x0012f1c8, double * step=0x01d698b8, double * t=0x0012f1b8, long * limit=0x01d69868, long * n=0x0012f19c, long * m=0x0012f19c, double (double *, void ) value=0x00f2a9e0, void (double *, double *, void ) grad=0x00f2aae0, void (double *, double *, double *, void ) both=0x00f2abf0, void (double *, double *, void ) pre=0x00f2ad00, double * h__=0x01d6b080, void * userdata=0x01d69858, long * error_code=0x0012f190) Line 1128 + 0xf bytes C
  • vision.dll!vnl_conjugate_gradient::minimize(vnl_vector & x={...}) Line 171 + 0x50 bytes C++
A: 

That was due to the cost function returning NAN.