issue loading layout file - loading framewindow types

Issue #1096 resolved
David Reepmeyer
created an issue

Operating System: arch 64 bit Reproducibility: always (samplebrowser + my apps) Reproduction steps: build and run cegui + samplebrowser

I ran into an issue with my application and spent a few days trying to debug then realizing that the sample browser is having the same exact issue. It appears to have an issue loading certain windows while parsing a layout. I was supprised it was also happening in the sample browser because i could not find anyone else with a similar issue in any of the forums.

When running the sample browser using Linux + Ogre (although i doubt that matters since it appears to be part of cegui core), the app starts up and begins to load the apps as I can see the progress bar. Then it fails and spits out the following error. This error is the same error I get when running my application (instead of SamplesFrameWindow it was the name of my TaharezLook/FrameWindow).

CEGUI::UnknownObjectException in function 'CEGUI::NamedElement* 
CEGUI::NamedElement::getChildElement(const CEGUI::String&) const' 
(/home/david/git/dependencies_hosted/cegui_07_18_15/cegui/src/NamedElement.cpp:150) 
: The Element object referenced by '__auto_titlebar__' is not attached to Element at 
'SamplesFrameWindow'.

CEGUI::InvalidRequestException in function 'void CEGUI::GUILayout_xmlHandler::elementWindowStart(const CEGUI::XMLAttributes&)' 
(/home/david/git/dependencies_hosted/cegui_07_18_15/cegui/src/GUILayout_xmlHandler.cpp:250)
 : layout loading has been aborted since no WindowFactory is available for 'SampleBrowserSkin/FrameWindow' objects.

For now i reverted back to revision bbf77fd9b which seems to work fine. The first revision that fails with this error (with compiling successfully) bbfbdff98. I believe that the error maybe introduced within those revision numbers

I have been debugging this to find that the getTitleBar is being called (isTitleBarEnabled from the FrameWindow) and it is expected not to be null. It is null and causing segfault. This seems to be happening when loading the layout file. I believe that the FrameWindow loads 2 child windows. One type is a title bar and the other type is a close button. When the close button is being added to the parent it appears to call updateGeometryRenderSettings. this in turn then tries to access the isTitleBarEnabled method causing the segfault. Typically was the TitleBar window supposed to be added first? Could it have something to do with the unordered_map vs map changes?

I marked this as major because it appears to crash the demo and any applications that use a FrameWindow. Please change if it is not affected others.

I attached the CEGUI.log file.

Comments (8)

  1. David Reepmeyer reporter

    Good question. I went back and built the tip of v0 and v0-8. Both sample frameworks worked fine. So the bug appears to be introduced between bbf77fd9b and bbfbdff98 in the default branch only.

    • f77fd9b - (default branch rev) sample browser working
    • fbdff98 - (default branch rev) sample browser not working (error as described above)
    • 94c9573 - (latest v0 branch) sample framework working
    • 91b0e79 - (latest v0-8 branch) sample framework working
  2. Lukas Meindl

    I am trying to reconstruct the issue. I failed to get the error you described in VS2012 on Windows. I have no idea why this could be the case. I see nothing in the code that could cause this. Do you have any ideas?

  3. Lukas Meindl

    After an IRC discussion we figured this is due to the map sorting and the way child widgets are initialised that depend on each other in some way. Can be reproduced on MSVC by changing to WidgetComponentMap from std::unordered_map to std::map.

    Apparently different compilers will "order" the unordered map differently which showed this problem. Instead of fixing the map order, I will try to make the Widget work no matter in which order its child windows are added.

  4. Log in to comment