Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: [SFML 2] Segfault with window clear & crash with RenderTexture clear  (Read 1560 times)

0 Members and 1 Guest are viewing this topic.

Bloodsword

  • Newbie
  • *
  • Posts: 1
    • View Profile
Hello,

This post is about Linux free  radeon driver issues.
My test computer running on :
  System :  openSUSE 11.4 (x86_64)
 GPU : HD 5770
  2D Driver :  radeon
  3D Driver  : R600 classic (7.10.2)

This  code  causes segfault at the end, when window is destroyed.
int main(){
  sf::RenderWindow window(sf::VideoMode(800, 600, 32), "test");
  bool running = true;
    while (running)
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed) running = false;
        }
        window.clear();
        window.display();        
    }
}

If I remove window.clear() there is no segfault. Segfault happen when XCloseDisplay is called and when  glClear(GL_COLOR_BUFFER_BIT) has been used before.

This code causes PC crash :
int main(){
  sf::RenderWindow window(sf::VideoMode(800, 600, 32), "test");
 
  bool running = true;
  sf::RenderTexture texture;
 
  if (!texture.create(500, 500)){
    std::cout<<"failed to create render texture"<<std::endl;
     return -1;
  }
 
  while (running)
  {
      sf::Event event;

      while (window.pollEvent(event))
      {
          if (event.type == sf::Event::Closed) running = false;
      }
     
      window.clear();
      texture.clear(sf::Color::Red);
      texture.display();
      window.display();        
  }
}
If I remove  texture.clear it runs.

I have tested both code in a similar configuration with fglrx driver (not free) and it was OK.
I thought it could be useful for people who have these problems to know these are actually driver issues.
Maybe it could be fix in the SFML but I am not really optimist about that.

Edit: I forgot to said that I use Git version.
« Last Edit: September 01, 2012, 02:42:21 pm by Bloodsword »