SFML community forums
Help => Window => Topic started by: OniLinkPlus on November 21, 2010, 09:28:26 pm
-
Every time I close an SFML window on Linux, I get a segmentation fault. It even happens in the examples.
-
Which version of SFML? Are you sure that you don't have more than one version of SFML installed?
-
Which version of SFML? Are you sure that you don't have more than one version of SFML installed?
I have the latest build of SFML2. In the cmake generated makefiles, is there a way to remove the installed SFML2 so I can be sure there's only one installed?
EDIT: yes, only one version of SFML is installed.
-
Are you really sure? Because I have changed SFML 2 libraries names and path many times.
-
Are you really sure? Because I have changed SFML 2 libraries names and path many times.
Yes, I went into /usr/lib, /usr/local/lib, /usr/include, and /usr/local/include, deleted everything SFML, and reinstalled.
-
There's no known bug on Linux, something must be wrong but I don't know what if there's only one version of SFML on your PC and it's properly installed.
-
Maybe he can specify some info about the graphics card and drivers? Also probably give you the call stack when the app crashes.
Segmentation Fault is generated when you are accessing memory that isn't yours to touch. Like NULL or something like that. If it isn't a generic Linux bug then I would say it is something specific to his computer which would be the drivers.
-
Maybe he can specify some info about the graphics card and drivers? Also probably give you the call stack when the app crashes.
Segmentation Fault is generated when you are accessing memory that isn't yours to touch. Like NULL or something like that. If it isn't a generic Linux bug then I would say it is something specific to his computer which would be the drivers.
I have an ATi HD4850, and I'm using the open-source drivers. How would I go about getting the call stack?
-
If you are using Code::Blocks then you can just take a screenshot while debugging the application that crashes and having the "CallStack" window open of course.
-
I'm having the same issue.
When I close a window, a segmentation fault occurs.
The call stack points to
c:\windows\system32\ig4dev32.dll
The code is perfect and very minimal. I have not had this problem using SFML 1.6, Im using the latest build of SFML 2.0.
-Windows 7 32-bit
-Intel integrated graphics card
-Code blocks mingw32
The funny thing is, I've had this error before on another project. The project was fairly complicated, and although I had the same problem initially, it disappeared as development went on. It seems to only occur when I use a minimal example:
sf::RenderWindow window(sf::VideoMode(WINDOW_WIDTH, WINDOW_HEIGHT, 32), "solo");
while(window.IsOpened())
{
sf::Event windowEvent;
while(window.GetEvent(windowEvent))
{
if(windowEvent.Type == sf::Event::Closed)
window.Close();
}
window.Clear();
window.Display();
}
-
I'm getting the same. I've been getting it for long but I didn't think much about it since it doesn't have any ill effects. The backtrace shows the segfault occurring deep inside my r300g driver. That's the mesa radeon driver with the gallium framework.
-
Glad to know I'm not the only one with this problem. Reassures me that I haven't gone completely insane yet.
-
Sorry for digging up this old article, but I think it's because the code would call window.Clear() and window.Display() after window.Close() is called. You should use probably use:
sf::RenderWindow window(sf::VideoMode(WINDOW_WIDTH, WINDOW_HEIGHT, 32), "solo");
while(window.IsOpened())
{
sf::Event windowEvent;
while(window.GetEvent(windowEvent))
{
if(windowEvent.Type == sf::Event::Closed)
{
window.Close();
return; // <-- FIX
}
}
window.Clear();
window.Display();
}
-
Sorry for digging up this old article, but I think it's because the code would call window.Clear() and window.Display() after window.Close() is called. You should use probably use:
sf::RenderWindow window(sf::VideoMode(WINDOW_WIDTH, WINDOW_HEIGHT, 32), "solo");
while(window.IsOpened())
{
sf::Event windowEvent;
while(window.GetEvent(windowEvent))
{
if(windowEvent.Type == sf::Event::Closed)
{
window.Close();
return; // <-- FIX
}
}
window.Clear();
window.Display();
}
That shouldn't cause an issue, it doesn't on Windows. Does this only happen in the debugger? On Windows I get this issue but only when running from Visual Studio.
-
Using a closed sf::Window is fine, users don't have to worry about that.
-
I took the code and tried compiling it. No problems at all, even with GDB running with breakpoints. Oh well, sorry for the pointless digging. I guess I should have tested it out before I posted.