[SOLVED] Runtime crash with cegui 0.8.2 with ogre

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

User avatar
thomas
Quite a regular
Quite a regular
Posts: 64
Joined: Thu Aug 22, 2013 22:11

[SOLVED] Runtime crash with cegui 0.8.2 with ogre

Postby thomas » Thu Jan 23, 2014 23:44

Solved by referring to this thread: http://cegui.org.uk/forum/viewtopic.php?f=10&t=6773

So my debug build works fine, but when I do a release build I get a runtime error and crash with CEGUI

Here is the log:

Code: Select all

23/01/2014 16:30:02 (Std)    ********************************************************************************
23/01/2014 16:30:02 (Std)    * -------- START OF ESSENTIAL SECTION TO BE POSTED ON THE FORUM       -------- *
23/01/2014 16:30:02 (Std)    ********************************************************************************
23/01/2014 16:30:02 (Std)    ---- Version: 0.8.2 (Build: Jan 23 2014 Microsoft Windows g++ 4.7.2 32 bit) ----
23/01/2014 16:30:02 (Std)    ---- Renderer module is: CEGUI::OgreRenderer - Official OGRE based 2nd generation renderer module. ----
23/01/2014 16:30:02 (Std)    ---- XML Parser module is: CEGUI::RapidXMLParser - Official RapidXML based parser module for CEGUI ----
23/01/2014 16:30:02 (Std)    ---- Image Codec module is: OgreImageCodec - Integrated ImageCodec using the Ogre engine. ----
23/01/2014 16:30:02 (Std)    ---- Scripting module is: None ----
23/01/2014 16:30:02 (Std)    ********************************************************************************
23/01/2014 16:30:02 (Std)    * -------- END OF ESSENTIAL SECTION TO BE POSTED ON THE FORUM         -------- *
23/01/2014 16:30:02 (Std)    ********************************************************************************


And the end of the log:

Code: Select all

23/01/2014 16:30:03 (Error)   CEGUI::UnknownObjectException in function 'typename CEGUI::PropertyHelper<T>::return_type CEGUI::PropertySet::getProperty(const CEGUI::String&) const [with T = CEGUI::Image*; typename CEGUI::PropertyHelper<T>::return_type = const CEGUI::Image*]' (J:/libraries_etc/cegui-0.8.2/cegui/include/CEGUI/PropertySet.h:181) : There is no Property named 'Ā


Any idea what is causing this or what it means?

Thanks.
Last edited by thomas on Thu Jun 19, 2014 22:33, edited 2 times in total.

User avatar
Ident
CEGUI Team
Posts: 1996
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: Runtime crash with cegui 0.8.2 with ogre

Postby Ident » Fri Jan 24, 2014 02:50

Waht is the line of code that causes this error? What is the callstack at the point the error pops up?
CrazyEddie: "I don't like GUIs"

User avatar
Kulik
CEGUI Team
Posts: 1382
Joined: Mon Jul 26, 2010 18:47
Location: Czech Republic
Contact:

Re: Runtime crash with cegui 0.8.2 with ogre

Postby Kulik » Fri Jan 24, 2014 14:19

Memory issues somewhere. It probably works in debug because uninitialised variables are preinitialised.

Run it through valgrind.

User avatar
mmixLinus
Quite a regular
Quite a regular
Posts: 71
Joined: Fri May 20, 2011 08:46
Location: Lund, Sweden
Contact:

Re: Runtime crash with cegui 0.8.2 with ogre

Postby mmixLinus » Fri Jan 24, 2014 14:31

Why has it started to print

Code: Select all

There is no Property named 'Ā
? Looks like a property (in a layout file?) with wrong character encoding? See mojibake. Shouldn't crash due to this though.
MMiX.Me 3D Music Player
Galaxy Navigator 3D - 2 million stars (ESA's Gaia satellite)
(YouTube|Facebook)

User avatar
Kulik
CEGUI Team
Posts: 1382
Joined: Mon Jul 26, 2010 18:47
Location: Czech Republic
Contact:

Re: Runtime crash with cegui 0.8.2 with ogre

Postby Kulik » Fri Jan 24, 2014 16:54

The log is cut out and the character could be memory garbage. That's my bet.

User avatar
thomas
Quite a regular
Quite a regular
Posts: 64
Joined: Thu Aug 22, 2013 22:11

Re: Runtime crash with cegui 0.8.2 with ogre

Postby thomas » Sat Jan 25, 2014 18:20

Some things I tried, I recompiled it in case I did something wrong in the library build.
I tried a different entry point in my program to see if it was a certain point. I also added more debugging output to try and pinpoint the location. Really, I don't know exactly where the problem is happening to try anything.

Thank you for the quick responses, I had another assignment I had to get working on so I haven't gotten back to this yet.

Here is my callstack when it crashes.

Code: Select all

#0 641CEA2E   CEGUI::FrameComponent::getImage(CEGUI::FrameImageComponent, CEGUI::Window const&) const() (J:\Git\home\Spellbyte\game\libCEGUIBase-0.dll:??)
#1 641CEA45   CEGUI::FrameComponent::getImage(CEGUI::FrameImageComponent, CEGUI::Window const&) const() (J:\Git\home\Spellbyte\game\libCEGUIBase-0.dll:??)
#2 0028F410   ?? () (??:??)
#3 BAADF00D   ?? () (??:??)
#4 ??   ?? () (??:??)


Here is a log of my initialization and then my main loop:

Code: Select all

11:24:46: Initializing CEGUI
11:24:46: Texture: _cegui_ogre_0: Loading 1 faces(PF_A8B8G8R8,2048x2048x1) Internal format is PF_A8R8G8B8,2048x2048x1.
11:24:46: Texture: _cegui_ogre_1: Loading 1 faces(PF_A8B8G8R8,256x256x1) Internal format is PF_A8R8G8B8,256x256x1.
11:24:47: Texture: _cegui_ogre_2: Loading 1 faces(PF_A8B8G8R8,256x256x1) Internal format is PF_A8R8G8B8,256x256x1.
11:24:47: CEGUI Initialized
11:24:47: Initializing GameStateManager
11:24:47: Initializing States
11:24:47: Texture: grimmnight_fr.tga: Loading 1 faces(PF_R8G8B8,256x256x1) with 5 hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,256x256x1.
11:24:47: Texture: grimmnight_bk.tga: Loading 1 faces(PF_R8G8B8,256x256x1) with 5 hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,256x256x1.
11:24:47: Texture: grimmnight_lf.tga: Loading 1 faces(PF_R8G8B8,256x256x1) with 5 hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,256x256x1.
11:24:47: Texture: grimmnight_rt.tga: Loading 1 faces(PF_R8G8B8,256x256x1) with 5 hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,256x256x1.
11:24:47: Texture: grimmnight_up.tga: Loading 1 faces(PF_R8G8B8,256x256x1) with 5 hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,256x256x1.
11:24:47: Texture: grimmnight_dn.tga: Loading 1 faces(PF_R8G8B8,256x256x1) with 5 hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,256x256x1.
11:24:47: Setting initial state
11:24:47: MenuState: enter
11:24:47: Creating Menu
11:24:47: Menu Created
11:24:47: Setting to FrameListener
11:24:47: SpellByte Initialization Complete, starting...
11:24:47: Start of loop #1
11:24:47: WindowEvent pump
11:24:47: Capture events
11:24:47: Handle events
11:24:47: Update GameStateManager
11:24:47: Updating...
11:24:47: Check RenderWindow closed
11:24:47: Check for shutdown
11:24:47: return true


It then returns true from frameRenderingQueued in my Ogre loop, and never comes back.
Last edited by thomas on Sat Jan 25, 2014 21:03, edited 2 times in total.

User avatar
thomas
Quite a regular
Quite a regular
Posts: 64
Joined: Thu Aug 22, 2013 22:11

Re: Runtime crash with cegui 0.8.2 with ogre

Postby thomas » Sat Jan 25, 2014 18:20

I am going to try to pinpoint the problem closer I will post an update when I get closer.

Any suggestions or thoughts until then are appreciated. Thanks again.

User avatar
thomas
Quite a regular
Quite a regular
Posts: 64
Joined: Thu Aug 22, 2013 22:11

Re: Runtime crash with cegui 0.8.2 with ogre

Postby thomas » Sat Jan 25, 2014 18:33

Kulik wrote:Memory issues somewhere. It probably works in debug because uninitialised variables are preinitialised.

Run it through valgrind.


I am looking into valgrind, does it only work on debug builds? My debug version works perfectly. Can it do profile/memory issue checks on release without debug information?

User avatar
thomas
Quite a regular
Quite a regular
Posts: 64
Joined: Thu Aug 22, 2013 22:11

Re: Runtime crash with cegui 0.8.2 with ogre

Postby thomas » Sat Jan 25, 2014 18:39

I get these warnings on my build, just realized it has to do with PropertyHelper, which is what the log referred to, related or coincidence:

Code: Select all

..\include\CEGUI\PropertyHelper.h|329|warning: unknown conversion type character 'l' in format [-Wformat]|
..\include\CEGUI\PropertyHelper.h|329|warning: too many arguments for format [-Wformat-extra-args]|
..\include\CEGUI\PropertyHelper.h|337|warning: unknown conversion type character 'l' in format [-Wformat]|
..\include\CEGUI\PropertyHelper.h|337|warning: too many arguments for format [-Wformat-extra-args]|

User avatar
thomas
Quite a regular
Quite a regular
Posts: 64
Joined: Thu Aug 22, 2013 22:11

Re: Runtime crash with cegui 0.8.2 with ogre

Postby thomas » Sat Jan 25, 2014 18:47

The warning refers to:

Code: Select all

    static return_type fromString(const String& str)
    {
        uint64 val = 0;
        sscanf(str.c_str(), " %llu", &val);

        return val;
    }

    static string_return_type toString(pass_type val)
    {
        char buff[64];
        snprintf(buff, sizeof(buff), "%llu", val);

        return String(buff);
    }


So I traced it down to this code:

Code: Select all

for(int i = 0; i < BTN_END; ++i)
        {
           CEGUI::Window *button = wmgr.createWindow("TaharezLook/Button", getButtonID(i));
           button->setText(getButtonText(i));
           button->setSize(CEGUI::USize(CEGUI::UDim(0.15f, 0), CEGUI::UDim(0.05f, 0)));
           button->setPosition(CEGUI::UVector2(CEGUI::UDim(btn_current_x, 0), CEGUI::UDim(btn_current_y, 0)));
           button->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&MenuState::buttonClicked, this));
           wRoot->addChild(button);

           btn_current_y += BUTTON_Y_OFFSET;
           btn_current_x += BUTTON_X_OFFSET;
        }


If I comment it out, it works fine.

However, that code is executed, it happens after when the buttons are displayed on the screen; at least that's what I believe.
I can see the mouse cursor just fine.

Is it possible it's a problem with converting some values?

User avatar
thomas
Quite a regular
Quite a regular
Posts: 64
Joined: Thu Aug 22, 2013 22:11

Re: Runtime crash with cegui 0.8.2 with ogre

Postby thomas » Sat Jan 25, 2014 20:58

I tried a different entry point and found another location where it crashes; having to do with my in-game console window.

Call stack:

Code: Select all

#0 6417D94B   CEGUI::Window::setVisible(bool) () (J:\Git\home\Spellbyte\game\libCEGUIBase-0.dll:??)
#1 ??   ?? () (??:??)


I tracked it down to this part of code:

Code: Select all

    void GameConsoleWindow::setVisible(bool visible)
    {
        if(!Initialized)
            return;

        ConsoleWindow->setVisible(visible);
        Console = visible;

        CEGUI::Editbox *editBox = static_cast<CEGUI::Editbox*>(ConsoleWindow->getChild("Editbox"));
        editBox->setText("");
        if(visible)
            editBox->activate();
        else
            editBox->deactivate();
    }


ConsoleWindow is of type:

Code: Select all

CEGUI::Window *ConsoleWindow;


The line that appears to be the crash is

Code: Select all

editBox->setText("");


This is with having a small static-text GUI box I use on my main screen for debugging commented out and not used, if I put that code in then it crashes and I get the following in the log:

Not sure if this is related, though.

Code: Select all

25/01/2014 13:45:22 (Warn)   Property 'HorzExtent' is not writable so it's implicitly banned from XML. No need to ban it manually
25/01/2014 13:45:22 (Warn)   Property 'VertExtent' is not writable so it's implicitly banned from XML. No need to ban it manually


Another piece of code I am working with is:

Code: Select all

CEGUI::WindowManager &wmgr = CEGUI::WindowManager::getSingleton();
        rootWindow = wmgr.createWindow("DefaultWindow", "root");
        APP->ceguiContext->setRootWindow( rootWindow );
        debugBox = wmgr.createWindow("TaharezLook/StaticText", "textbox");
        //rootWindow->addChild(debugBox);
        GCW->Init(rootWindow);


Here, the line that appears to cause the crash is

Code: Select all

rootWindow->addChild(debugBox);

User avatar
mmixLinus
Quite a regular
Quite a regular
Posts: 71
Joined: Fri May 20, 2011 08:46
Location: Lund, Sweden
Contact:

Re: Runtime crash with cegui 0.8.2 with ogre

Postby mmixLinus » Mon Jan 27, 2014 12:01

Please see this regarding %llu. Could be relevant for your setup. Have you tried printing your uint64 values after the sscanf? Do they look right?

I still think you have a String mixup of sorts (maybe compiling different parts of your project with different basic string types). Or maybe simply using a String in a way it is not intended to be used.

Code: Select all

There is no Property named 'Ā

This can happen if you are printing regular (narrow) chars ("There is no Property named ") followed by a WIDE character string, but still interpreting as a narrow char. For example, the simple chars 'ABC', ie hex 0x65, 0x66, 0x67, will be encoded 0x00000065 etc in a 32-bit wide char (utf32), laid out in memory as 0x65, 0x00, 0x00, 0x00, 0x66, etc. If you try to print this with a "regular" char print you will only get the 0x65 'A', and nothing more, because if the interstitial zeroes.
MMiX.Me 3D Music Player
Galaxy Navigator 3D - 2 million stars (ESA's Gaia satellite)
(YouTube|Facebook)

User avatar
thomas
Quite a regular
Quite a regular
Posts: 64
Joined: Thu Aug 22, 2013 22:11

Re: Runtime crash with cegui 0.8.2 with ogre

Postby thomas » Tue Jan 28, 2014 17:00

Thank you mmixLinus, what you said makes sense. I implemented the suggestions from stackoverflow; thank you for finding that. It removed the warnings but I still get a crash.

I'm going to not worry about it for a while, since I can't spend anymore effort with it atm and will try to figure something out later on. If anyone else comes up with something I'd appreciate, but I'll just work with a debug version for now. I'll come back to this when I am able.

Thanks very much :)

User avatar
mmixLinus
Quite a regular
Quite a regular
Posts: 71
Joined: Fri May 20, 2011 08:46
Location: Lund, Sweden
Contact:

Re: Runtime crash with cegui 0.8.2 with ogre

Postby mmixLinus » Tue Jan 28, 2014 18:51

some progress then :)
np, see you later!
MMiX.Me 3D Music Player
Galaxy Navigator 3D - 2 million stars (ESA's Gaia satellite)
(YouTube|Facebook)

User avatar
Ident
CEGUI Team
Posts: 1996
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: Runtime crash with cegui 0.8.2 with ogre

Postby Ident » Tue Jan 28, 2014 19:25

thomas: your callstack is unfortunately incomplete (debug symbols missing?) so it is really hard for us to tell what caused this error and how to resolve the issue. Also you did not tell us what the property was set to. These two pieces of information could lead to a possible solution.
CrazyEddie: "I don't like GUIs"


Return to “Help”

Who is online

Users browsing this forum: No registered users and 18 guests