Unable to load scheme
Moderators: CEGUI MVP, CEGUI Team
Unable to load scheme
Whenever I try to load a scheme the program aborts. Here's the last few lines of the log file:
27/02/2006 20:02:56 (InfL1) Attempting to load Scheme from file '../datafiles/schemes/WindowsLook.scheme'.
27/02/2006 20:02:56 (Error) Exception: Scheme::xmlHandler::startElement - Unexpected data was found while parsing the Scheme file: '' is unknown.
27/02/2006 20:02:56 (Error) Scheme::Scheme - loading of Scheme from file '../datafiles/schemes/WindowsLook.scheme' failed.
I've got another simple project that loads the same schemes fine. As far as I can tell everything is the same for both projects, directory layout, scheme loading code, etc.
Also, Valgrind reports for both projects some invalid reads inside SchemeManager::loadScheme(), specifically down in TiXmlDocument::Parse() (tinyxmlparser.cpp:756), which calls TiXmlBase::SkipWhiteSpace() (tinyxmlparser.cpp:337). I'm not sure if they're related or not.
Any ideas?
27/02/2006 20:02:56 (InfL1) Attempting to load Scheme from file '../datafiles/schemes/WindowsLook.scheme'.
27/02/2006 20:02:56 (Error) Exception: Scheme::xmlHandler::startElement - Unexpected data was found while parsing the Scheme file: '' is unknown.
27/02/2006 20:02:56 (Error) Scheme::Scheme - loading of Scheme from file '../datafiles/schemes/WindowsLook.scheme' failed.
I've got another simple project that loads the same schemes fine. As far as I can tell everything is the same for both projects, directory layout, scheme loading code, etc.
Also, Valgrind reports for both projects some invalid reads inside SchemeManager::loadScheme(), specifically down in TiXmlDocument::Parse() (tinyxmlparser.cpp:756), which calls TiXmlBase::SkipWhiteSpace() (tinyxmlparser.cpp:337). I'm not sure if they're related or not.
Any ideas?
- martignasse
- Just can't stay away
- Posts: 227
- Joined: Thu Apr 14, 2005 08:10
- Location: Lyon, FRANCE
- martignasse
- Just can't stay away
- Posts: 227
- Joined: Thu Apr 14, 2005 08:10
- Location: Lyon, FRANCE
Here's the scheme I'm trying to load:
Code: Select all
<?xml version="1.0" ?>
<GUIScheme Name="WindowsLook">
<Imageset Name="WindowsLook" Filename="../datafiles/imagesets/WindowsLook.imageset" />
<WindowSet Filename="CEGUIWindowsLook" />
</GUIScheme>
- martignasse
- Just can't stay away
- Posts: 227
- Joined: Thu Apr 14, 2005 08:10
- Location: Lyon, FRANCE
You'r scheme seem's ok, apparently.
But because you related TiXmlBase::SkipWhiteSpace() problems,
i looked more deeply and discover that you have an extra space caractere at the end of each lines, maybe it's that...
could be good to test whit xerces to see if the error occur and to validate you'r xml files.
hope it help.
But because you related TiXmlBase::SkipWhiteSpace() problems,
i looked more deeply and discover that you have an extra space caractere at the end of each lines, maybe it's that...
could be good to test whit xerces to see if the error occur and to validate you'r xml files.
hope it help.
- martignasse
- Just can't stay away
- Posts: 227
- Joined: Thu Apr 14, 2005 08:10
- Location: Lyon, FRANCE
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
If you're talking about the null termination issue, I don't think that's it (I was discussing this with lindquist on irc last night) because I created a custom resource provider and added an extra null byte at the end of the buffer that I'm giving to tinyxml and that didn't do anything except fix one of the 1 byte read errors that valgrind was reporting.
I haven't edited TinyXML, and I'm on Linux.
I did some debugging last night and it looks like some strings are being corrupted. For instance, the GUIScheme attribute "Name" should have had a value of "TaharezLook", but it looked like it was being passed around as just "ook", and the address of the pointer was set 8 bytes ahead of where it should have been.
I haven't edited TinyXML, and I'm on Linux.
I did some debugging last night and it looks like some strings are being corrupted. For instance, the GUIScheme attribute "Name" should have had a value of "TaharezLook", but it looked like it was being passed around as just "ook", and the address of the pointer was set 8 bytes ahead of where it should have been.
It looks like that when a string is being passed to attrs.add() inside TinyXMLDocument::processElement() it's being cast wrong, since the String is being constructed with "ook" instead of "TaharezLook". At least thats the way it looks to me; there might be a reasonable explanation for that and it's not a problem at all.
I don't see why it would be a casting problem, since TinyXML is returing a char* and it's being cast as a utf8* prior to being sent to the String constructor, and utf8* is just a uint8* typedef.
I don't see why it would be a casting problem, since TinyXML is returing a char* and it's being cast as a utf8* prior to being sent to the String constructor, and utf8* is just a uint8* typedef.
I can get TinyXML to work. I downloaded the latest version and copied that into the tinyxml directory of the source, edited tinyxml.h and added #define TIXML_USE_STL, and build CEGUI. Once I do that everything works and valgrind is happy. I haven't tried enabling STL in the version of tinyxml that comes with 0.4.1 of CEGUI by default.
So, what does this mean? TinyXML has a bug?
So, what does this mean? TinyXML has a bug?
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Who is online
Users browsing this forum: No registered users and 16 guests