Hi Alexander,
I didn't see the crash (I work under Linux) but a code review of the
RenderSurface constructor did reveal that it was lacking a number of
member variable initializers. I have added these back including the
missing _realized = false; line. These changes are now checked in.
I've also attached the changed src/osgPlugins/cfgRenderSurface.cpp.
Could you test and let me know if it fixes things.
FYI, you don't need to svn access to check svn - you can do it all on
the website - just go to Browse Source link from the front page. Our
svn server also support https, there is a chance this might work for
you.
Robert.
On Tue, Jan 27, 2009 at 11:53 PM, Pecoraro, Alexander N
alexander.n.pecor...@lmco.com wrote:
I noticed a bug in the 2.6.0 version of the API with the viewer config file
reader plugin. I can't access the latest developer source code right now so
I can't verify that the bug still exists in the 2.7 version of the API, but
I've attached the config file that I used to reproduce the problem. The
problem is that the plugin causes a segfault when it reads that
configuration file because the _realized member variable of the
RenderSurface class defined in src/osgPlugins/cfg/RenderSurface.cpp is never
given an initial value. Interestingly enough this problem does not occur on
my Linux box, which is running Redhat Enterprise Client 5. However, on my
Windows box with Visual Studio 2005 Professional the _realized variable is
auto-initialized to true which ends up causing the segfault to occur. I'm
guessing, but haven't verified, that the reason it works on my Linux box is
because the GCC compiler auto-initializes the variable to false which
prevents the bug from occurring.
Here is how I ran the osgviewer to get it to crash:
osgviewer -c oneWindow.cfg name of osg file
I also found that once I went into the ReaderSurface's constructor and added
_realized = false; to it then the bug went away.
Alex
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
/* -*-c++-*- Producer - Copyright (C) 2001-2004 Don Burns
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
#include stdlib.h
#include string.h
#include RenderSurface.h
using namespace std;
using namespace osgProducer;
const std::string RenderSurface::defaultWindowName = std::string( *** Producer::RenderSurface *** );
const unsigned int RenderSurface::UnknownDimension = 0x;
const unsigned int RenderSurface::UnknownAmount = 0x;
unsigned int RenderSurface::_numScreens = RenderSurface::UnknownAmount;
bool RenderSurface::_shareAllGLContexts = false;
//GLContext RenderSurface::_globallySharedGLContext = 0L;
void RenderSurface::shareAllGLContexts(bool flag)
{
_shareAllGLContexts = flag;
}
bool RenderSurface::allGLContextsAreShared()
{
return _shareAllGLContexts;
}
const std::string RenderSurface::getDefaultWindowName()
{
return defaultWindowName;
}
RenderSurface::RenderSurface( void )
{
_drawableType= DrawableType_Window;
_hostname= ;
_displayNum = 0;
// _screen = 0;
_mayFullScreen = true;
_isFullScreen= true;
// This used to be #ifdefed for the X11 implementation
// but the code is pure C++ and should compile anywhere
// The _dislayNum variable is used by CGL as well.
char *envptr = getenv( DISPLAY );
if( envptr != NULL *envptr != 0 )
{
size_t p0 = 0;
size_t p1 = string(envptr).find(:, p0);
_hostname = string(envptr).substr(p0,p1);
p0 = p1+1;
p1 = string(envptr).find(., p0);
if( p1 0 )
{
_displayNum = atoi((string(envptr).substr(p0,p1)).c_str());
p0 = p1+1;
p1 = string(envptr).length() - p0;
if( p1 0 )
_screen = atoi((string(envptr).substr(p0,p1)).c_str());
}
else if( p1 string(envptr).length() )
{
p1 = string(envptr).length();
_displayNum = atoi((string(envptr).substr(p0,p1)).c_str());
_screen = 0;
}
}
_windowLeft = 0;
_windowRight= 1;
_windowBottom = 0;
_windowTop = 1;
_windowX= 0;
_windowY= 0;
_windowWidth= UnknownDimension;
_windowHeight = UnknownDimension;
_screenWidth= UnknownDimension;