Blank Taharez look tooltip text causes a crash.

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

agamemnus
Just can't stay away
Just can't stay away
Posts: 185
Joined: Sun Mar 14, 2010 04:21

Blank Taharez look tooltip text causes a crash.

Postby agamemnus » Wed May 12, 2010 08:00

:(

User avatar
scriptkid
Home away from home
Home away from home
Posts: 1178
Joined: Wed Jan 12, 2005 12:06
Location: The Hague, The Netherlands
Contact:

Re: Blank Taharez look tooltip text causes a crash.

Postby scriptkid » Wed May 12, 2010 09:31

Did you try to debug? What does the log say?
Check out my released snake game using Cegui!

agamemnus
Just can't stay away
Just can't stay away
Posts: 185
Joined: Sun Mar 14, 2010 04:21

Re: Blank Taharez look tooltip text causes a crash.

Postby agamemnus » Wed May 12, 2010 15:39

The log doesn't say anything after I load things.
The crash isn't in loading.
What I mean by blank is a string with 0 chars: "".
Tooltip works fine when the string is " ", for instance.

I didn't try to debug... too much hassle to recompile the debug version.

Doesn't it crash for you?

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Blank Taharez look tooltip text causes a crash.

Postby CrazyEddie » Thu May 13, 2010 08:46

The tooltip text for all windows is by default the empty string, so no, this does not happen normally.

I didn't try to debug... too much hassle to recompile the debug version.

Your attitude really does leave a lot to be desired. If you can't be bothered to try and help yourself, why should anybody else bother to help you either?

CE.

agamemnus
Just can't stay away
Just can't stay away
Posts: 185
Joined: Sun Mar 14, 2010 04:21

Re: Blank Taharez look tooltip text causes a crash.

Postby agamemnus » Thu May 13, 2010 17:08

Well, I thought it was something that everyone experienced... thus trying to help everyone... I will think about this... I think I might know the reason, but I need to test.

agamemnus
Just can't stay away
Just can't stay away
Posts: 185
Joined: Sun Mar 14, 2010 04:21

Re: Blank Taharez look tooltip text causes a crash.

Postby agamemnus » Thu May 13, 2010 18:39

When value is a *char, 'setProperty(name, value)' crashes when that char equals 0. Since the pointer to a blank char's data bit isn't stored anywhere, it becomes 0. 'setProperty(name, "")' doesn't crash, though.

Jamarr
CEGUI MVP
CEGUI MVP
Posts: 812
Joined: Tue Jun 03, 2008 23:59
Location: USA

Re: Blank Taharez look tooltip text causes a crash.

Postby Jamarr » Mon May 17, 2010 16:36

This is not a "help me learn c/c++ forum". I do not understand why you keep asking basic language questions in this forum.

Code: Select all

char* mystr1 = 0;
char* mystr2 = "";


These are not equivalent.
If somebody helps you by replying to your thread, upvote him/her as a thanks! Make sure to include your CEGUI.log and everything you tried when posting! And remember that we are not magicians!

agamemnus
Just can't stay away
Just can't stay away
Posts: 185
Joined: Sun Mar 14, 2010 04:21

Re: Blank Taharez look tooltip text causes a crash.

Postby agamemnus » Mon May 17, 2010 18:26

The point is that it crashes when I send it 0, and it shouldn't.

Jamarr
CEGUI MVP
CEGUI MVP
Posts: 812
Joined: Tue Jun 03, 2008 23:59
Location: USA

Re: Blank Taharez look tooltip text causes a crash.

Postby Jamarr » Mon May 17, 2010 19:24

And why should it not crash? The function is specifically asking for a string. Is a null-pointer a string? No, it is not. Do you know what happens if you assign a null-pointer to the c++ standard std::string object? "Undefined behavior." And do you know why the c++ standard specifically states that this behavior is undefined? Because, again, a null-pointer is not a string. If it is not a string, then it certainly cannot be an empty-string, a partial string, or any type of string.

So the first problem is that you do not understand how c-strings work, or even what a string is; this is a core c++ concept that a proper teacher and/or book would have explained to you. Second, you obviously did not evaluate your code. How do I know this? Because it would have been obvious to you that "" is a pointer to a memory location with a value of 0; it is not the value 0. Third, had you actually taken the time to properly debug and step through your code you would have seen precisely where the problem occurs: CEGUI::String uses strlen, a standard c-string function, to determine the length of the c-string. If you had taken 5 minutes to google anything along the lines of "strlen null" your question would have been answered, you would not have wasted your time making this thread, you would not have wasted the time of everyone who posted in this thread, I would not have had to go off on you in another equally ridiculous thread, and your problem would have already been resolved.

I am not trying to be the villian here, but you are not making it easy for anyone to play the nice and helpful community member role when you insist on belittling our time.
If somebody helps you by replying to your thread, upvote him/her as a thanks! Make sure to include your CEGUI.log and everything you tried when posting! And remember that we are not magicians!

agamemnus
Just can't stay away
Just can't stay away
Posts: 185
Joined: Sun Mar 14, 2010 04:21

Re: Blank Taharez look tooltip text causes a crash.

Postby agamemnus » Mon May 17, 2010 19:26

I've already established that it does not accept a null pointer several posts ago; in fact, 4 days ago.

Jamarr
CEGUI MVP
CEGUI MVP
Posts: 812
Joined: Tue Jun 03, 2008 23:59
Location: USA

Re: Blank Taharez look tooltip text causes a crash.

Postby Jamarr » Mon May 17, 2010 19:47

I know that you have a problem with the English language, but if you carefully read my post I clearly explained why this is not an issue.

As a suggestion, if you stop taking things so personally, calmly read and follow the suggestions I've given you, you will find it easier to receive help and others will be more willing to help you.
If somebody helps you by replying to your thread, upvote him/her as a thanks! Make sure to include your CEGUI.log and everything you tried when posting! And remember that we are not magicians!

agamemnus
Just can't stay away
Just can't stay away
Posts: 185
Joined: Sun Mar 14, 2010 04:21

Re: Blank Taharez look tooltip text causes a crash.

Postby agamemnus » Mon May 17, 2010 20:03

Hi,
You asserted (among other things) that:
* it should crash if it receives a null pointer.
* I didn't know that it should crash if it receives a null pointer.

Do you disagree with this assessment?

I responded, saying:

"The point is that it crashes when I send it 0, and it shouldn't."
IE: it should not crash if it receives a null pointer, but instead replace the parameter value with a "" string.

"I've already established that it does not accept a null pointer several posts ago; in fact, 4 days ago."
IE: I already knew that it crashes if it receives a null pointer.

Jamarr
CEGUI MVP
CEGUI MVP
Posts: 812
Joined: Tue Jun 03, 2008 23:59
Location: USA

Re: Blank Taharez look tooltip text causes a crash.

Postby Jamarr » Mon May 17, 2010 23:02

"The point is that it crashes when I send it 0, and it shouldn't."
IE: it should not crash if it receives a null pointer, but instead replace the parameter value with a "" string.


As I've already explained, this is intended behavior. For some reason, you have this notion that the CEGUI library should encourage bad programming practices. My reasons for disagreeing have already been posted.

"I've already established that it does not accept a null pointer several posts ago; in fact, 4 days ago."
IE: I already knew that it crashes if it receives a null pointer.


You completely missed the point: there was no reason for you to start this thread to begin with. My early posts are already quite clear on this matter.
If somebody helps you by replying to your thread, upvote him/her as a thanks! Make sure to include your CEGUI.log and everything you tried when posting! And remember that we are not magicians!

agamemnus
Just can't stay away
Just can't stay away
Posts: 185
Joined: Sun Mar 14, 2010 04:21

Re: Blank Taharez look tooltip text causes a crash.

Postby agamemnus » Mon May 17, 2010 23:29

As I've already explained, this is intended behavior. For some reason, you have this notion that the CEGUI library should encourage bad programming practices. My reasons for disagreeing have already been posted.

I already know what you think how it should work. That's not the issue. You are telling me that any other way is always wrong, and insulting and flame-baiting me all the way.

You completely missed the point: there was no reason for you to start this thread to begin with. My early posts are already quite clear on this matter.

I started the thread because I saw that passing a "" was crashing, which I later learned was turned into a null pointer in my programming language instead of an actual "". Later on, I posted a comment that it should accept 0 IE a null pointer. So yes, there was a reason to start this thread.

There was no reason for you to name-call and flame-bait me and pretend to teach me that which I already know.

Jamarr
CEGUI MVP
CEGUI MVP
Posts: 812
Joined: Tue Jun 03, 2008 23:59
Location: USA

Re: Blank Taharez look tooltip text causes a crash.

Postby Jamarr » Tue May 18, 2010 17:07

agamemnus wrote:I already know what you think how it should work. That's not the issue. You are telling me that any other way is always wrong, and insulting and flame-baiting me all the way.


Look, I am not trying to "flame-bait" you. I am simply stating what I see. And you should not take ignorance as an insult. We are all ignorant in different ways; the sooner everyone accepts that, the sooner we can all get along (and that goes for the whole world...). I am all for supporting users who attempt to diagnose their own problems, and when cornered, post all relevant information.

I explained why I disagreed with you. There is nothing wrong with debate; you should not take information that goes against your beliefs as insulting (just don't try telling that to a religious extremist...).

I started the thread because I saw that passing a "" was crashing, which I later learned was turned into a null pointer in my programming language instead of an actual "". Later on, I posted a comment that it should accept 0 IE a null pointer. So yes, there was a reason to start this thread. There was no reason for you to name-call and flame-bait me and pretend to teach me that which I already know.


First of all, I have never lowered myself to name-calling. Second, it is obvious from your previous posts that you did not understand the difference between 0 and ""; and from your other threads that you do not understand some of the core c++ or general programming concepts. I find it quite funny that you are now trying to clear your ignorance. I really cannot understand why you are so ashmed of it - I belive that everyone should embrace their ignorance.

Anyway, you've given no sensible reason as to why CEGUI should allow this behavior. And if the c++ standard does not allow this behavior, and they've debated this far longer than we ever will, I doubt you will ever derive to a sensible argument. Since this thread is no longer going anywhere, I'm ending it here.
If somebody helps you by replying to your thread, upvote him/her as a thanks! Make sure to include your CEGUI.log and everything you tried when posting! And remember that we are not magicians!


Return to “Help”

Who is online

Users browsing this forum: No registered users and 19 guests