OpenSceneGraph/src/osg
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
..
glu Warning fixes for Clang-3.6 2015-07-23 11:11:58 +00:00
AlphaFunc.cpp Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
AnimationPath.cpp Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
ApplicationUsage.cpp Added an OSG_INIT_SINGLETON_PROXY to make sure that the ApplicationUsage singleton gets intialized before usage. 2014-06-27 15:38:52 +00:00
ArgumentParser.cpp Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
Array.cpp From Pjotr Svetachov, "In a submission on June 27th a lot of new array types were added. This modified the osg::Array::Type enum. Because of this s_ArrayNames array in Array.cpp is now not in sync. This can lead to corrupt exports or crashes when writing .osg files because the change added new types in the middle of the enum instead of at the end. 2013-07-01 16:15:25 +00:00
ArrayDispatchers.cpp Moved GL2Extensions functionality into the include/osg/GLExtensions header and new GLExtensions object. 2014-12-10 10:38:12 +00:00
AudioStream.cpp Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
AutoTransform.cpp Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
Billboard.cpp Refactor osg::Geode to subclass from osg::Group and reuse the NodeList children container 2014-06-03 09:23:24 +00:00
BlendColor.cpp Moved GL2Extensions functionality into the include/osg/GLExtensions header and new GLExtensions object. 2014-12-10 10:38:12 +00:00
BlendEquation.cpp Moved GL2Extensions functionality into the include/osg/GLExtensions header and new GLExtensions object. 2014-12-10 10:38:12 +00:00
BlendEquationi.cpp Moved GL2Extensions functionality into the include/osg/GLExtensions header and new GLExtensions object. 2014-12-10 10:38:12 +00:00
BlendFunc.cpp Moved GL2Extensions functionality into the include/osg/GLExtensions header and new GLExtensions object. 2014-12-10 10:38:12 +00:00
BlendFunci.cpp Moved GL2Extensions functionality into the include/osg/GLExtensions header and new GLExtensions object. 2014-12-10 10:38:12 +00:00
BufferIndexBinding.cpp From Marcus Hein, Added support for OpenGL SSBO and SSBB via osg::ShaderStorageBufferObject and osg::ShaderStorageBufferBinding to core OSG library, and added new osgSSBO example 2014-12-10 12:23:04 +00:00
BufferObject.cpp From Jannik Heller, typo fixes 2015-06-01 13:11:49 +00:00
Callback.cpp Introduce osg::Object::asNode(), asNodeVisitor(), asStateAttribute() and asUniform() to replace dynamic_cast<> usage in Callback.cpp. 2015-06-09 10:49:34 +00:00
Camera.cpp Introduced osg::Camera::resize(..) method and associated enum thus: 2015-03-31 16:23:43 +00:00
CameraView.cpp Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
Capability.cpp Moved GL2Extensions functionality into the include/osg/GLExtensions header and new GLExtensions object. 2014-12-10 10:38:12 +00:00
ClampColor.cpp Moved GL2Extensions functionality into the include/osg/GLExtensions header and new GLExtensions object. 2014-12-10 10:38:12 +00:00
ClearNode.cpp Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
ClipControl.cpp From Mathias Froehlich, "Attached a new state attribute implementing the glClipControl that appeared with GL4.5." 2015-06-30 09:11:00 +00:00
ClipNode.cpp Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
ClipPlane.cpp Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
ClusterCullingCallback.cpp Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
CMakeLists.txt Build fix for VS and installing Types 2015-08-10 05:04:56 +00:00
CollectOccludersVisitor.cpp Refactored the way that hole are pruned from the occluder hole list. 2014-06-25 15:47:59 +00:00
ColorMask.cpp Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
ColorMaski.cpp Moved GL2Extensions functionality into the include/osg/GLExtensions header and new GLExtensions object. 2014-12-10 10:38:12 +00:00
ColorMatrix.cpp Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
ComputeBoundsVisitor.cpp Added handling of Drawables added directly to scene graph without Geode decorating them. 2014-07-28 16:19:44 +00:00
Config.in Removed OSG_USE_BOUND and associated osg::Bound adapter class to avoid problems with BoundingBox::expandBy/expandByRadius() implementation choosing a null BoundingBox from 2014-06-02 16:20:39 +00:00
ConvexPlanarOccluder.cpp Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
ConvexPlanarPolygon.cpp Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
CoordinateSystemNode.cpp Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
CopyOp.cpp From Konstantin Matveyev, "I've changed osg::Uniform::Callback to osg::UniformCallback. 2015-06-02 09:33:22 +00:00
CullFace.cpp Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
CullingSet.cpp Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
CullSettings.cpp Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
CullStack.cpp Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
DeleteHandler.cpp Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
Depth.cpp Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
DisplaySettings.cpp From Alexey Pavlov, "Export fix for Windows platform" 2015-01-22 16:41:34 +00:00
Drawable.cpp Moved osg::Drawable::Extensions into osg::GL2Extensions 2014-12-05 17:26:42 +00:00
DrawPixels.cpp 2014-05-14 10:19:43 +00:00
dxtctool.cpp From Diane Delallée and Sukender, "1. Image.cpp 2013-05-28 11:25:13 +00:00
dxtctool.h From Jannik Heller, typo fixes 2015-06-01 13:11:49 +00:00
Fog.cpp Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
FragmentProgram.cpp Moved GL2Extensions functionality into the include/osg/GLExtensions header and new GLExtensions object. 2014-12-10 10:38:12 +00:00
FrameBufferObject.cpp Moved GL2Extensions functionality into the include/osg/GLExtensions header and new GLExtensions object. 2014-12-10 10:38:12 +00:00
FrameStamp.cpp Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
FrontFace.cpp Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
Geode.cpp Refactor osg::Geode to subclass from osg::Group and reuse the NodeList children container 2014-06-03 09:23:24 +00:00
Geometry.cpp 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. 2015-09-04 15:35:24 +00:00
GL.in Changed GLint64 and GLuint64 setup to use int64_t and uint64_t resptectivly respectively to avoid issues with compiling against Qt5 2015-08-09 09:42:31 +00:00
GLBeginEndAdapter.cpp From Aurelien Albert, added passing on of the gl array normalize to OpenGL when uses vertex attribute aliasing. 2013-06-27 15:18:38 +00:00
GLExtensions.cpp From Jannik Heller, "Here is a patch for the S3TC capability check. 2015-07-31 13:44:39 +00:00
GLObjects.cpp Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
GLStaticLibrary.cpp Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
GLStaticLibrary.h
GraphicsContext.cpp From Jannik Heller, typo fixes 2015-06-01 13:11:49 +00:00
GraphicsCostEstimator.cpp From David Callu, warning fixes and removal of spaces at end of lines. 2013-06-28 12:00:43 +00:00
GraphicsThread.cpp Added explicit initialization of osg::Referenced(true) to osg::Operation subclasses as it uses virtual inhertiance from osg::Referenced. 2015-07-23 15:46:47 +00:00
Group.cpp Refactor osg::Geode to subclass from osg::Group and reuse the NodeList children container 2014-06-03 09:23:24 +00:00
Hint.cpp Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
Image.cpp From Kristofer Tingdahl, warning fixes. 2015-07-31 10:54:13 +00:00
ImageSequence.cpp From Laurens Voerman, "while debugging ImageSequence I had a crash, due to the very large frametimes caused by halting the program. The problem is that when the frame time exceeds the length of the entire image sequence, a looping sequence will try to read it's _imageDataList beyond its size. 2014-06-26 10:24:41 +00:00
ImageStream.cpp Commented out the disabling of use of PBO's in ImageStream, and disabled the use ClientStoreHint in Present3D. 2012-06-12 10:31:50 +00:00
ImageUtils.cpp From Albert Luaces, typo fixes. 2015-06-01 13:40:20 +00:00
KdTree.cpp Revised KdTreeBuilder so that is used the new apply(osg::Geometry&) method rather than expanding an osg::Geode. 2014-06-26 14:16:11 +00:00
Light.cpp Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
LightModel.cpp Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
LightSource.cpp From Jannik Heller, typo fixes 2015-04-07 18:01:12 +00:00
LineSegment.cpp Renamed LineSegment::intersect(BoundingSphere/Box, double/float&, double/float&) methods to LineSegment::intersectAndComputeRations(..) to avoid confusion with the change in convention for 2015-04-27 19:31:13 +00:00
LineStipple.cpp Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
LineWidth.cpp Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
LOD.cpp Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
LogicOp.cpp Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
Material.cpp Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
Math.cpp Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
Matrix_implementation.cpp Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
Matrixd.cpp Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
MatrixDecomposition.cpp Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
Matrixf.cpp Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
MatrixTransform.cpp Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
Multisample.cpp Moved GL2Extensions functionality into the include/osg/GLExtensions header and new GLExtensions object. 2014-12-10 10:38:12 +00:00
Node.cpp Fixed CollectParentPaths visitor so that it sets the setNodeMaskOverride(0xffffffff) to make sure all parents are traversed to find parents, even ones that have their NodeMask set to 0x0. 2015-04-17 13:24:44 +00:00
NodeTrackerCallback.cpp Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
NodeVisitor.cpp Changed the NodeVisitor::apply(Drawable&) to call apply(Node&) 2014-08-27 15:07:47 +00:00
Notify.cpp From Jannik Heller, typo fixes 2015-06-01 13:11:49 +00:00
Object.cpp Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
Observer.cpp
ObserverNodePath.cpp
OccluderNode.cpp Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
OcclusionQueryNode.cpp From Jannik Heller, typo fixes 2015-04-07 18:01:12 +00:00
OperationThread.cpp Added explicit initialization of osg::Referenced(true) to osg::Operation subclasses as it uses virtual inhertiance from osg::Referenced. 2015-07-23 15:46:47 +00:00
PagedLOD.cpp Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
PatchParameter.cpp Moved GL2Extensions functionality into the include/osg/GLExtensions header and new GLExtensions object. 2014-12-10 10:38:12 +00:00
Point.cpp Moved GL2Extensions functionality into the include/osg/GLExtensions header and new GLExtensions object. 2014-12-10 10:38:12 +00:00
PointSprite.cpp Moved GL2Extensions functionality into the include/osg/GLExtensions header and new GLExtensions object. 2014-12-10 10:38:12 +00:00
PolygonMode.cpp Re-organized the #ifdef's to avoid usage of glPolyginMode under GLES 2015-03-03 12:00:52 +00:00
PolygonOffset.cpp Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
PolygonStipple.cpp Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
PositionAttitudeTransform.cpp Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
PrimitiveRestartIndex.cpp Moved GL2Extensions functionality into the include/osg/GLExtensions header and new GLExtensions object. 2014-12-10 10:38:12 +00:00
PrimitiveSet.cpp Fixed handling of enums in Lua plugin. 2014-02-13 18:52:41 +00:00
Program.cpp Introduced new shader composition approach that utilizes #pragma requires(), #pragma import_defines() and #ifdef in GLSL to enable multiple different versions of shaders based 2015-02-10 17:04:02 +00:00
Projection.cpp Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
ProxyNode.cpp Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
Quat.cpp Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
Referenced.cpp From Jannik Heller, typo fixes 2015-04-13 10:43:56 +00:00
SampleMaski.cpp Moved GL2Extensions functionality into the include/osg/GLExtensions header and new GLExtensions object. 2014-12-10 10:38:12 +00:00
Scissor.cpp Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
ScriptEngine.cpp Refactored Callback system in osg::Node, osg::Drawable, osg::StateSet and osg::StateAttribute to use a new osg::Callback base class. 2014-06-05 16:26:13 +00:00
Sequence.cpp From Albert Luaces, typo fixes. 2015-06-01 13:40:20 +00:00
ShadeModel.cpp Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
Shader.cpp Quietened down #pragma(tic) shader composition messages 2015-08-10 19:18:54 +00:00
ShaderAttribute.cpp From David Callu, warning fixes and removal of spaces at end of lines. 2013-06-28 12:00:43 +00:00
ShaderComposer.cpp Added State::releaseGLObjects() and ShaderComposer::releaseGLObjects() to avoid problems with cleanup of graphics context 2013-10-21 16:35:12 +00:00
ShadowVolumeOccluder.cpp From Albert Luaces, typo fixes. 2015-06-01 13:40:20 +00:00
Shape.cpp Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
ShapeDrawable.cpp 2014-05-14 10:19:43 +00:00
State.cpp Removed spaces 2015-08-10 19:55:16 +00:00
StateAttribute.cpp Refactored Callback system in osg::Node, osg::Drawable, osg::StateSet and osg::StateAttribute to use a new osg::Callback base class. 2014-06-05 16:26:13 +00:00
StateSet.cpp Added _defineList into the osg::StateSet::compare() implementation to address issues with osgUtil::Optimizer ignoring defines. 2015-07-14 08:25:17 +00:00
Stats.cpp Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
Stencil.cpp Moved GL2Extensions functionality into the include/osg/GLExtensions header and new GLExtensions object. 2014-12-10 10:38:12 +00:00
StencilTwoSided.cpp Moved GL2Extensions functionality into the include/osg/GLExtensions header and new GLExtensions object. 2014-12-10 10:38:12 +00:00
Switch.cpp Further work on Bound class/Node::getBound() and Drawable::getBound() and usage in OSG codebase 2014-05-14 16:01:40 +00:00
TexEnv.cpp Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
TexEnvCombine.cpp Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
TexEnvFilter.cpp Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
TexGen.cpp From Albert Luaces, typo fixes. 2015-06-01 13:40:20 +00:00
TexGenNode.cpp Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
TexMat.cpp Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
Texture1D.cpp From Albert Luaces, typo fixes. 2015-06-01 13:40:20 +00:00
Texture2D.cpp Corrected the Subload::generateTextureObject() return type to make it consistent with Texture::generateTextureObject(..) 2015-08-14 15:25:08 +00:00
Texture2DArray.cpp From Albert Luaces, typo fixes. 2015-06-01 13:40:20 +00:00
Texture2DMultisample.cpp From Jannik Heller, "I have added new functions Texture::generateAndAssignTextureObject mirroring the Texture::generateTextureObject functions. 2015-06-01 10:50:44 +00:00
Texture3D.cpp From Albert Luaces, typo fixes. 2015-06-01 13:40:20 +00:00
Texture.cpp From Colin McDonald, "An earlier fix in OSG 3.2 has been inadvertently lost in 3.3.x. The glGenerateMipMap function is part of the GL_EXT_framebuffer_object extension. Just checking if the function is present before using it for texture mipmaps is not sufficient, as on remote X-windows displays the client side capability may be different from the display server. This can lead to mipmapped textures failing to render. I've restored a fbo extension check. I've also tided up the GL version checking a little." 2015-06-10 16:47:15 +00:00
TextureBuffer.cpp From Jannik Heller, "I have added new functions Texture::generateAndAssignTextureObject mirroring the Texture::generateTextureObject functions. 2015-06-01 10:50:44 +00:00
TextureCubeMap.cpp From Albert Luaces, typo fixes. 2015-06-01 13:40:20 +00:00
TextureRectangle.cpp From Albert Luaces, typo fixes. 2015-06-01 13:40:20 +00:00
Timer.cpp Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
TransferFunction.cpp Fixed image allocation operations. 2015-02-23 20:28:28 +00:00
Transform.cpp From Jannik Heller, Transform::computeBound() optimization. 2015-06-04 09:13:05 +00:00
Uniform.cpp From Konstantin Matveyev, "I've changed osg::Uniform::Callback to osg::UniformCallback. 2015-06-02 09:33:22 +00:00
UserDataContainer.cpp Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
Version.cpp Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
Version.in
VertexAttribDivisor.cpp Moved GL2Extensions functionality into the include/osg/GLExtensions header and new GLExtensions object. 2014-12-10 10:38:12 +00:00
VertexProgram.cpp Moved GL2Extensions functionality into the include/osg/GLExtensions header and new GLExtensions object. 2014-12-10 10:38:12 +00:00
View.cpp Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
Viewport.cpp Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00