[vtk-developers] Template expansion in wrappers and ParaView client server wrapping

Biddiscombe, John A. biddisco at cscs.ch
Fri Feb 10 16:06:26 EST 2012


Whilst you're looking at the client server wrapping... you might like to know that with visual studio 2010, there is a runtime error in debug mode when wrapping one (possibly two) class(es) due to an overwrite of some variable into unallocated memory (or stack allocated mem). I can't quite remember. The bug has been around for about a year (since david rewrote the wrapper code). The fix is to flip to release mode, create all the generated client/server *.cxx files, then go back to debug mode and do the actual build.

It only gets triggered after a full clean, or when vtkWrapClientServer is touched and the generated files are invalid. 
For the life of me, I can't remember which file it is that triggers the mem check error, but next time I get it I'll try to remember to post it.

JB

-----Original Message-----
From: vtk-developers-bounces at vtk.org [mailto:vtk-developers-bounces at vtk.org] On Behalf Of David Gobbi
Sent: 10 February 2012 21:27
To: Marcus D. Hanwell
Cc: VTK Developers
Subject: Re: [vtk-developers] Template expansion in wrappers and ParaView client server wrapping

Hi Markus,

The error looks identical to an issue that I saw in VTK where the developers used macros to fool the wrappers into thinking that vtkIntArray et al had vtkDataArray as their superclass, when the real superclass was in fact vtkDataArrayTemplate<int>.  With the new macro expansion code, the wrappers aren't fooled anymore.

I can add special-cases to the wrapper code for these Paraview classes (as I did for vtkDataArray) until I up with a general solution.

 - David


On Fri, Feb 10, 2012 at 12:34 PM, Marcus D. Hanwell <marcus.hanwell at kitware.com> wrote:
> Hi David,
>
> It looks like there are some issues introduced in ParaView's client 
> server wrapping with the new macro expansion code, I am seeing 
> failures such as,
>
> [ 85%] Building CXX object
> ParaViewCore/ServerImplementation/CMakeFiles/vtkPVServerImplementation
> CS.dir/vtkSIDoubleVectorPropertyClientServer.cxx.o
> /home/marcus/ssd/build/ParaView/ParaViewCore/ServerImplementation/vtkSIDoubleVectorPropertyClientServer.cxx:16:40:
> error: invalid declarator before 'Command'
> /home/marcus/ssd/build/ParaView/ParaViewCore/ServerImplementation/vtkSIDoubleVectorPropertyClientServer.cxx:
> In function 'int
> vtkSIDoubleVectorPropertyCommand(vtkClientServerInterpreter*,
> vtkObjectBase*, const char*, const vtkClientServerStream&,
> vtkClientServerStream&)':
> /home/marcus/ssd/build/ParaView/ParaViewCore/ServerImplementation/vtkSIDoubleVectorPropertyClientServer.cxx:87:42:
> error: expected primary-expression before 'Command'
> /home/marcus/ssd/build/ParaView/ParaViewCore/ServerImplementation/vtkSIDoubleVectorPropertyClientServer.cxx:87:42:
> error: expected ')' before 'Command'
> /home/marcus/ssd/build/ParaView/ParaViewCore/ServerImplementation/vtkSIDoubleVectorPropertyClientServer.cxx:
> At global scope:
> /home/marcus/ssd/build/ParaView/ParaViewCore/ServerImplementation/vtkSIDoubleVectorPropertyClientServer.cxx:109:41:
> error: invalid declarator before '_Init'
> /home/marcus/ssd/build/ParaView/ParaViewCore/ServerImplementation/vtkSIDoubleVectorPropertyClientServer.cxx:
> In function 'void
> vtkSIDoubleVectorProperty_Init(vtkClientServerInterpreter*)':
> /home/marcus/ssd/build/ParaView/ParaViewCore/ServerImplementation/vtkSIDoubleVectorPropertyClientServer.cxx:119:49:
> error: no matching function for call to 
> 'vtkSIVectorPropertyTemplate<double>::vtkSIVectorPropertyTemplate(vtkClientServerInterpreter*&)'
> /home/marcus/ssd/build/ParaView/ParaViewCore/ServerImplementation/vtkSIDoubleVectorPropertyClientServer.cxx:119:49:
> note: candidates are:
> /home/marcus/ssd/src/ParaView/ParaViewCore/ServerImplementation/vtkSIVectorPropertyTemplate.h:68:3:
> note: vtkSIVectorPropertyTemplate<T,
> force_idtype>::vtkSIVectorPropertyTemplate(const
> vtkSIVectorPropertyTemplate<T, force_idtype>&) [with T = double, 
> force_idtype = int, vtkSIVectorPropertyTemplate<T, force_idtype> = 
> vtkSIVectorPropertyTemplate<double>]
> /home/marcus/ssd/src/ParaView/ParaViewCore/ServerImplementation/vtkSIVectorPropertyTemplate.h:68:3:
> note:   no known conversion for argument 1 from 
> 'vtkClientServerInterpreter*' to 'const 
> vtkSIVectorPropertyTemplate<double>&'
> /home/marcus/ssd/src/ParaView/ParaViewCore/ServerImplementation/vtkSIVectorPropertyTemplate.h:46:3:
> note: vtkSIVectorPropertyTemplate<T,
> force_idtype>::vtkSIVectorPropertyTemplate() [with T = double, 
> force_idtype = int]
> /home/marcus/ssd/src/ParaView/ParaViewCore/ServerImplementation/vtkSIVectorPropertyTemplate.h:46:3:
> note:   candidate expects 0 arguments, 1 provided
> /home/marcus/ssd/src/ParaView/ParaViewCore/ServerImplementation/vtkSIVectorPropertyTemplate.h:47:3:
> error: 'vtkSIVectorPropertyTemplate<T,
> force_idtype>::~vtkSIVectorPropertyTemplate() [with T = double, 
> force_idtype = int]' is protected
> /home/marcus/ssd/build/ParaView/ParaViewCore/ServerImplementation/vtkSIDoubleVectorPropertyClientServer.cxx:119:49:
> error: within this context
> make[2]: *** 
> [ParaViewCore/ServerImplementation/CMakeFiles/vtkPVServerImplementatio
> nCS.dir/vtkSIDoubleVectorPropertyClientServer.cxx.o]
> Error 1
> make[1]: *** 
> [ParaViewCore/ServerImplementation/CMakeFiles/vtkPVServerImplementatio
> nCS.dir/all]
> Error 2
> make: *** [all] Error 2
>
> The generated code looks wrong too, things such as the following are 
> appearing,
>
> int 
> vtkSIVectorPropertyTemplate<double>Command(vtkClientServerInterpreter*
> , vtkObjectBase*, const char*, const vtkClientServerStream&, 
> vtkClientServerStream& resultStream);
>
> and,
>
> if (vtkSIVectorPropertyTemplate<double>Command(arlu,
> op,method,msg,resultStream))
>    {
>    return 1;
>    }
>
> which becomes,
>
> if (vtkSIVectorPropertyCommand(arlu, op,method,msg,resultStream))
>    {
>    return 1;
>    }
>
> when the commit is reverted locally. Is this a special case we need to 
> add to the ParaView code?
>
> Thanks,
>
> Marcus
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtk-developers




More information about the vtk-developers mailing list