Crash on OgreCEGUIRenderer construction
Posted: Mon Aug 20, 2007 19:18
I'm trying to use CEGUI with Ogre, but so far, it didn't work for me. As the program crashes on the construction of OgreCEGUIRenderer:
The full source code can be found here.
I have the impression (but I'm not fully sure) that the this crash occurs on some systems and not on others.
However the program doesn't crash when I use valgrind, a debugging tool.
Here are the errors logged by valgrind, concerning CEGUI:
What could be the cause of the problem? And how do I solve it?
Code: Select all
renderer = new CEGUI :: OgreCEGUIRenderer (& window);
The full source code can be found here.
I have the impression (but I'm not fully sure) that the this crash occurs on some systems and not on others.
However the program doesn't crash when I use valgrind, a debugging tool.
Here are the errors logged by valgrind, concerning CEGUI:
==6844== Invalid write of size 4
==6844== at 0x468CF30: CEGUI::OgreCEGUIRenderer::OgreCEGUIRenderer(Ogre::RenderWindow*, unsigned char, bool, unsigned) (stl_list.h:308)
==6844== by 0x80EF499: Radakan::Engines::GUI_Engine::GUI_Engine(Ogre::RenderWindow&, Ogre::SceneManager&) (gui_engine.cpp:29)
==6844== by 0x8157F54: Radakan::Engines::Game::Game(std::string, std::string) (game.cpp:119)
==6844== by 0x811040C: main (main.cpp:37)
==6844== Address 0x61007A8 is 8 bytes after a block of size 496 alloc'd
==6844== at 0x4021D7B: operator new(unsigned) (in /usr/lib/valgrind/x86-linux/vgpreload_memcheck.so)
==6844== by 0x80EF470: Radakan::Engines::GUI_Engine::GUI_Engine(Ogre::RenderWindow&, Ogre::SceneManager&) (gui_engine.cpp:29)
==6844== by 0x8157F54: Radakan::Engines::Game::Game(std::string, std::string) (game.cpp:119)
==6844== by 0x811040C: main (main.cpp:37)
==6844==
==6844== Invalid write of size 4
==6844== at 0x468CF3A: CEGUI::OgreCEGUIRenderer::OgreCEGUIRenderer(Ogre::RenderWindow*, unsigned char, bool, unsigned) (stl_list.h:347)
==6844== by 0x80EF499: Radakan::Engines::GUI_Engine::GUI_Engine(Ogre::RenderWindow&, Ogre::SceneManager&) (gui_engine.cpp:29)
==6844== by 0x8157F54: Radakan::Engines::Game::Game(std::string, std::string) (game.cpp:119)
==6844== by 0x811040C: main (main.cpp:37)
==6844== Address 0x61007A4 is 4 bytes after a block of size 496 alloc'd
==6844== at 0x4021D7B: operator new(unsigned) (in /usr/lib/valgrind/x86-linux/vgpreload_memcheck.so)
==6844== by 0x80EF470: Radakan::Engines::GUI_Engine::GUI_Engine(Ogre::RenderWindow&, Ogre::SceneManager&) (gui_engine.cpp:29)
==6844== by 0x8157F54: Radakan::Engines::Game::Game(std::string, std::string) (game.cpp:119)
==6844== by 0x811040C: main (main.cpp:37)
==6844==
==6844== Invalid write of size 4
==6844== at 0x468CF40: CEGUI::OgreCEGUIRenderer::OgreCEGUIRenderer(Ogre::RenderWindow*, unsigned char, bool, unsigned) (stl_list.h:348)
==6844== by 0x80EF499: Radakan::Engines::GUI_Engine::GUI_Engine(Ogre::RenderWindow&, Ogre::SceneManager&) (gui_engine.cpp:29)
==6844== by 0x8157F54: Radakan::Engines::Game::Game(std::string, std::string) (game.cpp:119)
==6844== by 0x811040C: main (main.cpp:37)
==6844== Address 0x61007A8 is 8 bytes after a block of size 496 alloc'd
==6844== at 0x4021D7B: operator new(unsigned) (in /usr/lib/valgrind/x86-linux/vgpreload_memcheck.so)
==6844== by 0x80EF470: Radakan::Engines::GUI_Engine::GUI_Engine(Ogre::RenderWindow&, Ogre::SceneManager&) (gui_engine.cpp:29)
==6844== by 0x8157F54: Radakan::Engines::Game::Game(std::string, std::string) (game.cpp:119)
==6844== by 0x811040C: main (main.cpp:37)
==6844==
==6844== Invalid write of size 4
==6844== at 0x468B893: CEGUI::OgreCEGUIRenderer::constructor_impl(Ogre::RenderWindow*, unsigned char, bool, unsigned) (OgreCEGUIRenderer.cpp:699)
==6844== by 0x468CF68: CEGUI::OgreCEGUIRenderer::OgreCEGUIRenderer(Ogre::RenderWindow*, unsigned char, bool, unsigned) (OgreCEGUIRenderer.cpp:98)
==6844== by 0x80EF499: Radakan::Engines::GUI_Engine::GUI_Engine(Ogre::RenderWindow&, Ogre::SceneManager&) (gui_engine.cpp:29)
==6844== by 0x8157F54: Radakan::Engines::Game::Game(std::string, std::string) (game.cpp:119)
==6844== by 0x811040C: main (main.cpp:37)
==6844== Address 0x61007A0 is 0 bytes after a block of size 496 alloc'd
==6844== at 0x4021D7B: operator new(unsigned) (in /usr/lib/valgrind/x86-linux/vgpreload_memcheck.so)
==6844== by 0x80EF470: Radakan::Engines::GUI_Engine::GUI_Engine(Ogre::RenderWindow&, Ogre::SceneManager&) (gui_engine.cpp:29)
==6844== by 0x8157F54: Radakan::Engines::Game::Game(std::string, std::string) (game.cpp:119)
==6844== by 0x811040C: main (main.cpp:37)
--6844-- Reading syms from /usr/lib/libCEGUILibxmlParser.so.0.0.0 (0x7D76000)
--6844-- Reading syms from /usr/lib/libxml2.so.2.6.28 (0x7D7B000)
--6844-- object doesn't have a symbol table
==6844==
==6844== Invalid read of size 4
==6844== at 0x48B6A27: std::_List_node_base::hook(std::_List_node_base*) (in /usr/lib/gcc/i686-pc-linux-gnu/4.1.2/libstdc++.so.6.0.8)
==6844== by 0x468B38B: CEGUI::OgreCEGUIRenderer::createTexture() (stl_list.h:1140)
==6844== by 0x468ACF1: CEGUI::OgreCEGUIRenderer::createTexture(CEGUI::String const&, CEGUI::String const&) (OgreCEGUIRenderer.cpp:381)
==6844== by 0x45130D4: CEGUI::Imageset_xmlHandler::elementImagesetStart(CEGUI::XMLAttributes const&) (CEGUIImageset_xmlHandler.cpp:120)
==6844== by 0x45134A6: CEGUI::Imageset_xmlHandler::elementStart(CEGUI::String const&, CEGUI::XMLAttributes const&) (CEGUIImageset_xmlHandler.cpp:74)
==6844== by 0x7D781E3: CEGUI::processXMLElement(CEGUI::XMLHandler&, _xmlNode*) (CEGUILibxmlParser.cpp:59)
==6844== by 0x7D78D38: CEGUI::LibxmlParser::parseXMLFile(CEGUI::XMLHandler&, CEGUI::String const&, CEGUI::String const&, CEGUI::String const&) (CEGUILibxmlParser.cpp:118)
==6844== by 0x450C70F: CEGUI::Imageset::load(CEGUI::String const&, CEGUI::String const&) (CEGUIImageset.cpp:157)
==6844== by 0x450C9D1: CEGUI::Imageset::Imageset(CEGUI::String const&, CEGUI::String const&) (CEGUIImageset.cpp:83)
==6844== by 0x45101E7: CEGUI::ImagesetManager::createImageset(CEGUI::String const&, CEGUI::String const&) (CEGUIImagesetManager.cpp:94)
==6844== by 0x80EFBBD: Radakan::Engines::GUI_Engine::GUI_Engine(Ogre::RenderWindow&, Ogre::SceneManager&) (gui_engine.cpp:41)
==6844== by 0x8157F54: Radakan::Engines::Game::Game(std::string, std::string) (game.cpp:119)
==6844== Address 0x61007A8 is 8 bytes after a block of size 496 alloc'd
==6844== at 0x4021D7B: operator new(unsigned) (in /usr/lib/valgrind/x86-linux/vgpreload_memcheck.so)
==6844== by 0x80EF470: Radakan::Engines::GUI_Engine::GUI_Engine(Ogre::RenderWindow&, Ogre::SceneManager&) (gui_engine.cpp:29)
==6844== by 0x8157F54: Radakan::Engines::Game::Game(std::string, std::string) (game.cpp:119)
==6844== by 0x811040C: main (main.cpp:37)
==6844==
==6844== Invalid read of size 4
==6844== at 0x48B6A2D: std::_List_node_base::hook(std::_List_node_base*) (in /usr/lib/gcc/i686-pc-linux-gnu/4.1.2/libstdc++.so.6.0.8)
==6844== by 0x468B38B: CEGUI::OgreCEGUIRenderer::createTexture() (stl_list.h:1140)
==6844== by 0x468ACF1: CEGUI::OgreCEGUIRenderer::createTexture(CEGUI::String const&, CEGUI::String const&) (OgreCEGUIRenderer.cpp:381)
==6844== by 0x45130D4: CEGUI::Imageset_xmlHandler::elementImagesetStart(CEGUI::XMLAttributes const&) (CEGUIImageset_xmlHandler.cpp:120)
==6844== by 0x45134A6: CEGUI::Imageset_xmlHandler::elementStart(CEGUI::String const&, CEGUI::XMLAttributes const&) (CEGUIImageset_xmlHandler.cpp:74)
==6844== by 0x7D781E3: CEGUI::processXMLElement(CEGUI::XMLHandler&, _xmlNode*) (CEGUILibxmlParser.cpp:59)
==6844== by 0x7D78D38: CEGUI::LibxmlParser::parseXMLFile(CEGUI::XMLHandler&, CEGUI::String const&, CEGUI::String const&, CEGUI::String const&) (CEGUILibxmlParser.cpp:118)
==6844== by 0x450C70F: CEGUI::Imageset::load(CEGUI::String const&, CEGUI::String const&) (CEGUIImageset.cpp:157)
==6844== by 0x450C9D1: CEGUI::Imageset::Imageset(CEGUI::String const&, CEGUI::String const&) (CEGUIImageset.cpp:83)
==6844== by 0x45101E7: CEGUI::ImagesetManager::createImageset(CEGUI::String const&, CEGUI::String const&) (CEGUIImagesetManager.cpp:94)
==6844== by 0x80EFBBD: Radakan::Engines::GUI_Engine::GUI_Engine(Ogre::RenderWindow&, Ogre::SceneManager&) (gui_engine.cpp:41)
==6844== by 0x8157F54: Radakan::Engines::Game::Game(std::string, std::string) (game.cpp:119)
==6844== Address 0x61007A8 is 8 bytes after a block of size 496 alloc'd
==6844== at 0x4021D7B: operator new(unsigned) (in /usr/lib/valgrind/x86-linux/vgpreload_memcheck.so)
==6844== by 0x80EF470: Radakan::Engines::GUI_Engine::GUI_Engine(Ogre::RenderWindow&, Ogre::SceneManager&) (gui_engine.cpp:29)
==6844== by 0x8157F54: Radakan::Engines::Game::Game(std::string, std::string) (game.cpp:119)
==6844== by 0x811040C: main (main.cpp:37)
==6844==
==6844== Invalid write of size 4
==6844== at 0x48B6A30: std::_List_node_base::hook(std::_List_node_base*) (in /usr/lib/gcc/i686-pc-linux-gnu/4.1.2/libstdc++.so.6.0.8)
==6844== by 0x468B38B: CEGUI::OgreCEGUIRenderer::createTexture() (stl_list.h:1140)
==6844== by 0x468ACF1: CEGUI::OgreCEGUIRenderer::createTexture(CEGUI::String const&, CEGUI::String const&) (OgreCEGUIRenderer.cpp:381)
==6844== by 0x45130D4: CEGUI::Imageset_xmlHandler::elementImagesetStart(CEGUI::XMLAttributes const&) (CEGUIImageset_xmlHandler.cpp:120)
==6844== by 0x45134A6: CEGUI::Imageset_xmlHandler::elementStart(CEGUI::String const&, CEGUI::XMLAttributes const&) (CEGUIImageset_xmlHandler.cpp:74)
==6844== by 0x7D781E3: CEGUI::processXMLElement(CEGUI::XMLHandler&, _xmlNode*) (CEGUILibxmlParser.cpp:59)
==6844== by 0x7D78D38: CEGUI::LibxmlParser::parseXMLFile(CEGUI::XMLHandler&, CEGUI::String const&, CEGUI::String const&, CEGUI::String const&) (CEGUILibxmlParser.cpp:118)
==6844== by 0x450C70F: CEGUI::Imageset::load(CEGUI::String const&, CEGUI::String const&) (CEGUIImageset.cpp:157)
==6844== by 0x450C9D1: CEGUI::Imageset::Imageset(CEGUI::String const&, CEGUI::String const&) (CEGUIImageset.cpp:83)
==6844== by 0x45101E7: CEGUI::ImagesetManager::createImageset(CEGUI::String const&, CEGUI::String const&) (CEGUIImagesetManager.cpp:94)
==6844== by 0x80EFBBD: Radakan::Engines::GUI_Engine::GUI_Engine(Ogre::RenderWindow&, Ogre::SceneManager&) (gui_engine.cpp:41)
==6844== by 0x8157F54: Radakan::Engines::Game::Game(std::string, std::string) (game.cpp:119)
==6844== Address 0x61007A4 is 4 bytes after a block of size 496 alloc'd
==6844== at 0x4021D7B: operator new(unsigned) (in /usr/lib/valgrind/x86-linux/vgpreload_memcheck.so)
==6844== by 0x80EF470: Radakan::Engines::GUI_Engine::GUI_Engine(Ogre::RenderWindow&, Ogre::SceneManager&) (gui_engine.cpp:29)
==6844== by 0x8157F54: Radakan::Engines::Game::Game(std::string, std::string) (game.cpp:119)
==6844== by 0x811040C: main (main.cpp:37)
==6844==
==6844== Invalid write of size 4
==6844== at 0x48B6A32: std::_List_node_base::hook(std::_List_node_base*) (in /usr/lib/gcc/i686-pc-linux-gnu/4.1.2/libstdc++.so.6.0.8)
==6844== by 0x468B38B: CEGUI::OgreCEGUIRenderer::createTexture() (stl_list.h:1140)
==6844== by 0x468ACF1: CEGUI::OgreCEGUIRenderer::createTexture(CEGUI::String const&, CEGUI::String const&) (OgreCEGUIRenderer.cpp:381)
==6844== by 0x45130D4: CEGUI::Imageset_xmlHandler::elementImagesetStart(CEGUI::XMLAttributes const&) (CEGUIImageset_xmlHandler.cpp:120)
==6844== by 0x45134A6: CEGUI::Imageset_xmlHandler::elementStart(CEGUI::String const&, CEGUI::XMLAttributes const&) (CEGUIImageset_xmlHandler.cpp:74)
==6844== by 0x7D781E3: CEGUI::processXMLElement(CEGUI::XMLHandler&, _xmlNode*) (CEGUILibxmlParser.cpp:59)
==6844== by 0x7D78D38: CEGUI::LibxmlParser::parseXMLFile(CEGUI::XMLHandler&, CEGUI::String const&, CEGUI::String const&, CEGUI::String const&) (CEGUILibxmlParser.cpp:118)
==6844== by 0x450C70F: CEGUI::Imageset::load(CEGUI::String const&, CEGUI::String const&) (CEGUIImageset.cpp:157)
==6844== by 0x450C9D1: CEGUI::Imageset::Imageset(CEGUI::String const&, CEGUI::String const&) (CEGUIImageset.cpp:83)
==6844== by 0x45101E7: CEGUI::ImagesetManager::createImageset(CEGUI::String const&, CEGUI::String const&) (CEGUIImagesetManager.cpp:94)
==6844== by 0x80EFBBD: Radakan::Engines::GUI_Engine::GUI_Engine(Ogre::RenderWindow&, Ogre::SceneManager&) (gui_engine.cpp:41)
==6844== by 0x8157F54: Radakan::Engines::Game::Game(std::string, std::string) (game.cpp:119)
==6844== Address 0x61007A8 is 8 bytes after a block of size 496 alloc'd
==6844== at 0x4021D7B: operator new(unsigned) (in /usr/lib/valgrind/x86-linux/vgpreload_memcheck.so)
==6844== by 0x80EF470: Radakan::Engines::GUI_Engine::GUI_Engine(Ogre::RenderWindow&, Ogre::SceneManager&) (gui_engine.cpp:29)
==6844== by 0x8157F54: Radakan::Engines::Game::Game(std::string, std::string) (game.cpp:119)
==6844== by 0x811040C: main (main.cpp:37)
==6844==
==6844== Invalid read of size 1
==6844== at 0x50E8348: iReadLump (il_files.c:442)
==6844== Address 0x6EA4D31 is 0 bytes after a block of size 3,393 alloc'd
==6844== at 0x4021A0F: operator new[](unsigned) (in /usr/lib/valgrind/x86-linux/vgpreload_memcheck.so)
==6844== by 0x41459B6: Ogre::MemoryDataStream::MemoryDataStream(Ogre::SharedPtr<Ogre::DataStream>&, bool) (OgreDataStream.cpp:226)
==6844== by 0x4385DC5: Ogre::ILImageCodec::decode(Ogre::SharedPtr<Ogre::DataStream>&) const (OgreILImageCodec.cpp:122)
==6844== by 0x419CED1: Ogre::Image::load(Ogre::SharedPtr<Ogre::DataStream>&, std::string const&) (OgreImage.cpp:409)
==6844== by 0x53B2F2A: Ogre::GLTexture::loadImpl() (OgreGLTexture.cpp:272)
==6844== by 0x42A83DC: Ogre::Resource::load(bool) (OgreResource.cpp:116)
==6844== by 0x4345A16: Ogre::TextureManager::load(std::string const&, std::string const&, Ogre::TextureType, int, float, bool, Ogre::PixelFormat) (OgreTextureManager.cpp:78)
==6844== by 0x468EEEE: CEGUI::OgreCEGUITexture::loadFromFile(CEGUI::String const&, CEGUI::String const&) (OgreCEGUITexture.cpp:102)
==6844== by 0x468AD09: CEGUI::OgreCEGUIRenderer::createTexture(CEGUI::String const&, CEGUI::String const&) (OgreCEGUIRenderer.cpp:382)
==6844== by 0x45130D4: CEGUI::Imageset_xmlHandler::elementImagesetStart(CEGUI::XMLAttributes const&) (CEGUIImageset_xmlHandler.cpp:120)
==6844== by 0x45134A6: CEGUI::Imageset_xmlHandler::elementStart(CEGUI::String const&, CEGUI::XMLAttributes const&) (CEGUIImageset_xmlHandler.cpp:74)
==6844== by 0x7D781E3: CEGUI::processXMLElement(CEGUI::XMLHandler&, _xmlNode*) (CEGUILibxmlParser.cpp:59)
==6844==
==6844== Invalid read of size 1
==6844== at 0x50E8375: iReadLump (il_files.c:442)
==6844== Address 0x6EA4D32 is 1 bytes after a block of size 3,393 alloc'd
==6844== at 0x4021A0F: operator new[](unsigned) (in /usr/lib/valgrind/x86-linux/vgpreload_memcheck.so)
==6844== by 0x41459B6: Ogre::MemoryDataStream::MemoryDataStream(Ogre::SharedPtr<Ogre::DataStream>&, bool) (OgreDataStream.cpp:226)
==6844== by 0x4385DC5: Ogre::ILImageCodec::decode(Ogre::SharedPtr<Ogre::DataStream>&) const (OgreILImageCodec.cpp:122)
==6844== by 0x419CED1: Ogre::Image::load(Ogre::SharedPtr<Ogre::DataStream>&, std::string const&) (OgreImage.cpp:409)
==6844== by 0x53B2F2A: Ogre::GLTexture::loadImpl() (OgreGLTexture.cpp:272)
==6844== by 0x42A83DC: Ogre::Resource::load(bool) (OgreResource.cpp:116)
==6844== by 0x4345A16: Ogre::TextureManager::load(std::string const&, std::string const&, Ogre::TextureType, int, float, bool, Ogre::PixelFormat) (OgreTextureManager.cpp:78)
==6844== by 0x468EEEE: CEGUI::OgreCEGUITexture::loadFromFile(CEGUI::String const&, CEGUI::String const&) (OgreCEGUITexture.cpp:102)
==6844== by 0x468AD09: CEGUI::OgreCEGUIRenderer::createTexture(CEGUI::String const&, CEGUI::String const&) (OgreCEGUIRenderer.cpp:382)
==6844== by 0x45130D4: CEGUI::Imageset_xmlHandler::elementImagesetStart(CEGUI::XMLAttributes const&) (CEGUIImageset_xmlHandler.cpp:120)
==6844== by 0x45134A6: CEGUI::Imageset_xmlHandler::elementStart(CEGUI::String const&, CEGUI::XMLAttributes const&) (CEGUIImageset_xmlHandler.cpp:74)
==6844== by 0x7D781E3: CEGUI::processXMLElement(CEGUI::XMLHandler&, _xmlNode*) (CEGUILibxmlParser.cpp:59)
--6844-- Reading syms from /usr/lib/libCEGUIFalagardWRBase.so.1.0.0 (0x7F8C000)
==6844==
==6844== Use of uninitialised value of size 4
==6844== at 0x48D4008: (within /usr/lib/gcc/i686-pc-linux-gnu/4.1.2/libstdc++.so.6.0.8)
==6844== by 0x48E3B3B: std::ostreambuf_iterator<char, std::char_traits<char> > std::num_put<char, std::ostreambuf_iterator<char, std::char_traits<char> > >::_M_insert_int<unsigned long>(std::ostreambuf_iterator<char, std::char_traits<char> >, std::ios_base&, char, unsigned long) const (in /usr/lib/gcc/i686-pc-linux-gnu/4.1.2/libstdc++.so.6.0.8)
==6844== by 0x48E3E49: std::num_put<char, std::ostreambuf_iterator<char, std::char_traits<char> > >::do_put(std::ostreambuf_iterator<char, std::char_traits<char> >, std::ios_base&, char, unsigned long) const (in /usr/lib/gcc/i686-pc-linux-gnu/4.1.2/libstdc++.so.6.0.8)
==6844== by 0x48EC376: std::ostream::operator<<(unsigned) (in /usr/lib/gcc/i686-pc-linux-gnu/4.1.2/libstdc++.so.6.0.8)
==6844== by 0x815A25E: Radakan::Engines::Log::log(Radakan::Object const&) (log.cpp:65)
==6844== by 0x815A487: Radakan::Engines::Log::trace(Radakan::Object const&, std::string, std::string, std::string, std::string, std::string, std::string, std::string, std::string) (log.cpp:119)
==6844== by 0x8095460: Radakan::Singleton<Radakan::World>::Singleton() (singleton.cpp:22)
==6844== by 0x813B6A3: Radakan::World::World(Ogre::SceneManager&) (world.cpp:54)
==6844== by 0x8157F6E: Radakan::Engines::Game::Game(std::string, std::string) (game.cpp:121)
==6844== by 0x811040C: main (main.cpp:37)
What could be the cause of the problem? And how do I solve it?