notifyDisplaySizeChanged segfaults

Issue #1121 invalid
Former user created an issue

Disclaimer: bear with me, I'm new to CEGUI. If additional info is needed, I'll be happy to provide anything.

I've started a little project that makes use of some very classic bricks: Ogre, OIS, CEGUI and Bullet.

So far things go great, I'm fixing one little thing after the other.

I got to the point where I need to fix the behavior of my app when resizing the window. Naturally, I turned to notifyDisplayChanged to do most of the job on the CEGUI side. I use it inside my windowResized event in my WindowEventListener.

  void WindowEventListener::windowResized (Ogre::RenderWindow* rw)
  {
    unsigned int width, height, depth;
    int left, top;
    rw->getMetrics (width, height, depth, left, top);

    const OIS::MouseState &ms = Application::getSingleton().getMouse()->getMouseState();
    ms.width = width;
    ms.height = height;
    //Notify CEGUI of the window size change
    CEGUI::System::getSingleton().notifyDisplaySizeChanged(CEGUI::Sizef(static_cast <float>(width), static_cast <float>(height)));
  }

This code results in a segfault at the time of the execution of CEGUI::System::ImageManager::notifyDisplaySizeChanged

I did have a look at #1051, but I am using a version of CEGUI that already implements this fix and my backend is Ogre, not opengl3

Am I missing something or did I hit a real bug ?

Comments (7)

  1. Marc-Olivier Barre

    Hi,

    Here's the stacktrace:

    Thread 1 "SpaceFuckery" received signal SIGSEGV, Segmentation fault.
    0x00007ffff6c62088 in CEGUI::ImageManager::notifyDisplaySizeChanged(CEGUI::Size<float> const&) () from /usr/lib/libCEGUIBase-0.so.2
    (gdb) thread apply all bt
    
    Thread 5 (Thread 0x7fffe614f700 (LWP 18380)):
    #0  0x00007ffff71b403f in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
    #1  0x00007ffff787518e in Ogre::DefaultWorkQueue::_threadMain() () from /usr/lib/libOgreMain.so.1.9.0
    #2  0x00007ffff43dcf5d in ?? () from /usr/lib/libboost_thread.so.1.60.0
    #3  0x00007ffff71ae424 in start_thread () from /usr/lib/libpthread.so.0
    #4  0x00007ffff50fdcbd in clone () from /usr/lib/libc.so.6
    
    Thread 4 (Thread 0x7fffe6950700 (LWP 18379)):
    #0  0x00007ffff71b403f in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
    #1  0x00007ffff787518e in Ogre::DefaultWorkQueue::_threadMain() () from /usr/lib/libOgreMain.so.1.9.0
    #2  0x00007ffff43dcf5d in ?? () from /usr/lib/libboost_thread.so.1.60.0
    #3  0x00007ffff71ae424 in start_thread () from /usr/lib/libpthread.so.0
    #4  0x00007ffff50fdcbd in clone () from /usr/lib/libc.so.6
    
    Thread 3 (Thread 0x7fffe7151700 (LWP 18378)):
    #0  0x00007ffff71b403f in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
    #1  0x00007ffff787518e in Ogre::DefaultWorkQueue::_threadMain() () from /usr/lib/libOgreMain.so.1.9.0
    #2  0x00007ffff43dcf5d in ?? () from /usr/lib/libboost_thread.so.1.60.0
    #3  0x00007ffff71ae424 in start_thread () from /usr/lib/libpthread.so.0
    #4  0x00007ffff50fdcbd in clone () from /usr/lib/libc.so.6
    
    Thread 2 (Thread 0x7fffe7952700 (LWP 18377)):
    #0  0x00007ffff71b403f in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
    #1  0x00007ffff787518e in Ogre::DefaultWorkQueue::_threadMain() () from /usr/lib/libOgreMain.so.1.9.0
    #2  0x00007ffff43dcf5d in ?? () from /usr/lib/libboost_thread.so.1.60.0
    #3  0x00007ffff71ae424 in start_thread () from /usr/lib/libpthread.so.0
    #4  0x00007ffff50fdcbd in clone () from /usr/lib/libc.so.6
    
    Thread 1 (Thread 0x7ffff7fa1780 (LWP 18373)):
    #0  0x00007ffff6c62088 in CEGUI::ImageManager::notifyDisplaySizeChanged(CEGUI::Size<float> const&) () from /usr/lib/libCEGUIBase-0.so.2
    #1  0x00007ffff6ce1e31 in CEGUI::System::notifyDisplaySizeChanged(CEGUI::Size<float> const&) () from /usr/lib/libCEGUIBase-0.so.2
    #2  0x0000000000413a52 in SpaceFuckery::WindowEventListener::windowResized (this=0xaf3bf0, rw=0x7ffff7e38618) at /home/mobarre/snarchi/spacefuckery/SpaceFuckery/WindowEventListener.cpp:28
    #3  0x0000000000408e36 in SpaceFuckery::Application::createListeners (this=0x6718f0) at /home/mobarre/snarchi/spacefuckery/SpaceFuckery/Application.cpp:130
    #4  0x0000000000409f65 in SpaceFuckery::Application::go (this=0x6718f0) at /home/mobarre/snarchi/spacefuckery/SpaceFuckery/Application.cpp:242
    #5  0x0000000000413271 in main (argc=1, argv=0x7fffffffe668) at /home/mobarre/snarchi/spacefuckery/SpaceFuckery/main.cpp:32
    
  2. Marc-Olivier Barre

    And I just discovered the CEGUI.log file... :)

    21/04/2016 09:44:35 (Std)   ********************************************************************************
    21/04/2016 09:44:35 (Std)   * -------- START OF ESSENTIAL SECTION TO BE POSTED ON THE FORUM       -------- *
    21/04/2016 09:44:35 (Std)   ********************************************************************************
    21/04/2016 09:44:35 (Std)   ---- Version: 0.8.5 (Build: Apr 20 2016 GNU/Linux g++ 5.3.0 64 bit) ----
    21/04/2016 09:44:35 (Std)   ---- Renderer module is: CEGUI::OgreRenderer - Official OGRE based 2nd generation renderer module. ----
    21/04/2016 09:44:35 (Std)   ---- XML Parser module is: CEGUI::ExpatParser - Official expat based parser module for CEGUI ----
    21/04/2016 09:44:35 (Std)   ---- Image Codec module is: OgreImageCodec - Integrated ImageCodec using the Ogre engine. ----
    21/04/2016 09:44:35 (Std)   ---- Scripting module is: None ----
    21/04/2016 09:44:35 (Std)   ********************************************************************************
    21/04/2016 09:44:35 (Std)   * -------- END OF ESSENTIAL SECTION TO BE POSTED ON THE FORUM         -------- *
    21/04/2016 09:44:35 (Std)   ********************************************************************************
    
  3. Lukas Meindl

    Hi please use the CEGUI or OGRE forum if you have issues and are can not be sure if it is a bug or an issue with your setup. Post the full CEGUI log there if you would be so kind.

    Segfaults are hard to track down, most like you linked the wrong library (mixing debug and release) or deleted something before you used it. That is a wild guess though, we need more info to track the real issue down, so be sure to build everything in debug, link debug libs with symbols, post the full trace and log and ensure you do not initialise/deinitialise wrongly, too often or whatnot. I will have to close this issue on this issue tracker until we know there is an actual bug. I know Ogre renderer works with CEGUI because I and others have used it. Please communicate with us on the forums.

  4. Log in to comment