| Summary: | Creating a window with GL and resizable flags may crash | ||
|---|---|---|---|
| Product: | SDL | Reporter: | jordirovira <jordi> |
| Component: | video | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | major | ||
| Priority: | P2 | CC: | jordi |
| Version: | HG 2.0 | ||
| Hardware: | All | ||
| OS: | Linux | ||
I finally have time to look into this and I have found it:
in SDL_x11window around 520:
/* Setup the normal size hints */
if (!(window->flags & SDL_WINDOW_RESIZABLE)) {
sizehints.min_width = sizehints.max_width = window->w;
sizehints.min_height = sizehints.max_height = window->h;
sizehints.flags = PMaxSize | PMinSize;
}
sizehints.x = window->x;
sizehints.y = window->y;
sizehints.flags |= USPosition;
the sizehints.flags member is not initizalised if it doesn't enter the conditional. It is as easy as setting it to zero before the conditional.
Fixed, thanks! http://hg.libsdl.org/SDL/rev/963497e37d34 |
It can be reproduced by taking the testgl2.c example and adding this at line 217 state->window_flags |= SDL_WINDOW_RESIZABLE; When a window is created with a resiable flag on linux (and i think osx) there are uninitialised variables being used which can try to create a window with strange sizes. This is according to valgrind, in the window creation function. This sometimes crashes the window manager. And sometimes works fine.