[Insight-developers] cswig segmentation fault

Bill Hoffman bill . hoffman at kitware . com
Fri, 15 Aug 2003 15:02:35 -0400


I found the problem.   The SegmentationLevelSetImageFilter class did
not provide a protected copy constructor and this caused cswig to crash.
I have modified cswig, so it will print out a message and abort when this
condition occurs.  Something like this: 

Building wrap_itkShapeDetectionLevelSetImageFilterTcl.cxx from  C:\Hoffman\InsightNew-vc\Wrapping\CSwig\Algorithms\wrap_itkShapeDetectionLevelSetImageFilterTcl.cxx.rule
SWIG: Fatal internal error. Constructor with no symname, perhaps the only public constructor is compiler generated, for ITK make sure all constructors are declared protected including the copy constructor. !
Error for itk::SegmentationLevelSetImageFilter<(itk::Image<(float,2)>,itk::Image<(float,2)>,float,itk::Image<(float,2)> )>
SWIG: Fatal internal error. Constructor with no symname, perhaps the only public constructor is compiler generated, for ITK make sure all constructors are declared protected including the copy constructor. !
Error for itk::SegmentationLevelSetImageFilter<(itk::Image<(float,2)>,itk::Image<(float,2)>,float,itk::Image<(float,2)> )>

wrap_itkShapeDetectionLevelSetImageFilterTcl.cxx - 2 error(s), 0 warning(s)



I added the protected copy constructor to the SegmentationLevelSetImageFilter class and it now wraps OK.  
I have also wrapped changed wrap_itkShapeDetectionLevelSetImageFilter.cxx to wrap the parent classes.

-Bill



At 08:14 PM 8/13/2003, Raul San Jose Estepar wrote:

>Hi Bill,
>
>We have been trying to use the tcl wrapper for the levelset segmentation
>classes. Some of the basic functionalities are implemented in the parent
>class (itkSegmentationLevelSetImageFilter), so we tried to use  the macro
>WRAP_OBJECTX_WITH_SUPERCLASS to wrap things.
>Surprisingly we got a seg. fault at compiling time when parsing the
>class xml descriptions with cswig.
>
>We tried to check the wrapping just for the parent class. Building, we
>get the seg fault at the same point (see below for screen output). I don't
>see anything special in itkSegmentationLevelSetImageFilter that might
>break cswig. I could complain but not break.
>
>Any idea??. Am I missing something?
>
>I've tried to wrap other classes with superclass and seems to work fine.
>
>
>Thanks,
>
>Raul
>
>------
>
>
>/home/raul/src/dev/builds/Insight/bin/cswig
>-l/home/raul/src/dev/Insight/Wrapping/CSwig/itk.swg -c -Cindex
>/home/raul/src/dev/builds/Insight/Wrapping/CSwig/VXLNumerics/VXLNumericsTcl.mdx
>-Cindex
>/home/raul/src/dev/builds/Insight/Wrapping/CSwig/Numerics/ITKNumericsTcl.mdx
>-Cindex
>/home/raul/src/dev/builds/Insight/Wrapping/CSwig/Common/ITKCommonTcl.mdx
>-Cindex
>/home/raul/src/dev/builds/Insight/Wrapping/CSwig/BasicFilters/ITKBasicFilters.mdx
>-Cindex
>/home/raul/src/dev/builds/Insight/Wrapping/CSwig/Algorithms/ITKAlgorithms.mdx
>-w362 -w389 -w503 -w508 -w509 -depend
>/home/raul/src/dev/builds/Insight/Wrapping/CSwig/Algorithms/wrap_itkSegmentationLevelSetImageFilter.xml.depend
>-o
>/home/raul/src/dev/builds/Insight/Wrapping/CSwig/Algorithms/wrap_itkSegmentationLevelSetImageFilterTcl.cxx
>-tcl -pkgversion 1.3 -c++
>/home/raul/src/dev/builds/Insight/Wrapping/CSwig/Algorithms/wrap_itkSegmentationLevelSetImageFilter.xml
>make[1]: ***
>[/home/raul/src/dev/builds/Insight/Wrapping/CSwig/Algorithms/wrap_itkSegmentationLevelSetImageFilterTcl.cxx]
>Segmentation fault
>make[1]: *** Deleting file
>`/home/raul/src/dev/builds/Insight/Wrapping/CSwig/Algorithms/wrap_itkSegmentationLevelSetImageFilterTcl.cxx'
>make[1]: Leaving directory
>`/home/raul/src/dev/builds/Insight/Wrapping/CSwig/Algorithms'
>make: *** [default_target] Error 2
>
>
>
>
>_______________________________________________
>Insight-developers mailing list
>Insight-developers at itk . org
>http://www . itk . org/mailman/listinfo/insight-developers