Hello Michael,

On 05/16/2011 01:14 PM, Michael Raab wrote:
> I'm calling osgExit() explicitly before shutting down our application.
> I don't see any reason why our extension library should be already
> unloaded at this moment.
> Do you have an idea how I can track down the field container type causes
> that problem.

only the two more or less obvious choices of running everything under a 
debugger and digging backwards from the crash's stack trace and perhaps 
putting a printf() into FieldContainerFactory::terminate(), inside the 
for loop to at least get the type id it crashes on.

> Which function is called for each FC type during shutdown?

FieldContainerType::terminate().

> Are there any log messages are generated?

not that I've seen it, looking over the code.

However, I did see that osgExit() does this:

SharedObjectHandler::the()->terminate();

if(osgSystemExitFunctions != NULL)
{
     for(Int32 i = osgSystemExitFunctions->size() - 1; i >= 0; i--)
     {
         returnValue &= (*osgSystemExitFunctions)[i]();

         if(returnValue == false)
             break;
     }
}

Can you try moving the call to SharedObjectHandler::terminate() after 
the "if"? Or use 
SharedObjectHandler::the()->removeSharedObject("your_library_name"); 
before calling osgExit() to unload your extension library.

Normally unloading a shared lib would result in the types deregistering 
themselves, but if GlobalSystemState == Shutdown (one of the first 
things osgExit does is setting this), this does not happen - so this is 
a bug. I'm not sure yet if adjusting osgExit as above is the correct way 
to fix this.

        Cheers,
                Carsten

------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
Opensg-users mailing list
Opensg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to