Robert Osfield
cb3396b0e5
From Jannik Heller, "I've hit what I believe to be a bug (or at the very least, an unintuitive behaviour) in the osg::Geometry copy constructor. I noticed it when using osg::clone on a Geometry with vertex buffer objects, and the copy flags DEEP_COPY_ARRAYS. To be precise, I add a Geometry to an osgUtil::IncrementalCompileOperation, then osg::clone the Geometry. I was getting reports from users of random crashes happening.
...
I believe the offending lines are in the osg::Geometry copy constructor:
if ((copyop.getCopyFlags() & osg::CopyOp::DEEP_COPY_ARRAYS))
{
if (_useVertexBufferObjects)
{
// copying of arrays doesn't set up buffer objects so we'll need to force
// Geometry to assign these, we'll do this by switching off VBO's then renabling them.
setUseVertexBufferObjects(false);
setUseVertexBufferObjects(true);
}
}
Toggling the vertex buffer objects off then on again actually touches not only the arrays controlled by DEEP_COPY_ARRAYS, but also the PrimitiveSets which are controlled by DEEP_COPY_PRIMITIVES. This means if the user has copyflags of only DEEP_COPY_ARRAYS, we are modifying arrays that belong to the original const Geometry& we are copying from. I believe this shouldn't be allowed to happen because we are using a const& specifier for the original Geometry.
In my case the osgUtil::IncrementalCompileOperation was trying to compile the geometry, while in the main thread a clone operation toggled the VBO's off and on, a crash ensues.
In the attached patch, you will find a more efficient handling of VBO's in the osg::Geometry copy constructor, so that only the Arrays that were actually deep copied have their VBO assigned, and no changes are made to Arrays that already had a valid VBO assigned. In addition, the DEEP_COPY_PRIMITIVES flag is now honored so that VBO's are set up correctly should a user copy a Geometry with only that flag.
"
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@15129 16af8721-9629-0410-8352-f15c8da7e697
2015-09-04 15:35:24 +00:00
..
2015-07-23 11:11:58 +00:00
2012-03-21 17:36:20 +00:00
2012-03-21 17:36:20 +00:00
2014-06-27 15:38:52 +00:00
2012-03-21 17:36:20 +00:00
2013-07-01 16:15:25 +00:00
2014-12-10 10:38:12 +00:00
2012-03-21 17:36:20 +00:00
2012-03-21 17:36:20 +00:00
2014-06-03 09:23:24 +00:00
2014-12-10 10:38:12 +00:00
2014-12-10 10:38:12 +00:00
2014-12-10 10:38:12 +00:00
2014-12-10 10:38:12 +00:00
2014-12-10 10:38:12 +00:00
2014-12-10 12:23:04 +00:00
2015-06-01 13:11:49 +00:00
2015-06-09 10:49:34 +00:00
2015-03-31 16:23:43 +00:00
2012-03-21 17:36:20 +00:00
2014-12-10 10:38:12 +00:00
2014-12-10 10:38:12 +00:00
2012-03-21 17:36:20 +00:00
2015-06-30 09:11:00 +00:00
2012-03-21 17:36:20 +00:00
2012-03-21 17:36:20 +00:00
2012-03-21 17:36:20 +00:00
2015-08-10 05:04:56 +00:00
2014-06-25 15:47:59 +00:00
2012-03-21 17:36:20 +00:00
2014-12-10 10:38:12 +00:00
2012-03-21 17:36:20 +00:00
2014-07-28 16:19:44 +00:00
2014-06-02 16:20:39 +00:00
2012-03-21 17:36:20 +00:00
2012-03-21 17:36:20 +00:00
2012-03-21 17:36:20 +00:00
2015-06-02 09:33:22 +00:00
2012-03-21 17:36:20 +00:00
2012-03-21 17:36:20 +00:00
2012-03-21 17:36:20 +00:00
2012-03-21 17:36:20 +00:00
2012-03-21 17:36:20 +00:00
2012-03-21 17:36:20 +00:00
2015-01-22 16:41:34 +00:00
2014-12-05 17:26:42 +00:00
2014-05-14 10:19:43 +00:00
2013-05-28 11:25:13 +00:00
2015-06-01 13:11:49 +00:00
2012-03-21 17:36:20 +00:00
2014-12-10 10:38:12 +00:00
2014-12-10 10:38:12 +00:00
2012-03-21 17:36:20 +00:00
2012-03-21 17:36:20 +00:00
2014-06-03 09:23:24 +00:00
2015-09-04 15:35:24 +00:00
2015-08-09 09:42:31 +00:00
2013-06-27 15:18:38 +00:00
2015-07-31 13:44:39 +00:00
2012-03-21 17:36:20 +00:00
2012-03-21 17:36:20 +00:00
2010-11-22 11:22:03 +00:00
2015-06-01 13:11:49 +00:00
2013-06-28 12:00:43 +00:00
2015-07-23 15:46:47 +00:00
2014-06-03 09:23:24 +00:00
2012-03-21 17:36:20 +00:00
2015-07-31 10:54:13 +00:00
2014-06-26 10:24:41 +00:00
2012-06-12 10:31:50 +00:00
2015-06-01 13:40:20 +00:00
2014-06-26 14:16:11 +00:00
2012-03-21 17:36:20 +00:00
2012-03-21 17:36:20 +00:00
2015-04-07 18:01:12 +00:00
2015-04-27 19:31:13 +00:00
2012-03-21 17:36:20 +00:00
2012-03-21 17:36:20 +00:00
2012-03-21 17:36:20 +00:00
2012-03-21 17:36:20 +00:00
2012-03-21 17:36:20 +00:00
2012-03-21 17:36:20 +00:00
2012-03-21 17:36:20 +00:00
2012-03-21 17:36:20 +00:00
2012-03-21 17:36:20 +00:00
2012-03-21 17:36:20 +00:00
2012-03-21 17:36:20 +00:00
2014-12-10 10:38:12 +00:00
2015-04-17 13:24:44 +00:00
2012-03-21 17:36:20 +00:00
2014-08-27 15:07:47 +00:00
2015-06-01 13:11:49 +00:00
2012-03-21 17:36:20 +00:00
2010-05-20 13:38:28 +00:00
2010-05-28 08:57:48 +00:00
2012-03-21 17:36:20 +00:00
2015-04-07 18:01:12 +00:00
2015-07-23 15:46:47 +00:00
2012-03-21 17:36:20 +00:00
2014-12-10 10:38:12 +00:00
2014-12-10 10:38:12 +00:00
2014-12-10 10:38:12 +00:00
2015-03-03 12:00:52 +00:00
2012-03-21 17:36:20 +00:00
2012-03-21 17:36:20 +00:00
2012-03-21 17:36:20 +00:00
2014-12-10 10:38:12 +00:00
2014-02-13 18:52:41 +00:00
2015-02-10 17:04:02 +00:00
2012-03-21 17:36:20 +00:00
2012-03-21 17:36:20 +00:00
2012-03-21 17:36:20 +00:00
2015-04-13 10:43:56 +00:00
2014-12-10 10:38:12 +00:00
2012-03-21 17:36:20 +00:00
2014-06-05 16:26:13 +00:00
2015-06-01 13:40:20 +00:00
2012-03-21 17:36:20 +00:00
2015-08-10 19:18:54 +00:00
2013-06-28 12:00:43 +00:00
2013-10-21 16:35:12 +00:00
2015-06-01 13:40:20 +00:00
2012-03-21 17:36:20 +00:00
2014-05-14 10:19:43 +00:00
2015-08-10 19:55:16 +00:00
2014-06-05 16:26:13 +00:00
2015-07-14 08:25:17 +00:00
2012-03-21 17:36:20 +00:00
2014-12-10 10:38:12 +00:00
2014-12-10 10:38:12 +00:00
2014-05-14 16:01:40 +00:00
2012-03-21 17:36:20 +00:00
2012-03-21 17:36:20 +00:00
2012-03-21 17:36:20 +00:00
2015-06-01 13:40:20 +00:00
2012-03-21 17:36:20 +00:00
2012-03-21 17:36:20 +00:00
2015-06-01 13:40:20 +00:00
2015-08-14 15:25:08 +00:00
2015-06-01 13:40:20 +00:00
2015-06-01 10:50:44 +00:00
2015-06-01 13:40:20 +00:00
2015-06-10 16:47:15 +00:00
2015-06-01 10:50:44 +00:00
2015-06-01 13:40:20 +00:00
2015-06-01 13:40:20 +00:00
2012-03-21 17:36:20 +00:00
2015-02-23 20:28:28 +00:00
2015-06-04 09:13:05 +00:00
2015-06-02 09:33:22 +00:00
2012-03-21 17:36:20 +00:00
2012-03-21 17:36:20 +00:00
2009-11-23 09:53:08 +00:00
2014-12-10 10:38:12 +00:00
2014-12-10 10:38:12 +00:00
2012-03-21 17:36:20 +00:00
2012-03-21 17:36:20 +00:00