Hi Pjotr, On 24 October 2014 14:54, Pjotr Svetachov <pjotrsvetac...@gmail.com> wrote:
> We too have some trouble with the database pager. It all started after we > used DatabasePager::setUpThreads to use more threads. We get memory > corruption but only on linux. Tried to use valgrind but then the problem > does not occur. > Curiously I have found the a similar behaviour, I get crashes but when I run in valgrind I don't get any and the only issues picked up are ones that occur during cleanup and look to benign. The crashes I get look likely to be memory corruption. This happens from my new shader based terrain technique, I suspect even though the code is different there are similarities in that they create subgraphs that contain geometry and state that need compiling, culling and rendering. > We are still in the process of pinpointing it down, some theories I have > and it might help you so here are my two cents: > - we have some osgb files that reference the same images. We also have > some files that use proxy nodes to reference other files because we have > some objects that can be build out of subobjects. > There are some specific .osgb threading issues related to initialization of the wrappers. There is chance that you are hitting up against this. For my own work I'm not currently testing against .osgb and get problems so I believe the .osgb issues can be dealt with separately. > - What could happen is that the database pager tries to load this > referenced image or object and find it in the registry cache. Then it could > occur that more database pager threads run the incremental compilation over > the same objects. > The IncrementalCompileOperator only compiles objects from the GraphicsThreads assoicated with teh GraphicsContext and this ensures that for a single context all the GL objects are compiled in series, and duplicates if they exist will be checked to see if they compiling and they've already compiled will be skipped. Given this I don't think there is any danger of multiple entries. Today I added a mutex around the access to the subgraph managed by the custom TerrainTechnique I have, this looks to be fixed the crashes, but as I yet I can't spot the time that the subgraph is contended. The GeometryTechnique has a similar local subgraph so may also be hitting up to the same issue. The odd thing is that the design of the DatabasePager should be avoided this contention issue, something I haven't yet got to the bottom of. Robert.
_______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org