[FIXED] Segfault on initialisation

nikki

22-11-2011 06:13:46

I've just been working on migrating my code to work with the latest MyGUI and Ogre version. After some initial messing around with MessageBox and some deprecated functions calls, I got it to compile. When I run, it segfaults, here's the backtrace:

Program received signal SIGSEGV, Segmentation fault.
0x00007fffeffd1178 in Ogre::GLRenderSystem::setScissorTest(bool, unsigned long, unsigned long, unsigned long
, unsigned long) () from /usr/lib/OGRE/RenderSystem_GL.so
(gdb) backtrace
#0 0x00007fffeffd1178 in Ogre::GLRenderSystem::setScissorTest(bool, unsigned long, unsigned long, unsigned
long, unsigned long) () from /usr/lib/OGRE/RenderSystem_GL.so
#1 0x000000000062daed in MyGUI::OgreRenderManager::updateRenderInfo() ()
#2 0x000000000062dd84 in MyGUI::OgreRenderManager::initialise(Ogre::RenderWindow*, Ogre::SceneManager*) ()
#3 0x000000000043339e in MyGUI::OgrePlatform::initialise (this=0x7fffe00e1660, _window=0x7ffff7ec5848, _sce
ne=0x7ffff7ecfa18, _group=..., _logName=...) at /usr/include/MYGUI/MyGUI_OgrePlatform.h:51
#4 0x0000000000435945 in Game::init (this=0x7fffffffe230, progname=0x7fffffffe7af "/home/nikki/Development/
Projects/grall2/bin/debug/GraLL2_d") at main.cpp:356
#5 0x000000000042524e in main (argc=1, argv=0x7fffffffe418) at main.cpp:562

Here's how I initialise MyGUI:

MyGUI::OgrePlatform *guiPlatform = new MyGUI::OgrePlatform();
guiPlatform->initialise(GlbVar.ogreWindow, GlbVar.ogreSmgr, "General", USER_PREFIX "gui.log");
GlbVar.gui = new MyGUI::Gui();
GlbVar.gui->initialise("core.xml");
MyGUI::ResourceManager::getInstance().load("MessageBoxResources.xml");

I'm using MyGUI binaries provided by my Linux distribution and so couldn't step further into the code. I might compile a debug version of MyGUI, compile with that and step in later.

It might be that I'm skipping some initialisation step? Or maybe my data files are out of date? I'm using the same *.xml files as before (except the MessageBox stuff which I newly copied as instructed in this post).

nikki

22-11-2011 06:36:38

Nevermind - fixed it. I compiled from source. Seems my linux distribution had a newer Ogre than the one MyGUI was compiled with.