[Insight-users] Error in EM example

Luis Ibanez luis.ibanez at kitware.com
Wed Apr 30 17:14:31 EDT 2008


Hi Dario,

Thanks for the update.

A problem with order of libraries in the link line should simply lead
to a link error, not to an run-time execution error.

What is most likely is that you have a set of inconsistently build
libraries. E.g. libraries that have been build with different versions
of ITK, and that you are trying to link together.

If the dependencies are not managed correctly in your Eclipse project,
chances are that some code, that should be recompiled, is not getting
recompiled.

Performing a full-clean build of your Eclipse environment may prove /
disprove this hypotesis.


BTW: Please note that CMake can generate Eclipse projects
http://www.cmake.org/Wiki/CMake:Eclipse



   Please let us know what you find,


      Thanks


         Luis


-------------------------
Dário Oliveira wrote:
> Friends,
> 
> Going on with my problem I've just realised that when I generate the
> Examples using Cmake, the EM example runs greatly.
> 
> I'm using Eclipse with QT and I added manually the libs necessary to
> use ITK in my project. I've already used many of ITK features without
> problems, but when I add this example to my project it doesn't execute
> correctly.
> 
> Both the executables use the same ITK libraries. Does anyone suspects
> what is causing the error?
> 
> I think that it could be the order of the libs in the g++ command, but
> I think its not the case, becuse I put exactly the same order I seen
> in Cmake generated makefile (build.make).
> 
> Any suggestion would be really appreciated.
> 
> Thanks!
> 
> 2008/4/27 Dário Oliveira <dariodisk at gmail.com>:
> 
>>Hi Luis,
>>
>>As you asked for, I used gdb to Degub the example.
>>
>>I haven't modified anything in the source code, and the error really
>>is exactly at
>>
>>(components[i])->SetParameters( initialParameters[i] );
>>
>>
>>At this point the program send a signal of segmentation fault, but I
>>can access both components and initialParameters variables.
>>
>>I'm sending some debug information. Do you have any other task that I
>>should perform to identify the problem?
>>
>>Regards,
>>Dário
>>
>>Here are the variables:
>>
>>
>>components      {...}
>>      _Vector_base<itk::SmartPointer<itk::Statistics::GaussianMixtureModelComponent<itk::Statistics::ListSample<itk::Vector<double,
>>1u> > > >,std::allocator<itk::SmartPointer<itk::Statistics::GaussianMixtureModelComponent<itk::Statistics::ListSample<itk::Vector<double,
>>1u> > > > > >   {...}
>>              _M_impl {...}
>>
>>allocator<itk::SmartPointer<itk::Statistics::GaussianMixtureModelComponent<itk::Statistics::ListSample<itk::Vector<double,
>>1u> > > > >     {...}
>>
>>new_allocator<itk::SmartPointer<itk::Statistics::GaussianMixtureModelComponent<itk::Statistics::ListSample<itk::Vector<double,
>>1u> > > > >     {...}
>>                      _M_start        0x00c61540
>>                              m_Pointer       0x00c61418
>>
>>MixtureModelComponentBase<itk::Statistics::ListSample<itk::Vector<double,
>>1u> > > 0x00000000
>>                                              Object  0x00000000
>>                                              m_Sample        0x00c61258
>>
>>m_MinimalParametersChange       1.0E-6
>>                                              m_Parameters    {...}
>>
>>vnl_vector<double>      {...}
>>                                                              num_elmts       2
>>                                                              data
>>0x00c63930
>>
>>*data   110.0
>>
>>m_LetArrayManageMemory  true
>>                                              m_MembershipFunction
>>0x00c63838
>>                                              m_Weights       0x00c638a8
>>                                              m_ParametersModified    true
>>                                      m_GaussianDensityFunction       {...}
>>                                      m_Mean  {...}
>>                                      m_Covariance    {...}
>>                                      m_MeanEstimator {...}
>>                                      m_CovarianceEstimator   {...}
>>                      _M_finish       0x00c61544
>>                              m_Pointer       0xabababab
>>                      _M_end_of_storage       0x00c61544
>>
>>
>>
>>initialParameters       {...}
>>      _Vector_base<itk::Array<double>,std::allocator<itk::Array<double>
>>
>>>>  {...}
>>
>>              _M_impl {...}
>>                      allocator<itk::Array<double> >  {...}
>>                              new_allocator<itk::Array<double> >      {...}
>>                      _M_start        0x00d01380
>>                              vnl_vector<double>      0x00000000
>>                                      num_elmts       2
>>                                      data    0x00d013f0
>>                                              *data   110.0
>>                              m_LetArrayManageMemory  true
>>                      _M_finish       0x00d01398
>>                      _M_end_of_storage       0x00d01398
>>
>>Here is the debugger stack:
>>
>>
>>Thread [1] (Suspended: Signal 'SIGSEGV' received. Description:
>>Segmentation fault.)
>>      14 <symbol is not available> 0x77e5b28a
>>      13 <symbol is not available> 0x76481d27
>>      12 <symbol is not available> 0x777aa097
>>      11 operator delete()  0x00410565
>>      10 vnl_sse_dealloc()  0x004233ff
>>      9 vnl_c_vector_dealloc()  0x00424893
>>      8 vnl_c_vector<double>::deallocate()  0x00431e5a
>>      7 vnl_matrix<double>::destroy()  0x0042737c
>>      6 vnl_matrix<double>::~vnl_matrix()  0x00429797
>>      5 vnl_svd<double>::~vnl_svd()
>>D:\InsightToolkit-3.2.0\Utilities\vxl\core\vnl\algo\vnl_svd.h:84
>>0x00440736
>>      4 vnl_matrix_inverse<double>::~vnl_matrix_inverse()
>>D:\InsightToolkit-3.2.0\Utilities\vxl\core\vnl\algo\vnl_matrix_inverse.h:37
>>0x00433ead
>>      3 itk::Statistics::GaussianDensityFunction<itk::Vector<double, 1>
>>
>>>::SetCovariance()
>>
>>D:\InsightToolkit-3.2.0\Code\Numerics\Statistics\itkGaussianDensityFunction.txx:92
>>0x00436431
>>      2 itk::Statistics::GaussianMixtureModelComponent<itk::Statistics::ListSample<itk::Vector<double,
>>1> > >::SetParameters()
>>D:\InsightToolkit-3.2.0\Code\Numerics\Statistics\itkGaussianMixtureModelComponent.txx:116
>>0x00439872
>>      1 main() ..\src\teste.cpp:219 0x004019cc
>>
>>
>>2008/4/22 Luis Ibanez <luis.ibanez at kitware.com>:
>>
>>>Hi Dario,
>>>
>>>
>>>Thanks for the additional information.
>>>
>>>
>>>Could you please do the following;
>>>
>>>
>>>a) compile this example in Debug mode
>>>
>>>b) load it inside gdb (or ddd)
>>>
>>>c) put a break point in the SetParameters() line.
>>>
>>>d) run it
>>>
>>>e) follow the execution step by step after the
>>>  break point.
>>>
>>>f) post to the list the exact line in which the
>>>  program fails.
>>>
>>>In the line:
>>>
>>>
>>>(components[i])->SetParameters( initialParameters[i] );
>>>
>>>the problem may be in the access to "components[i]",
>>>or the access to "initialParameters[i]", or in the
>>>internal execution of SetParameters().
>>>
>>>
>>>BTW: Have you modified the source code of this example
>>>    in any way ?
>>>
>>>
>>>
>>>Also, just for the record, this example runs fine
>>>in my Linux build. (CVS updated today).
>>>
>>>
>>>
>>> Please let us know what you find.
>>>
>>>
>>>
>>>
>>>   Thanks
>>>
>>>
>>>      Luis
>>>
>>>
>>>-----------------------
>>>Dário Oliveira wrote:
>>>
>>>>Hi Luis,
>>>>
>>>>I try to run the executable and it just appears that window "this
>>>>program stopped working..." whithout any special message.
>>>>
>>>>I printed some outputs to check which line was causing that and is the
>>>>SetParameters. I can even print the parameters, they are ok, but when
>>>>I call this method, the program hungs.
>>>>
>>>>Is that a way to get more information about the error?
>>>>
>>>>Thank you
>>>>
>>>>Dário
>>>>
>>>>2008/4/22, Luis Ibanez <luis.ibanez at kitware.com>:
>>>>
>>>>
>>>>
>>>>>Hi Dario,
>>>>>
>>>>>Could you please post to the list the error messages that you are
>>>>>receiving from executing that line ?
>>>>>
>>>>>
>>>>> Thanks
>>>>>
>>>>>
>>>>>   Luis
>>>>>
>>>>>
>>>>>-----------------------
>>>>>
>>>>>Dário Oliveira wrote:
>>>>>
>>>>>
>>>>>
>>>>>>Friends,
>>>>>>
>>>>>>I want to apply the EM estimator to detect some vessels, but I
>>>>>>actually can't execute the EM example given in the ITK source code
>>>>>>
>>>>>>
>>>>>
>>>>>(Examples/Statistics/ExpectationMaximizationMixtureModelEstimator.cxx.).
>>>>>
>>>>>
>>>>>
>>>>>>I have made some debug and the error occurs right at this line:
>>>>>>(components[i])->SetParameters( initialParameters[i] );
>>>>>>
>>>>>>I'm using ITK 3.2 compiled in MinGW.
>>>>>>
>>>>>>Anyone has any ideia how to work it out?
>>>>>>
>>>>>>thanks in advance!
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>
>>
>>--
>>Dário Oliveira
>>
> 
> 
> 
> 


More information about the Insight-users mailing list