Hi,

We've got a problem with PlanarFigure.dll: it causes more or less 
regular crashes at start up of our MITK based application.

This is on Windows 8, x64, build with vc10 as debug, and MITK 2013.03 
(but also happened with an older version).

 From what we could figure out, during start up, PlanarFigure.dll is 
loaded, the static initialiser RegisterPlanarFigureObjectFactory is run 
and some other stuff happens. Then the destructor of 
RegisterPlanarFigureObjectFactory is run and the DLL is unloaded. So far 
so good.
A few milliseconds later, PlanarFigure.dll is loaded again, the 
constructor of RegisterPlanarFigureObjectFactory runs and a null pointer 
crash happens further down the call stack in:

PlanarFigure.dll!RegisterPlanarFigureObjectFactory::RegisterPlanarFigureObjectFactory()
PlanarFigure.dll!mitk::PlanarFigureObjectFactory::New()
PlanarFigure.dll!itk::ObjectFactory<mitk::PlanarFigureObjectFactory>::Create()
ITKCommon.dll!itk::ObjectFactoryBase::CreateInstance(const char * 
itkclassname)

(beware of line-break)
The crash is at ITK\Code\Common\itkObjectFactoryBase.cxx, line 120-ish, at:
LightObject::Pointer newobject = (*i)->CreateObject(itkclassname);

itkclassname is "class mitk::PlanarFigureObjectFactory", i (the 
iterator) seems fine as well, however looking at the assembly code, the 
crash is due to an indirect jump, dereferencing a null pointer.

A work-around is to preload the PlanarFigure.dll, so it does not get 
unloaded:

Poco::Util::MapConfiguration* sbConfig(new Poco::Util::MapConfiguration());
// ...
sbConfig->setString(berry::Platform::ARG_PRELOAD_LIBRARY, "PlanarFigure");

(beware of line break again)

But even that does not work reliably. If there is a certain change in 
some other part of our code (haven't figured out yet what exactly), the 
same crash happens again. This time I have to delete the local cache 
directory with the file "plugins.db" in it.

At first I thought it's got something to do with a change of class 
member layout or virtual function order when we do changes to our code. 
But it keeps crashing with PlanarFigure, so it's pretty weird...

Any ideas?



Johannes


------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to