Crash on String concatenation

If you found a bug in our library or on our website, please report it in this section. In this forum you can also make concrete suggestions or feature requests.

Moderators: CEGUI MVP, CEGUI Team

kryx
Just popping in
Just popping in
Posts: 6
Joined: Wed Feb 22, 2017 09:18

Crash on String concatenation

Postby kryx » Mon Apr 09, 2018 21:59

I'm facing a strange bug the I don't manage to solve.
I just compiled dependencies and cegui for my SFML project with an openGLRenderer.

After initialiazing the renderer, I do this:

Code: Select all

    CEGUI::DefaultResourceProvider *rp = static_cast<CEGUI::DefaultResourceProvider*>(CEGUI::System::getSingleton().getResourceProvider());

    rp->setResourceGroupDirectory("schemes", "/usr/share/cegui-0/schemes/");
    rp->setResourceGroupDirectory("imagesets", "/usr/share/cegui-0/imagesets/");
    rp->setResourceGroupDirectory("fonts", "/usr/share/cegui-0/fonts/");
    rp->setResourceGroupDirectory("layouts", "/usr/share/cegui-0/layouts/");
    rp->setResourceGroupDirectory("looknfeels", "/usr/share/cegui-0/looknfeel");
    rp->setResourceGroupDirectory("lua_scripts", "/usr/share/cegui-0/lua_scripts/");

    CEGUI::ImageManager::setImagesetDefaultResourceGroup("imagesets");
    CEGUI::Font::setDefaultResourceGroup("fonts");
    CEGUI::Scheme::setDefaultResourceGroup("schemes");
    CEGUI::WidgetLookManager::setDefaultResourceGroup("looknfeels");
    CEGUI::WindowManager::setDefaultResourceGroup("layouts");
    CEGUI::ScriptModule::setDefaultResourceGroup("lua_scripts");
   
    CEGUI::SchemeManager::getSingleton().createFromFile("WindowsLook.scheme");


Unfortunately, the last line crash. It is normal as my previous paths are wrong (didn't set already, I'm on windows), but CEGUI should not crash on this.
Effectively, if path is wrong, the program passes here:

Code: Select all

    if (file == 0)
        CEGUI_THROW(FileIOException(final_filename + " does not exist"));

(DefaultResourceProvider.cpp; line 65)

But this "throw" crash instead of throw... With debugger, I saw that the bug come from here:

Code: Select all

final_filename + " does not exist"


The result of the addition is a invalid String... But final_finename is a well-formed String...

In the operator + of String, that you can find here:

Code: Select all

String operator+(const String& str, const char* c_str)
{
   String tmp(str);
   tmp.append(c_str);
   return tmp;
}

(String.cpp)

tmp is set to NULL, but str and c_str are corrects...

Is it a bug or bad configuration from myself?

Thank you in advance

Edit: I built CeGui without boost, I don't know if this is a mandatory library or not, I had real difficulties to simply build it as the documentation miss real important information about dependencies.

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

Re: Crash on String concatenation

Postby Ident » Tue Apr 10, 2018 05:39

Which version of CEGUI?

Boost is only needed for CEED.
CrazyEddie: "I don't like GUIs"

kryx
Just popping in
Just popping in
Posts: 6
Joined: Wed Feb 22, 2017 09:18

Re: Crash on String concatenation

Postby kryx » Tue Apr 10, 2018 08:37

I downloaded the 0.8.7 version from your download page 5 days ago by clicking on "Source code packaged a a .zip file"

Thank you for the information about boost, I'm happy to don't need to install it :)

Edit: I downloaded the dependencies the same time

kryx
Just popping in
Just popping in
Posts: 6
Joined: Wed Feb 22, 2017 09:18

Re: Crash on String concatenation

Postby kryx » Tue Apr 10, 2018 16:57

Ok, I'm stupid. The exception was catched by visual studio and I thought that it was a crash.

So in fact all is working as intended... Can you suppress that post to save my honor? :oops:

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

Re: Crash on String concatenation

Postby Ident » Tue Apr 10, 2018 18:01

No
CrazyEddie: "I don't like GUIs"

kryx
Just popping in
Just popping in
Posts: 6
Joined: Wed Feb 22, 2017 09:18

Re: Crash on String concatenation

Postby kryx » Tue Apr 10, 2018 21:40

Nooooo,

I will rename, change country, change my faces, remove my fingerprints, create a sect and never speak to the rest of the world now....

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

Re: Crash on String concatenation

Postby Ident » Wed Apr 11, 2018 05:16

I will be able to buy this info about you from the Zuck
CrazyEddie: "I don't like GUIs"


Return to “Bug Reports, Suggestions, Feature Requests”

Who is online

Users browsing this forum: No registered users and 4 guests