SFML community forums

Help => General => Topic started by: heishe on November 18, 2012, 10:30:45 pm

Title: Stack corruption bug with sf::Shape
Post by: heishe on November 18, 2012, 10:30:45 pm
I posted this in General since it might be a VS2012 bug.

Basically, in any function that looks like this:

void func()
{
   sf::RectangleShape foo; //can be any kind of shape
}

The code will crash upon exiting the func() function, because foo creates a stack corruption. This is with Visual Studio 2012, standard compiler, SFML2 RC (downloaded like a week ago).

It should be noted that the same happens when I used a dynamically allocated shape that I delete at the end of the function. But instead of a stack corruption, it will be a heap corruption, of course.

Any idea what could be the cause of this?

When debugging, it seems like the shape isn't initialized correctly. The vectors inside the attributes of sf::Shape have weird sizes (e.g. 6 and 12) and the values of their elements seem like "undefined behavior' kind of values.
Title: Re: Stack corruption bug with sf::Shape
Post by: eXpl0it3r on November 18, 2012, 10:39:42 pm
This is with Visual Studio 2012, standard compiler, SFML2 RC (downloaded like a week ago).
Does that mean you downloaded it from the official download page or from GitHub and built it yourself?
Because for VS 2012 you have to build SFML newly (or use my nightly builds (http://en.sfml-dev.org/forums/index.php?topic=9513.0)).