createFromFile() crashes only in Debug build

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

Palaiologos
Just popping in
Just popping in
Posts: 3
Joined: Wed Aug 16, 2017 12:12

createFromFile() crashes only in Debug build

Postby Palaiologos » Mon Oct 12, 2020 19:36

Hello,

Currently I'm working on a project that uses CEGUI with OpenGL and SDL. The release build works fine: no errors and nothing suspicious in the log file. However, when running the Debug build, the program generates an OpenGL error on CEGUI::OpenGL3Renderer::bootstrapSystem() and crashes when SchemeManager::getSingleton().createFromFile() is called. The code, logs and callstack are included below.

The OpenGL error is generated when CEGUI calls initGlew() in the bootstrapSystem() routine and I'm not very concerned about this (perhaps unjustifiably so) as I have read that glew tends to do this.

As for the crash, I am really clueless as to what causes this problem. I have tried
swapping FontManager::createFromFile("cabin") andcreateFromFile("smeenk.scheme"), but the FontManager::createFromFile() also crashes.
Rebuilding CEGUI and its dependencies from scratch did not solve anything either.

I am working on windows 10 64-bit, I use MinGW-w64 and I am linking dynamically.

This is the routine where the crash occurs:

Code: Select all

void initialize() try
    {
        OpenGL3Renderer& cegui_renderer = CEGUI::OpenGL3Renderer::bootstrapSystem(); //OPENGL ERROR

        DefaultResourceProvider* rp = static_cast<DefaultResourceProvider*>(System::getSingleton().getResourceProvider());
        rp->setResourceGroupDirectory("schemes", "./data/ui/");
        rp->setResourceGroupDirectory("imagesets", "./data/ui/");
        rp->setResourceGroupDirectory("fonts", "./data/fonts/");
        rp->setResourceGroupDirectory("layouts", "./data/ui/");
        rp->setResourceGroupDirectory("looknfeels", "./data/ui/");

        ImageManager::setImagesetDefaultResourceGroup("imagesets");
        Font::setDefaultResourceGroup("fonts");
        Scheme::setDefaultResourceGroup("schemes");
        WidgetLookManager::setDefaultResourceGroup("looknfeels");
        WindowManager::setDefaultResourceGroup("layouts");

        SchemeManager::getSingleton().createFromFile("Smeenk.scheme", "schemes"); //CRASH HAPPENS HERE
        FontManager::getSingleton().createFromFile("Cabin.font");


        System::getSingleton().getDefaultGUIContext().setDefaultFont("Cabin");
    }
    catch(CEGUI::Exception& e)
    {
        Error::throwError(LOG_FATAL, "CEGUI Intialisation error: '%s'.", e.getMessage().c_str());
        throw;
    }


Here is CEGUI.log:

Code: Select all


12/10/2020 21:14:31 (Std)    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
12/10/2020 21:14:31 (Std)    +                     Crazy Eddie's GUI System - Event log                    +
12/10/2020 21:14:31 (Std)    +                          (http://www.cegui.org.uk/)                         +
12/10/2020 21:14:31 (Std)    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

12/10/2020 21:14:31 (Std)    CEGUI::Logger singleton created. (000000000161cde0)
12/10/2020 21:14:31 (Std)    
12/10/2020 21:14:31 (Std)    ********************************************************************************
12/10/2020 21:14:31 (Std)    * Important:                                                                   *
12/10/2020 21:14:31 (Std)    *     To get support at the CEGUI forums, you must post _at least_ the section *
12/10/2020 21:14:31 (Std)    *     of this log file indicated below.  Failure to do this will result in no  *
12/10/2020 21:14:31 (Std)    *     support being given; please do not waste our time.                       *
12/10/2020 21:14:31 (Std)    ********************************************************************************
12/10/2020 21:14:31 (Std)    ********************************************************************************
12/10/2020 21:14:31 (Std)    * -------- START OF ESSENTIAL SECTION TO BE POSTED ON THE FORUM       -------- *
12/10/2020 21:14:31 (Std)    ********************************************************************************
12/10/2020 21:14:31 (Std)    ---- Version: 0.8.7 (Build: Jun  7 2020 Debug Microsoft Windows g++ 5.1.0 32 bit) ----
12/10/2020 21:14:31 (Std)    ---- Renderer module is: CEGUI::OpenGL3Renderer - Official OpenGL 3.2 core based renderer module.  TextureTarget support enabled via FBO OGL 3.2 core implementation. ----
12/10/2020 21:14:31 (Std)    ---- XML Parser module is: CEGUI::TinyXMLParser - Official tinyXML based parser module for CEGUI ----
12/10/2020 21:14:31 (Std)    ---- Image Codec module is: SILLYImageCodec - Official SILLY based image codec ----
12/10/2020 21:14:31 (Std)    ---- Scripting module is: None ----
12/10/2020 21:14:31 (Std)    ********************************************************************************
12/10/2020 21:14:31 (Std)    * -------- END OF ESSENTIAL SECTION TO BE POSTED ON THE FORUM         -------- *
12/10/2020 21:14:31 (Std)    ********************************************************************************
12/10/2020 21:14:31 (Std)    
12/10/2020 21:14:31 (Std)    ---- Begining CEGUI System initialisation ----
12/10/2020 21:14:31 (Std)    [CEGUI::ImageManager] Singleton created (0000000001658bb0)
12/10/2020 21:14:31 (Std)    [CEGUI::ImageManager] Registered Image type: BasicImage
12/10/2020 21:14:31 (Std)    CEGUI::FontManager singleton created. (000000000161ee10)
12/10/2020 21:14:31 (Std)    CEGUI::WindowFactoryManager singleton created
12/10/2020 21:14:31 (Std)    CEGUI::WindowManager singleton created (0000000001657cb0)
12/10/2020 21:14:31 (Std)    CEGUI::SchemeManager singleton created. (000000000161da00)
12/10/2020 21:14:31 (Std)    CEGUI::GlobalEventSet singleton created. (000000000161b930)
12/10/2020 21:14:31 (Std)    CEGUI::AnimationManager singleton created (000000000161ef40)
12/10/2020 21:14:31 (Std)    CEGUI::WidgetLookManager singleton created. (000000000161b580)
12/10/2020 21:14:31 (Std)    CEGUI::WindowRendererManager singleton created (000000000161b5c0)
12/10/2020 21:14:31 (Std)    CEGUI::RenderEffectManager singleton created (000000000161a6f0)
12/10/2020 21:14:31 (Std)    Created WindowFactory for 'DefaultWindow' windows.
12/10/2020 21:14:31 (Std)    WindowFactory for 'DefaultWindow' windows added. (000000000165a910)
12/10/2020 21:14:31 (Std)    Created WindowFactory for 'DragContainer' windows.
12/10/2020 21:14:31 (Std)    WindowFactory for 'DragContainer' windows added. (000000000165b750)
12/10/2020 21:14:31 (Std)    Created WindowFactory for 'ScrolledContainer' windows.
12/10/2020 21:14:31 (Std)    WindowFactory for 'ScrolledContainer' windows added. (000000000165ae50)
12/10/2020 21:14:31 (Std)    Created WindowFactory for 'ClippedContainer' windows.
12/10/2020 21:14:31 (Std)    WindowFactory for 'ClippedContainer' windows added. (000000000165aa90)
12/10/2020 21:14:31 (Std)    Created WindowFactory for 'CEGUI/PushButton' windows.
12/10/2020 21:14:31 (Std)    WindowFactory for 'CEGUI/PushButton' windows added. (000000000165ad90)
12/10/2020 21:14:31 (Std)    Created WindowFactory for 'CEGUI/RadioButton' windows.
12/10/2020 21:14:31 (Std)    WindowFactory for 'CEGUI/RadioButton' windows added. (000000000165b2d0)
12/10/2020 21:14:31 (Std)    Created WindowFactory for 'CEGUI/Combobox' windows.
12/10/2020 21:14:31 (Std)    WindowFactory for 'CEGUI/Combobox' windows added. (000000000165b510)
12/10/2020 21:14:31 (Std)    Created WindowFactory for 'CEGUI/ComboDropList' windows.
12/10/2020 21:14:31 (Std)    WindowFactory for 'CEGUI/ComboDropList' windows added. (000000000165ac10)
12/10/2020 21:14:31 (Std)    Created WindowFactory for 'CEGUI/Editbox' windows.
12/10/2020 21:14:31 (Std)    WindowFactory for 'CEGUI/Editbox' windows added. (000000000165af10)
12/10/2020 21:14:31 (Std)    Created WindowFactory for 'CEGUI/FrameWindow' windows.
12/10/2020 21:14:31 (Std)    WindowFactory for 'CEGUI/FrameWindow' windows added. (000000000165b150)
12/10/2020 21:14:31 (Std)    Created WindowFactory for 'CEGUI/ItemEntry' windows.
12/10/2020 21:14:31 (Std)    WindowFactory for 'CEGUI/ItemEntry' windows added. (000000000165ab50)
12/10/2020 21:14:31 (Std)    Created WindowFactory for 'CEGUI/Listbox' windows.
12/10/2020 21:14:31 (Std)    WindowFactory for 'CEGUI/Listbox' windows added. (000000000165acd0)
12/10/2020 21:14:31 (Std)    Created WindowFactory for 'CEGUI/ListHeader' windows.
12/10/2020 21:14:31 (Std)    WindowFactory for 'CEGUI/ListHeader' windows added. (000000000165b090)
12/10/2020 21:14:31 (Std)    Created WindowFactory for 'CEGUI/ListHeaderSegment' windows.
12/10/2020 21:14:31 (Std)    WindowFactory for 'CEGUI/ListHeaderSegment' windows added. (000000000165afd0)
12/10/2020 21:14:31 (Std)    Created WindowFactory for 'CEGUI/Menubar' windows.
12/10/2020 21:14:31 (Std)    WindowFactory for 'CEGUI/Menubar' windows added. (000000000165b210)
12/10/2020 21:14:31 (Std)    Created WindowFactory for 'CEGUI/PopupMenu' windows.
12/10/2020 21:14:31 (Std)    WindowFactory for 'CEGUI/PopupMenu' windows added. (000000000165b390)
12/10/2020 21:14:31 (Std)    Created WindowFactory for 'CEGUI/MenuItem' windows.
12/10/2020 21:14:31 (Std)    WindowFactory for 'CEGUI/MenuItem' windows added. (000000000165b450)
12/10/2020 21:14:31 (Std)    Created WindowFactory for 'CEGUI/MultiColumnList' windows.
12/10/2020 21:14:31 (Std)    WindowFactory for 'CEGUI/MultiColumnList' windows added. (0000000001660ff0)
12/10/2020 21:14:31 (Std)    Created WindowFactory for 'CEGUI/MultiLineEditbox' windows.
12/10/2020 21:14:31 (Std)    WindowFactory for 'CEGUI/MultiLineEditbox' windows added. (000000000165f730)
12/10/2020 21:14:31 (Std)    Created WindowFactory for 'CEGUI/ProgressBar' windows.
12/10/2020 21:14:31 (Std)    WindowFactory for 'CEGUI/ProgressBar' windows added. (00000000016609f0)
12/10/2020 21:14:31 (Std)    Created WindowFactory for 'CEGUI/ScrollablePane' windows.
12/10/2020 21:14:31 (Std)    WindowFactory for 'CEGUI/ScrollablePane' windows added. (00000000016606f0)
12/10/2020 21:14:31 (Std)    Created WindowFactory for 'CEGUI/Scrollbar' windows.
12/10/2020 21:14:31 (Std)    WindowFactory for 'CEGUI/Scrollbar' windows added. (0000000001660030)
12/10/2020 21:14:31 (Std)    Created WindowFactory for 'CEGUI/Slider' windows.
12/10/2020 21:14:31 (Std)    WindowFactory for 'CEGUI/Slider' windows added. (000000000165fc70)
12/10/2020 21:14:31 (Std)    Created WindowFactory for 'CEGUI/Spinner' windows.
12/10/2020 21:14:31 (Std)    WindowFactory for 'CEGUI/Spinner' windows added. (0000000001660ab0)
12/10/2020 21:14:31 (Std)    Created WindowFactory for 'CEGUI/TabButton' windows.
12/10/2020 21:14:31 (Std)    WindowFactory for 'CEGUI/TabButton' windows added. (000000000165fd30)
12/10/2020 21:14:31 (Std)    Created WindowFactory for 'CEGUI/TabControl' windows.
12/10/2020 21:14:31 (Std)    WindowFactory for 'CEGUI/TabControl' windows added. (00000000016603f0)
12/10/2020 21:14:31 (Std)    Created WindowFactory for 'CEGUI/Thumb' windows.
12/10/2020 21:14:31 (Std)    WindowFactory for 'CEGUI/Thumb' windows added. (000000000165f670)
12/10/2020 21:14:31 (Std)    Created WindowFactory for 'CEGUI/Titlebar' windows.
12/10/2020 21:14:31 (Std)    WindowFactory for 'CEGUI/Titlebar' windows added. (000000000165ff70)
12/10/2020 21:14:31 (Std)    Created WindowFactory for 'CEGUI/ToggleButton' windows.
12/10/2020 21:14:31 (Std)    WindowFactory for 'CEGUI/ToggleButton' windows added. (0000000001660b70)
12/10/2020 21:14:31 (Std)    Created WindowFactory for 'CEGUI/Tooltip' windows.
12/10/2020 21:14:31 (Std)    WindowFactory for 'CEGUI/Tooltip' windows added. (0000000001661470)
12/10/2020 21:14:31 (Std)    Created WindowFactory for 'CEGUI/ItemListbox' windows.
12/10/2020 21:14:31 (Std)    WindowFactory for 'CEGUI/ItemListbox' windows added. (000000000165f7f0)
12/10/2020 21:14:31 (Std)    Created WindowFactory for 'CEGUI/GroupBox' windows.
12/10/2020 21:14:31 (Std)    WindowFactory for 'CEGUI/GroupBox' windows added. (000000000165feb0)
12/10/2020 21:14:31 (Std)    Created WindowFactory for 'CEGUI/Tree' windows.
12/10/2020 21:14:31 (Std)    WindowFactory for 'CEGUI/Tree' windows added. (00000000016601b0)
12/10/2020 21:14:31 (Std)    Created WindowFactory for 'LayoutCell' windows.
12/10/2020 21:14:31 (Std)    WindowFactory for 'LayoutCell' windows added. (0000000001661170)
12/10/2020 21:14:31 (Std)    Created WindowFactory for 'HorizontalLayoutContainer' windows.
12/10/2020 21:14:31 (Std)    WindowFactory for 'HorizontalLayoutContainer' windows added. (0000000001660c30)
12/10/2020 21:14:31 (Std)    Created WindowFactory for 'VerticalLayoutContainer' windows.
12/10/2020 21:14:31 (Std)    WindowFactory for 'VerticalLayoutContainer' windows added. (000000000165fa30)
12/10/2020 21:14:31 (Std)    Created WindowFactory for 'GridLayoutContainer' windows.
12/10/2020 21:14:31 (Std)    WindowFactory for 'GridLayoutContainer' windows added. (000000000165f5b0)
12/10/2020 21:14:31 (Std)    CEGUI::System singleton created. (000000000161caf0)
12/10/2020 21:14:31 (Std)    ---- CEGUI System initialisation completed ----
12/10/2020 21:14:31 (Std)    
12/10/2020 21:14:31 (Std)    Started creation of Scheme from XML specification:
12/10/2020 21:14:31 (Std)    ---- CEGUI GUIScheme name: Default



Here is the callstack:

Code: Select all

#0 0x46a2bc   CEGUI::String::length(this=0xabababababababcb) (include/CEGUI/String.h:623)
#1 0x46a0b2   CEGUI::StringFastLessCompare::operator() (this=0x2e42c10, a=..., b=...) (include/CEGUI/String.h:5583)
#2 0x4a0334   std::_Rb_tree<CEGUI::String, std::pair<CEGUI::String const, CEGUI::Scheme*>, std::_Select1st<std::pair<CEGUI::String const, CEGUI::Scheme*> >, CEGUI::StringFastLessCompare, std::allocator<std::pair<CEGUI::String const, CEGUI::Scheme*> > >::_M_lower_bound(this=0x2e42c10, __x=0xabababababababab, __y=0x2e42c18, __k=...) (C:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/c++/bits/stl_tree.h:1654)
#3 0x4a0401   std::_Rb_tree<CEGUI::String, std::pair<CEGUI::String const, CEGUI::Scheme*>, std::_Select1st<std::pair<CEGUI::String const, CEGUI::Scheme*> >, CEGUI::StringFastLessCompare, std::allocator<std::pair<CEGUI::String const, CEGUI::Scheme*> > >::find(this=0x2e42c10, __k=...) (C:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/c++/bits/stl_tree.h:2318)
#4 0x4a8d60   std::__cxx1998::map<CEGUI::String, CEGUI::Scheme*, CEGUI::StringFastLessCompare, std::allocator<std::pair<CEGUI::String const, CEGUI::Scheme*> > >::find(this=0x2e42c10, __x=...) (C:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/c++/bits/stl_map.h:868)
#5 0x489ad2   std::__debug::map<CEGUI::String, CEGUI::Scheme*, CEGUI::StringFastLessCompare, std::allocator<std::pair<CEGUI::String const, CEGUI::Scheme*> > >::find(this=0x2e42bf8, __x=...) (C:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/c++/debug/map.h:417)
#6 0x46a20e   CEGUI::NamedXMLResourceManager<CEGUI::Scheme, CEGUI::Scheme_xmlHandler>::isDefined(this=0x2e42af0, object_name=...) (include/CEGUI/NamedXMLResourceManager.h:355)
#7 0x45af93   CEGUI::NamedXMLResourceManager<CEGUI::Scheme, CEGUI::Scheme_xmlHandler>::doExistingObjectAction(this=0x2e42af0, object_name=..., object=0x2e5ad90, action=CEGUI::XREA_RETURN) (include/CEGUI/NamedXMLResourceManager.h:388)
#8 0x45aecf   CEGUI::NamedXMLResourceManager<CEGUI::Scheme, CEGUI::Scheme_xmlHandler>::createFromFile(this=0x2e42af0, xml_filename=..., resource_group=..., action=CEGUI::XREA_RETURN) (include/CEGUI/NamedXMLResourceManager.h:286)
#9 0x4043ed   GUI::initialize() (C:\Users\sebsm\Documents\Projects\Milky Way\src\GUI.cpp:31)
#10 0x41aacc   SDL_main(argc=1, argv=0x70010) (C:\Users\sebsm\Documents\Projects\Milky Way\src\main.cpp:41)
#11 0x4254f9   main_getcmdline() (../src/main/windows/SDL_windows_main.c:71)
#12 0x425555   WinMain(hInst=<optimized out>, hPrev=hPrev@entry=0x0, szCmdLine=<optimized out>, sw=<optimized out>) (../src/main/windows/SDL_windows_main.c:103)
#13 0x526862   main(flags=<optimized out>, cmdline=<optimized out>, inst=<optimized out>) (C:/crossdev/src/mingw-w64-v4-git/mingw-w64-crt/crt/crt0_c.c:18)
#14 0x4013e8   __tmainCRTStartup() (C:/crossdev/src/mingw-w64-v4-git/mingw-w64-crt/crt/crtexe.c:332)
#15 0x4014eb   WinMainCRTStartup() (C:/crossdev/src/mingw-w64-v4-git/mingw-w64-crt/crt/crtexe.c:184)



I really do hope I have not overlooked anything in the documentation and/or the forums.

Thanks in advance!

orion
Not too shy to talk
Not too shy to talk
Posts: 28
Joined: Fri Apr 24, 2020 15:56

Re: createFromFile() crashes only in Debug build

Postby orion » Thu Jan 28, 2021 21:37

I cant help with the OpenGL

but i could be wrong but

Code: Select all

SchemeManager::getSingleton().createFromFile("Smeenk.scheme", "schemes");


should be

Code: Select all

SchemeManager::getSingleton().createFromFile("Smeenk.scheme");


at least it is in my code :)

also did you build cegui and deps in debug aswell as release


Return to “Help”

Who is online

Users browsing this forum: No registered users and 13 guests