| Summary: | SDL_CreateWindow(w=INT_MAX, h=INT_MAX) causes program to hang | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Andrew Church <achurch+sdl> |
| Component: | video | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | ||
| Version: | 2.0.0 | ||
| Hardware: | x86_64 | ||
| OS: | Mac OS X 10.7 | ||
| Attachments: | createwindow-crash.c | ||
It was bad program termination due to an unhandled exception. This is fixed, thanks! https://hg.libsdl.org/SDL/rev/57c34a54b7c2 Thanks for the fix!
>+ @catch (NSException *e) {
>+ SDL_SetError("%s", [[e reason] UTF8String]);
>+ return -1;
>+ }
It looks like you need a [pool release] here? Or do I just not understand autorelease pools?
Side note: when I run this same unit test using Win32 SDL2 under Wine on Linux, it crashes the entire X server. That is probably not SDL's fault (: but I'll investigate further and open a new bug if appropriate.
Oh, you're right, I need to release the pool. Thanks for catching that. Oh, you're right, I need to release the pool. Thanks for catching that. |
Created attachment 1394 [details] createwindow-crash.c I have a unit test which (eventually) calls SDL_CreateWindow() with width and height set to INT_MAX (0x7FFFFFFF). In SDL 1.2.15, the equivalent SDL_SetVideoMode() call failed as expected, but in SDL 2.0.0 on OSX 10.7.5, SDL_CreateWindow() causes the program to hang with the following log output: <Error>: kCGErrorRangeCheck: CGSNewWindowWithOpaqueShape: Cannot create window <Error>: kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch errors as they are logged. Error (1007) creating CGSWindow on line 263 I don't expect the window creation call to actually succeed (: but I do expect it to return failure rather than hang. I've attached a short program demonstrating the bug. For some reason, the program crashes with a backtrace rather than hanging, but it still doesn't complete the SDL_CreateWindow() call. Incidentally, the call succeeds if I set an absolute position for the window instead of SDL_WINDOWPOS_UNDEFINED or SDL_WINDOWPOS_CENTERED. I haven't tested this against HG, but I looked over the log and didn't see any changes that appeared relevant.