CeGUI GlobalEventSet singleton segfault

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

Olex
Just popping in
Just popping in
Posts: 2
Joined: Fri Mar 10, 2006 02:44
Location: Ukrainian in Kentucky, USA
Contact:

CeGUI GlobalEventSet singleton segfault

Postby Olex » Fri Mar 10, 2006 18:01

I am using cegui 0.4.0 with ogre 1.0.6 on Gentoo Linux.

I'm using the game state architecture. When I pop a state, thats when I get a segfault with the GlobalEventSet singleton.

Heres my exit function for the state I'm popping.

Code: Select all

void IntroState::exit()
{
    if ( _EditorGuiSheet )
    {
        CEGUI::WindowManager::getSingleton().destroyWindow( _EditorGuiSheet );
    }
    if ( _GUISystem )
    {
        delete _GUISystem;
        _GUISystem = 0;
    }
    if ( _GUIRenderer )
    {
        delete _GUIRenderer;
        _GUIRenderer = 0;
    }
    _SceneMgr->clearScene();
    //!! Note: This is supposed to be mSceneMgr->destroyAllCameras(); for CVS head
    _SceneMgr->removeAllCameras();
    _Root->getAutoCreatedWindow() ->removeAllViewports();
}


The seg fault is happening from my mouseReleased method.

Code: Select all

void IntroState::mouseReleased ( MouseEvent *e )
{
    CEGUI::System::getSingleton().injectMouseButtonUp(
        convertOgreButtonToCegui( e->getButtonID() ) );
    e->consume();
}


Heres the traceback

Code: Select all

#0  0xffffe410 in ?? ()
#1  0xbf8fc648 in ?? ()
#2  0x00000006 in ?? ()
#3  0x00004e26 in ?? ()
#4  0xb70d4b59 in raise () from /lib/tls/libc.so.6
#5  0xb70d61d1 in abort () from /lib/tls/libc.so.6
#6  0xb70ce621 in __assert_fail () from /lib/tls/libc.so.6
#7  0xb73df4fb in CEGUI::GlobalEventSet::getSingleton ()
   from /usr/lib/libCEGUIBase.so.0
#8  0xb73cb8b1 in CEGUI::EventSet::fireEvent ()
   from /usr/lib/libCEGUIBase.so.0
#9  0xb7445d3e in CEGUI::Window::onMouseButtonUp ()
   from /usr/lib/libCEGUIBase.so.0
#10 0xb745c2e6 in CEGUI::ButtonBase::onMouseButtonUp ()
   from /usr/lib/libCEGUIBase.so.0
#11 0xb74c50d6 in CEGUI::PushButton::onMouseButtonUp ()
   from /usr/lib/libCEGUIBase.so.0
#12 0xb741eb45 in CEGUI::System::injectMouseButtonUp ()
   from /usr/lib/libCEGUIBase.so.0
#13 0x0804e06a in IntroState::mouseReleased (this=0x8051620, e=0x81a30c8)
    at /home/sermcgregor/work/root/gamestatedesign/src/IntroState.cpp:169
#14 0x0804bef3 in GameManager::mouseReleased (this=0x8067be8, e=0x81a30c8) at /home/sermcgregor/work/root/gamestatedesign/src/GameManager.cpp:182

#15 0xb7d5b8f4 in Ogre::MouseTarget::processMouseEvent ()
   from /usr/lib/libOgreMain.so.4
#16 0xb7cd3285 in Ogre::EventProcessor::processEvent ()
   from /usr/lib/libOgreMain.so.4
#17 0xb7cd31d0 in Ogre::EventProcessor::frameStarted ()
   from /usr/lib/libOgreMain.so.4
#18 0xb7dd76a8 in Ogre::Root::_fireFrameStarted ()
   from /usr/lib/libOgreMain.so.4
#19 0xb7dd787b in Ogre::Root::_fireFrameStarted ()
   from /usr/lib/libOgreMain.so.4
#20 0xb7dd7ce0 in Ogre::Root::renderOneFrame ()
   from /usr/lib/libOgreMain.so.4
#21 0xb7dd7c7e in Ogre::Root::startRendering ()
   from /usr/lib/libOgreMain.so.4
#22 0x0804b92c in GameManager::start (this=0x8067be8, state=0x8051620) at /home/sermcgregor/work/root/gamestatedesign/src/GameManager.cpp:72
#23 0x0804ed36 in main (argc=1, argv=0xbf8fcdc4)
    at /home/sermcgregor/work/root/gamestatedesign/src/Main.cpp:42


I also have a keyboard event that does the same thing but it doesn't crash.

Heres the error it gives me when it segfaults on the mouse click:

Code: Select all

gamestatedesign: ../include/CEGUISingleton.h:66: static T& CEGUI::Singleton<T>::getSingleton() [with T = CEGUI::GlobalEventSet]: Assertion `ms_Singleton' failed.
/bin/sh: line 1: 22168 Aborted                 ./src/gamestatedesign
Press Enter to continue!
URumble 2 using OPAL physics engine
Rumble Framework

sermcgregor
Just popping in
Just popping in
Posts: 1
Joined: Fri Mar 10, 2006 02:14

Postby sermcgregor » Sun Mar 12, 2006 07:25

At the time I wrote the above post, I was using my friends account. Anyways...

The problem I believe was that I was shutting down the CeGUI system while still in the subscribed function. When the function returned, it had nothing to return to and seg-faulted.

Instead of shutting down CeGUI, I just got rid of the root window. I figured I'd use it in my other game states anyways. Probably takes almost no memory.

Its amazing, all it takes is a little booze, and I look at things much simpler...

Olex
Just popping in
Just popping in
Posts: 2
Joined: Fri Mar 10, 2006 02:44
Location: Ukrainian in Kentucky, USA
Contact:

Postby Olex » Sun Mar 12, 2006 14:00

sermcgregor wrote:Its amazing, all it takes is a little booze, and I look at things much simpler...
Rule 1. (An inside joke). :D
URumble 2 using OPAL physics engine

Rumble Framework


Return to “Help”

Who is online

Users browsing this forum: No registered users and 6 guests