[Insight-users] ITK crash on Lion/Qt

Christian Lackas lackas at invicro.com
Tue Oct 18 11:50:44 EDT 2011


* Sean McBride <sean at rogue-research.com> [111018 17:35]:

Hi Sean,

thanks once again.

> BTW, I recommend always using MallocScribble in Debug, it only affects
> performance minimally, and makes bugs repro much more easily.

yes, I like MallocScribble very much. Was not aware of it before, so
thanks again for the hint and I fully agree.

> >(gdb) p *m_Pointer
> >$2 = {
> >  <itk::FiniteDifferenceFunction<itk::Image<float, 2u> >> = {
> >    <itk::LightObject> = {
> >      _vptr$LightObject = 0x5555555555555555,
> As the docs explain, when MallocScribble is set, all memory created
> with malloc/new is initialized to 0xAA and all freeed memory is set to
> 0x55.  So _vptr$LightObject has been freed.  Is the code you're
> running trying to use it after?

Yes, this is what causes the crash. The code is still within ITK,
though.

Reading more through the object factory code of ITK, I found
ObjectFactoryBase::CreateInstance(const char* itkclassname). This is
where the problem starts, since it returns 0 for my filter I want to
create. The itkclassname is

    N3itk21CurvatureFlowFunctionINS_5ImageIfLj2EEEEE

It is somehow possible that this classname is not recognized by any
factory (e.g. since the signature is calculated slightly differently in
the factory and where I use it)?

ITK does not seem to handle the case that no factory handles a creation.
Is that supposed to be this way? Wondering if a warning before the
ultimate 'return 0;' at ObjectFactoryBase::CreateInstance(...) would be
of any use.

More important is of course the question why no factory believe it
should create my filter.

Christian

-- 
Dr. Christian Lackas, Managing Partner
inviCRO, LLC -- In Imaging Yours
P: +1 617 933 8733, F: +49 2203 9034722, E: lackas at invicro.com
http://www.invicro.com/  http://www.spect-ct.com/


More information about the Insight-users mailing list