Hi Robert,

On Dec 11, 2007 8:59 PM, Robert Osfield <[EMAIL PROTECTED]> wrote:

> Hi Serge,
>
> How reliably can you recreate the crash?
>
> Does it happen with osgviewer or other OSG examples?
>
> Could you explain whats happening in your app before the crash.
>


Here is the context of the crash :

DatabasePager configuration :
pager->setExpiryDelay(5);
pager->setUnrefImageDataAfterApplyPolicy(true, true);
pager->setDeleteRemovedSubgraphsInDatabaseThread(false);
pager->setMaximumNumOfRemovedChildPagedLODs(50);
pager->setMinimumNumOfInactivePagedLODs(0);

Registry configuration :
osgDB::Registry::instance()->getOptions()->setObjectCacheHint(osgDB::ReaderWriter::Options::CACHE_ALL);

To make it crash, I have a custom manipulator which randomely move into a
very high paged database (lots of giga). The database contains nodes with
simple geometries but also texts. Sometime it crashs after hours of
randomely moves, sometime after just 1 or 2 minutes. The crash happens in
two locations :

1 - into osgText::Text::setFont (Text.cpp line 119) because the variable
"font" is a corrupted pointer.
2 - into databasepager.cpp (line 604), during the initialization of
databaseRequest->_loadedModel, because the pointer returned by readNodeFile
is corrupted.

These crashs happen into the pager thread, and the main thread is always
into the removeExpiredSubgraphs method at this moment. In both cases, we
have a very short laps of time where a C pointer is used for an object
instead of a ref_ptr.

For the crash number 2, it seems that switching readNodeFile by a readNode
fix it. But I think that the better solution will be to prevent any cache
clear during the readNodeFile call into databasepager.cpp, I will
investigate further this morning and see if I can fix it.


>
> If we can work out the conditions that the crash happens we'll have a
> much better chance of isolation. It could be as your describe an
> object be deleted just when another thread is about to take a ref to
> it, I would have thought this would be a pretty rare condition though.
>
> Robert.
>
> On Dec 11, 2007 3:55 PM, Serge Lages <[EMAIL PROTECTED]> wrote:
> > I have another theory about the crash, let's say that :
> >
> >
> > osg::Object* object = osgDB::readObjectFile(foundFile, userOptions ?
> > userOptions : localOptions.get());
> >
> > read the object from the cache, and between this moment and the one
> where
> > the font object is set to a ref_ptr into setFont, the cache is cleared
> (into
> > another thread). With this scenario the pointer points to a deleted
> object
> > or is there anything to prevent it ?
> >
> > In my case this scenario is possible as I load my IVE with the
> databasepager
> > and that I remove the expired objects into the main thread.
> >
> >
> >
> > --
> > Serge Lages
> > http://www.tharsis-software.com
> > _______________________________________________
> > osg-users mailing list
> > [email protected]
> >
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> >
> >
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



-- 
Serge Lages
http://www.tharsis-software.com
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to