[Insight-developers] ImageRegistration{3, 4, 5}Tcl tests failing
on Linux 64 bit compiles
Kent Williams
norman-k-williams at uiowa.edu
Thu Jun 2 13:51:45 EDT 2005
You'll excuse me for replying to my own post, but ...
On reflection I thing this problem on 64bit platforms is this: if you
pass a zero into a varargs function as one of the va_args, doesn't it go
on the stack as a 32-bit int? The code inside SWIG_GetArgs seems to
assume the variable parameters are pointers, which would be 64 bits.
If SWIG_GetArgs expects three (possibly null) 64bit pointers based on
the format string, and it only had 3 32 bit words stacked by the caller,
it will incorrectly mess with the stack pointer starting with the second
pointer it tries to access.
If someone can point me into the CSwig code where it generates code for
the SWIG_GetArgs, I'll try and figure out how to fix this problem.
Kent Williams wrote:
> Hans asked me to take a look at this problem -- wrapped Image
> Registration using TCL is dumping core on 64bit Linux.
>
> The problem is easy enough to find, but I'm not clear on how to fix it.
>
> In the Swig-generated function
> _wrap_itkRegularStepGradientDescentOptimizer_Pointer_AddObserver__SWIG_0,
> a call is made to SWIG_GetArgs, which looks to be a SWIG helper
> function that is a VARARGS function. This looks rather like
> scanf-style function, but the va_start and va_arg macros apparently
> aren't doing the right thing -- on line 780 of swigrunTcl.cxx,
> 'vptr' has a value of 0x2a0000000000, which isn't valid.
>
> Further mystifying me, the call to SWIG_GetArgs in
> _wrap_itkRegularStepGradientDescentOptimizer_Pointer_AddObserver__SWIG_0:
>
> SWIG_GetArgs(interp, objc,
> objv,"ooo:itkRegularStepGradientDescentOptimizer_Pointer_AddObserver
> self itk::EventObject const & itk::Command * ",0,0,0)
>
> Maybe I just don't understand SWIG_GetArgs, but it looks like zeroes
> are getting passed in where pointers to pointers to Tcl_Obj are expected.
>
> This could be bad code generated by wrapping, but I don't know. Since
> all these tests fail similarly I suspect they all have the same problem.
>
>
More information about the Insight-developers
mailing list